1
0
mirror of https://github.com/bumi/lnrpc synced 2025-07-24 10:36:56 +00:00

File.exists? is deprecated

This commit is contained in:
bumi 2023-03-10 11:02:39 +01:00
parent f23e408457
commit 19fe190a7a

View File

@ -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]