Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Key Path Fails to Load Even When Readable #135

Open
inspiredstuffs opened this issue Jan 12, 2025 · 0 comments
Open

JSON Key Path Fails to Load Even When Readable #135

inspiredstuffs opened this issue Jan 12, 2025 · 0 comments

Comments

@inspiredstuffs
Copy link

About this line: https://github.com/decision-labs/fcm/blob/ec489fa22dd11185d487f781c009bca782144d17/lib/fcm.rb#L296C22-L296C35

I suggest the json_key method should look like this:

 def json_key
    @json_key ||= if @json_key_path.respond_to?(:read)
                    @json_key_path.read
                  else
                    File.open(@json_key_path)
                  end
  end

This will make it compatible with an instance of StringIO object etc.

@inspiredstuffs inspiredstuffs changed the title The JSON Key Path isn't read if it can be read JSON Key Path Fails to Load Even When Readable Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant