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

Global variable `$INPUT_RECORD_SEPARATOR' not initialized on ruby 2.0.0-p0 #75

Closed
webervin opened this issue Apr 20, 2013 · 3 comments
Closed

Comments

@webervin
Copy link

Using ruby 2.0.0-p0 via rbenv.

When i have '$/' in file i get cop 'Prefer $INPUT_RECORD_SEPARATOR over $/.'
However if replace $/ with $INPUT_RECORD_SEPARATOR
I get warning
W: 15: Global variable `$input_record_separator' not initialized
(wich is true as such variable seems not to exist, returning nil when queried in irb)

Offending file example

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 20, 2013

Some of the proper global variables are not defined unless you do require 'english'. This is one of them. I guess the message could be more informative.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 21, 2013

The English library is now mentioned where relevant. For instance the message you got will now be 'Prefer $INPUT_RECORD_SEPARATOR from the English library over $/.'

@krainboltgreene
Copy link

This should also be removed from the autocorrect. It just failed my tests in a way that wasn't very obvious at first.

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

3 participants