miyucy / brotli

MIT License
59 stars 14 forks source link

Allow `Brotli.inflate` to accept `StringIO`, beside just `String` #48

Closed weshatheleopard closed 1 month ago

weshatheleopard commented 1 month ago

When I have an object of type StringIO, I have to read it in first, and only then pass it to the gem. It would be nice to handle that inside the gem.

At the very least, it would be something similar to:

def inflate(str_or_io)
  if str_or_io.is_a?(IO) then
    Brotli.inflate(str_or_io.read)
  else
    Brotli.inflate(str_or_io)
  end
end

can be done until proper stream reader is implemented in the C library.

miyucy commented 1 month ago

I appreciate your suggestion. It's very reasonable. I'll implement this.

weshatheleopard commented 4 weeks ago

Now when this is fixed, can you please update it on RubyGems?

miyucy commented 3 weeks ago

@weshatheleopard I apologize for the late response. I've just published a new version. If you encounter any issues with the update or have any questions, please don't hesitate to open an issue on the project's repository. I appreciate your patience and support.