From 19fe190a7a467ca66e59c0ddd2c23da67e0aacb3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Fri, 10 Mar 2023 11:02:39 +0100 Subject: [PATCH] File.exists? is deprecated --- lib/lnrpc/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lnrpc/client.rb b/lib/lnrpc/client.rb index a4d8c12..613a818 100644 --- a/lib/lnrpc/client.rb +++ b/lib/lnrpc/client.rb @@ -16,13 +16,13 @@ module Lnrpc if options.has_key?(:credentials) # if there are non hex values prvided we assume it's the certificate file as string otherwise we assume it's the hex value self.credentials = options[:credentials].match?(/\H/) ? options[:credentials] : [options[:credentials]].pack('H*') - elsif File.exists?(::File.expand_path(options[:credentials_path] || DEFAULT_CREDENTIALS_PATH)) + elsif File.exist?(::File.expand_path(options[:credentials_path] || DEFAULT_CREDENTIALS_PATH)) self.credentials = ::File.read(::File.expand_path(options[:credentials_path] || DEFAULT_CREDENTIALS_PATH)) else self.credentials = nil end - if !options.has_key?(:macaroon) && File.exists?(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH)) + if !options.has_key?(:macaroon) && File.exist?(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH)) options[:macaroon] = ::File.read(::File.expand_path(options[:macaroon_path] || DEFAULT_MACAROON_PATH)).unpack("H*") end self.macaroon = options[:macaroon]