summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 09:13:14 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 09:13:14 +0000
commit6f3e8df133c7785ff6bb6f18d1faec81fefb3999 (patch)
treeb5e30ab87eac86a1e57d6e169b860299d8b2da93 /tool
parent4fa35e0e9d16537b540b1daf10ee2c229b3168cf (diff)
* 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
Diffstat (limited to 'tool')
-rwxr-xr-xtool/rbinstall.rb71
1 files changed, 12 insertions, 59 deletions
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