JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-6318

Tempfile#open does not return the value of the block given to it

    Details

    • Number of attachments :
      0

      Description

      Tempfile#open's behavior has changed from 1.8 to 1.9, but that change has not been reflected in JRuby 1.9 mode. When given a block, it used to return nil in 1.8, but in 1.9 it is supposed to return the value of the block. JRuby in 1.9 mode continues to return nil.

      in MRI ruby I get:
      $ irb
      1.9.3p0 :001 > require 'tempfile'
      1.9.3p0 :006 > Tempfile.open('foo')

      { |tmp| tmp.path }
      => "/tmp/foo20120105-20998-z3gawt"

      In JRuby, however:
      $ JRUBY_OPTS=--1.9 irb
      jruby-1.7.0.dev :001 > require 'tempfile'
      jruby-1.7.0.dev :002 > Tempfile.open('foo') { |tmp| tmp.path }


      => nil

        Activity

        Hide
        Hiro Asari added a comment -

        Thanks for reporting.

        Fixed on the master (0d43528e) and the 1.6 (9affb57a).

        Show
        Hiro Asari added a comment - Thanks for reporting. Fixed on the master (0d43528e) and the 1.6 (9affb57a).

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Alex Khesin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: