[tex-live] ConTeXt: Ruby 1.9 deprecation warnings

Ken Brown kbrow1i at gmail.com
Wed Jan 9 15:30:05 CET 2013


Using ConTeXt with Ruby 1.9 produces warnings like the following:

$ texexec --version
[...]
Use RbConfig instead of obsolete and deprecated Config.

The attached patch, to be applied in 
trunk/Master/texmf-dist/scripts/context, silences the warnings without 
destroying compatibility with (at least) later versions of Ruby 1.8.

I don't know if TeX Live wants to support older versions of Ruby.  If 
so, you'd need a more complicated patch.

Ken
-------------- next part --------------
Index: ruby/base/kpse.rb
===================================================================
--- ruby/base/kpse.rb	(revision 28774)
+++ ruby/base/kpse.rb	(working copy)
@@ -61,7 +61,7 @@
     @@tracing       = false
     @@distribution  = 'web2c'
     @@crossover     = true
-    @@mswindows     = Config::CONFIG['host_os'] =~ /mswin/
+    @@mswindows     = RbConfig::CONFIG['host_os'] =~ /mswin/
 
     # @@distribution  = 'miktex' if ENV['PATH'] =~ /miktex[\\\/]bin/o
 
Index: ruby/base/switch.rb
===================================================================
--- ruby/base/switch.rb	(revision 28774)
+++ ruby/base/switch.rb	(working copy)
@@ -18,7 +18,7 @@
 
 require "rbconfig"
 
-$mswindows = Config::CONFIG['host_os'] =~ /mswin/
+$mswindows = RbConfig::CONFIG['host_os'] =~ /mswin/
 $separator = File::PATH_SEPARATOR
 
 class String
Index: ruby/base/system.rb
===================================================================
--- ruby/base/system.rb	(revision 28774)
+++ ruby/base/system.rb	(working copy)
@@ -12,7 +12,7 @@
 
 module System
 
-    @@mswindows   = Config::CONFIG['host_os'] =~ /mswin/
+    @@mswindows   = RbConfig::CONFIG['host_os'] =~ /mswin/
     @@binpaths    = ENV['PATH'].split(File::PATH_SEPARATOR)
     @@binsuffixes = if $mswindows then ['.exe','.com','.bat'] else ['','.sh','.csh'] end
     @@located     = Hash.new
Index: ruby/base/tool.rb
===================================================================
--- ruby/base/tool.rb	(revision 28774)
+++ ruby/base/tool.rb	(working copy)
@@ -159,7 +159,7 @@
 
     end
 
-    if Config::CONFIG['host_os'] =~ /mswin/ then
+    if RbConfig::CONFIG['host_os'] =~ /mswin/ then
 
         require 'Win32API'
 
Index: ruby/fcd_start.rb
===================================================================
--- ruby/fcd_start.rb	(revision 28774)
+++ ruby/fcd_start.rb	(working copy)
@@ -57,7 +57,7 @@
 
     exit unless @@rootpath
 
-    @@mswindows = Config::CONFIG['host_os'] =~ /mswin/
+    @@mswindows = RbConfig::CONFIG['host_os'] =~ /mswin/
     @@maxlength = 26
 
     require 'Win32API' if @@mswindows
Index: ruby/runtools.rb
===================================================================
--- ruby/runtools.rb	(revision 28774)
+++ ruby/runtools.rb	(working copy)
@@ -65,7 +65,7 @@
     end
 
     def platform
-        case Config::CONFIG['host_os']
+        case RbConfig::CONFIG['host_os']
             when /mswin/ then :windows
                          else :unix
         end
Index: ruby/texmfstart.rb
===================================================================
--- ruby/texmfstart.rb	(revision 28774)
+++ ruby/texmfstart.rb	(working copy)
@@ -135,7 +135,7 @@
 
 # kpse_merge_stop
 
-$mswindows = Config::CONFIG['host_os'] =~ /mswin/
+$mswindows = RbConfig::CONFIG['host_os'] =~ /mswin/
 $separator = File::PATH_SEPARATOR
 $version   = "2.1.0"
 $ownpath   = File.dirname($0)
Index: ruby/texsync.rb
===================================================================
--- ruby/texsync.rb	(revision 28774)
+++ ruby/texsync.rb	(working copy)
@@ -140,7 +140,7 @@
             texpaths = ['texmf','texmf-local','texmf-fonts','texmf-mswin','texmf-linux','texmf-macos']
         elsif option('terse') then
             texpaths = ['texmf','texmf-local','texmf-fonts']
-            case Config::CONFIG['host_os'] # or: Tool.ruby_platform
+            case RbConfig::CONFIG['host_os'] # or: Tool.ruby_platform
                 when /mswin/  then texpaths.push('texmf-mswin')
                 when /linux/  then texpaths.push('texmf-linux')
                 when /darwin/ then texpaths.push('texmf-macosx')


More information about the tex-live mailing list