IO.foreach: Can't convert Hash into String
------------------------------------------

                 Key: JRUBY-5532
                 URL: http://jira.codehaus.org/browse/JRUBY-5532
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9.2
    Affects Versions: JRuby 1.6RC2, JRuby 1.6RC1
            Reporter: Clemens Fuchslocher
         Attachments: foreach.rb

The following code works fine with Ruby, but fails with JRuby.

[^foreach.rb]:

{noformat}
IO.foreach('foreach.rb', mode: 'r', encoding: 'iso-8859-1') do |line|
        puts line
end

{noformat}

With JRuby 1.6.0.RC2:

{noformat}
$ jruby --1.9 --version
jruby 1.6.0.RC2 (ruby 1.9.2 patchlevel 136) (2011-02-09 5434c72) (Java 
HotSpot(TM) Client VM 1.6.0_22) [linux-i386-java]

$ jruby --1.9 foreach.rb
org/jruby/RubyIO.java:3154:in `foreach': can't convert Hash into String 
(TypeError)
        from foreach.rb:1:in `(root)'
{noformat}

With Ruby 1.9.2p180:

{noformat}
$ ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]

$ ruby foreach.rb
IO.foreach('foreach.rb', mode: 'r', encoding: 'iso-8859-1') do |line|
        puts line
end

{noformat}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to