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

Suppress warning about IO#lines in Ruby 2.0 #8744

Merged
merged 1 commit into from Jan 4, 2013

Conversation

tricknotes
Copy link
Contributor

  • actionpack/lib/action_dispatch/middleware/exception_wrapper.rb:99: IO#lines is deprecated; use #each_line instead

actionpack/lib/action_dispatch/middleware/exception_wrapper.rb:99: IO#lines is deprecated; use #each_line instead
@goshacmd
Copy link
Contributor

goshacmd commented Jan 4, 2013

👍

@goshacmd
Copy link
Contributor

goshacmd commented Jan 4, 2013

rails(master)$ ack \\.lines
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
99:          lines = file.lines.drop(start).take(6)

actionpack/test/dispatch/debug_exceptions_test.rb
172:    assert_operator((output.rewind && output.read).lines.count, :>, 10)

guides/source/active_support_core_extensions.md
2239:invoice.lines.to_formatted_s(:db) # => "23,567,556,12"

Can you please change the rest two occurrences of lines as well?

@tricknotes
Copy link
Contributor Author

Thank you for your review @goshakkk

But I cannot because of the following reasons:

actionpack/test/dispatch/debug_exceptions_test.rb
172: assert_operator((output.rewind && output.read).lines.count, :>, 10)

This method is String#lines. It is not deprecated.

guides/source/active_support_core_extensions.md
2239:invoice.lines.to_formatted_s(:db) # => "23,567,556,12"

This method is probably Array#lines. It is not deprecated too.

@goshacmd
Copy link
Contributor

goshacmd commented Jan 4, 2013

Sorry, my bad.

rafaelfranca added a commit that referenced this pull request Jan 4, 2013
Suppress warning about IO#lines in Ruby 2.0
@rafaelfranca rafaelfranca merged commit 0cbc240 into rails:master Jan 4, 2013
@tricknotes tricknotes deleted the suppress-warning branch January 4, 2013 15:21
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

Successfully merging this pull request may close these issues.

None yet

3 participants