jruby/jruby — pull request #945 by Sinjo (2013-08-04 00:25:29+00:00)
Title: In Ruby 2.0, String#lines returns an Array, rather than an Enumerator

Ruby 2.0 has changed the return type of String#lines to Array, from Enumerator. The difference in behaviour between MRI 2.0.0 and JRuby 1.7.4 with the --2.0 argument supplied is:

```
In MRI 2.0.0-p247:
sinjo@widdershins:~/projects/jruby-file-encoding$ rvm use 2.0.0
Using /home/sinjo/.rvm/gems/ruby-2.0.0-p247

sinjo@widdershins:~/projects/jruby-file-encoding$ ./demo input_file.txt
["first line\r\n", "second line\r\n", "third line"]
"first line\r\n"

-----

In JRuby 1.7.4 with JRUBY_OPTS=--2.0:
sinjo@widdershins:~/projects/jruby-file-encoding$ rvm use jruby
Using /home/sinjo/.rvm/gems/jruby-1.7.4

sinjo@widdershins:~/projects/jruby-file-encoding$ ./demo input_file.txt
[#]
#
```

Output taken from [this gist](https://gist.github.com/Sinjo/6125035)