aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xtool/rbinstall.rb21
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3002fad9ce..0d9dfbe82e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 4 15:44:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* include/ruby/missing.h: define __syscall on OpenBSD as r32702.
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 3b5d6044bc..64619fb8a6 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -17,6 +17,7 @@ require 'fileutils'
require 'shellwords'
require 'optparse'
require 'optparse/shellwords'
+require 'ostruct'
STDOUT.sync = true
File.umask(0)
@@ -533,6 +534,26 @@ install?(:local, :comm, :man) do
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)