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

Deprecation FileStreamer-like object #2083

Closed
ericproulx opened this issue Jul 10, 2020 · 2 comments
Closed

Deprecation FileStreamer-like object #2083

ericproulx opened this issue Jul 10, 2020 · 2 comments
Labels

Comments

@ericproulx
Copy link
Contributor

Hi,

I would like stream attachments through grape. By reading the doc, I can do this :

class AttachmentStream
  attr_reader :response
  def initialize(response)
    @response = response
  end

  def each
    yield response.read_body
  end
end

source = URI(@attachment_context.url)
Net::HTTP.start(source.host, source.port, use_ssl: true) do |http|
  req = Net::HTTP::Get.new source
   http.request(req) do |res|
     stream AttachmentStream.new(res)
   end
end

Unfortunately, there is a warning that says :

'[DEPRECATION] Argument as FileStreamer-like object is deprecated. Use path to file instead.'

Is is still relevant ?

Thanks

@dblock
Copy link
Member

dblock commented Jul 10, 2020

Are you reading 1.4.0 docs? #1520 has not been released yet.

@dblock dblock added the bug? label Jul 10, 2020
@ericproulx
Copy link
Contributor Author

I was reading on master branch, sorry :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants