Skip to content

JSON Key Path Fails to Load Even When Readable #135

@inspiredstuffs

Description

@inspiredstuffs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions