From 6f3e8df133c7785ff6bb6f18d1faec81fefb3999 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 23 Jun 2014 09:13:14 +0000 Subject: * tool/rbinstall.rb: support to install bundle gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/rbinstall.rb | 71 ++++++++++--------------------------------------------- 1 file changed, 12 insertions(+), 59 deletions(-) (limited to 'tool/rbinstall.rb') diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 9207c9f61b..c31902bc30 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -556,65 +556,6 @@ install?(:local, :comm, :man) do end 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#.*/, '') - spec = eval(src, nil, path) - spec.date ||= last_date(path) || RUBY_RELEASE_DATE - spec - end - - def self.last_date(path) - return unless $vcs - time = $vcs.get_revisions(path)[2] rescue return - return unless time - time.strftime("%Y-%m-%d") - end - - def to_ruby - <<-GEMSPEC -Gem::Specification.new do |s| - s.name = #{name.dump} - s.version = #{version.dump} - s.date = #{date.dump} - s.summary = #{summary.dump} - s.description = #{description.dump} - s.homepage = #{homepage.dump} - s.authors = #{authors.inspect} - s.email = #{email.inspect} - s.files = #{files.inspect} -end - GEMSPEC - end - - def add_dependency(*) - end - - def add_development_dependency(*) - end - - def add_runtime_dependency(*) - end - - def self.unresolved_deps - [] - end - end -end - module RbInstall module Specs class FileCollector @@ -774,6 +715,18 @@ install?(:ext, :comm, :gem) do end end +install?(:ext, :comm, :gem) do + require 'pathname' + gem_dir = Gem.default_dir + directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) + prepare "bundle gems", gem_dir, directories + Dir.glob(srcdir+'/gems/*.gem').each do |gem| + Gem.install gem + gemname = Pathname(gem).basename + puts "#{" "*30}#{gemname}" + end +end + parse_args() include FileUtils -- cgit v1.2.3