ruby-changes:20793
From: nobu <ko1@a...>
Date: Thu, 4 Aug 2011 15:44:24 +0900 (JST)
Subject: [ruby-changes:20793] nobu:r32841 (trunk): * tool/rbinstall.rb (Gem::Specification): may not be defined when
nobu 2011-08-04 15:44:13 +0900 (Thu, 04 Aug 2011) New Revision: 32841 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32841 Log: * tool/rbinstall.rb (Gem::Specification): may not be defined when cross-compiling and BASERUBY is 1.8. Modified files: trunk/ChangeLog trunk/tool/rbinstall.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 32840) +++ ChangeLog (revision 32841) @@ -1,3 +1,8 @@ +Thu Aug 4 15:44:10 2011 Nobuyoshi Nakada <nobu@r...> + + * tool/rbinstall.rb (Gem::Specification): may not be defined when + cross-compiling and BASERUBY is 1.8. + Thu Aug 4 11:30:36 2011 NARUSE, Yui <naruse@r...> * include/ruby/missing.h: define __syscall on OpenBSD as r32702. Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 32840) +++ tool/rbinstall.rb (revision 32841) @@ -17,6 +17,7 @@ require 'shellwords' require 'optparse' require 'optparse/shellwords' +require 'ostruct' STDOUT.sync = true File.umask(0) @@ -533,6 +534,26 @@ end # :stopdoc: +module Gem + if defined?(Specification) + remove_const(:Specification) + end + + class Specification < OpenStruct + def initialize(*) + super + yield(self) if defined?(yield) + self.executables ||= [] + end + + def self.load(path) + src = File.open(path, "rb") {|f| f.read} + src.sub!(/\A#.*/, '') + eval(src, nil, path) + end + end +end + module RbInstall module Specs class Reader < Struct.new(:name, :src, :execs) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/