diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-04 06:44:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-04 06:44:13 +0000 |
commit | f555a533d05b48ff3f6062ffa4a559613d12408d (patch) | |
tree | 4ea2f84952912a1bf37a4adbedd9c89cd89fe0e0 /tool | |
parent | 11667b9c9ac0b3fb835508cfdb3ecc863e3b6935 (diff) | |
download | ruby-f555a533d05b48ff3f6062ffa4a559613d12408d.tar.gz |
* tool/rbinstall.rb (Gem::Specification): may not be defined when
cross-compiling and BASERUBY is 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/rbinstall.rb | 21 |
1 files changed, 21 insertions, 0 deletions
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) |