Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-27 fffffff) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02) [Windows 7-amd64-java]
    • Number of attachments :
      0

      Description

      Hi.

      I look at Win32API.rb related to JRUBY-6501, I noticed the problem of Config::CONFIG.

      >bin\jruby --version
      jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-02-27 fffffff) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_02) [Windows 7-amd64-java]
      >bin\jruby -rrbconfig -e "puts Config::CONFIG['host_os']"
      (snip)/jruby/lib/ruby/shared/Win32API.rb:7 warning: warning: variable $KCODE is no longer effec
      tive
      mswin32

      >pik use 193

      >ruby --version
      ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

      >ruby -rrbconfig -e "puts Config::CONFIG['host_os']"
      -e:1: Use RbConfig instead of obsolete and deprecated Config.
      mingw32

      "Config" is deprecated. RbConfig::CONFIG should be used instead of the Config::CONFIG.

      Thanks.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        I don't know if I agree with the mechanism for deprecating Config, but I've implemented it in JRuby for 1.7. Essentially, instead of defining the RbConfig module as Config, aliased to RbConfig, they define it as RbConfig and define an autoload to rbconfig/obsolete.rb that warns and aliases it back to Config. Kinda icky, but benign.

        In the process, I also realized our stdlib had several files out of date, missing from our copy, or not actually in MRI's copy, so I did a more complete sync of stdlib. I also cleaned up all Config:: references in tests, etc, that might be touched by 1.9 mode, to avoid that autoload and warning.

        commit 9b3229a6f9afb7d6569c2368ee24d534625abb23
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Mon Feb 27 10:31:35 2012 -0600
        
            RbConfig and 1.9 stdlib cleanup.
            
            * Add autoloaded warning for "Config" constant
            * Clean up references to "Config" in files potentially touched in 1.9 mode
            * Update missing/divergent stdlib files
            * Remove all 'syck' code from 1.9 stdlib
            * Add warning to 'ripper' lib
            * Copy over missing matrix/ files
        
        Show
        Charles Oliver Nutter added a comment - I don't know if I agree with the mechanism for deprecating Config, but I've implemented it in JRuby for 1.7. Essentially, instead of defining the RbConfig module as Config, aliased to RbConfig, they define it as RbConfig and define an autoload to rbconfig/obsolete.rb that warns and aliases it back to Config. Kinda icky, but benign. In the process, I also realized our stdlib had several files out of date, missing from our copy, or not actually in MRI's copy, so I did a more complete sync of stdlib. I also cleaned up all Config:: references in tests, etc, that might be touched by 1.9 mode, to avoid that autoload and warning. commit 9b3229a6f9afb7d6569c2368ee24d534625abb23 Author: Charles Oliver Nutter <headius@headius.com> Date: Mon Feb 27 10:31:35 2012 -0600 RbConfig and 1.9 stdlib cleanup. * Add autoloaded warning for "Config" constant * Clean up references to "Config" in files potentially touched in 1.9 mode * Update missing/divergent stdlib files * Remove all 'syck' code from 1.9 stdlib * Add warning to 'ripper' lib * Copy over missing matrix/ files
        Hide
        Hiro Asari added a comment -

        I don't think it's quite right.

        irb(main):002:0> RbConfig.ruby
        /Users/asari/Development/src/jruby/lib/ruby/1.9/rbconfig/obsolete.rb:2: Use RbConfig instead of obsolete and deprecated Config.
        => "/Users/asari/Development/src/jruby/bin/jruby"
        
        Show
        Hiro Asari added a comment - I don't think it's quite right. irb(main):002:0> RbConfig.ruby /Users/asari/Development/src/jruby/lib/ruby/1.9/rbconfig/obsolete.rb:2: Use RbConfig instead of obsolete and deprecated Config. => "/Users/asari/Development/src/jruby/bin/jruby"
        Hide
        Charles Oliver Nutter added a comment -

        The remaining issue was me fat-fingering something. All should be proper now.

        Show
        Charles Oliver Nutter added a comment - The remaining issue was me fat-fingering something. All should be proper now.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Satoru Chinen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: