Install task of bundle gems. #626

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+21 −59
Split
View
@@ -0,0 +1,2 @@
+test-unit 2.5.5
+minitest 5.3.4
View
@@ -236,6 +236,13 @@ def package(rev, destdir)
end
puts " done"
end
+ bundle_gems = File.read('gems/bundle_gems').split("\n").map{|c| c.split }
+ bundle_gems.each do |gem, ver|
+ gem_name = "#{gem}-#{ver}.gem"
+ unless File.exist?("gems/#{gem_name}")
+ system("curl http://rubygems.org/downloads/#{gem_name} -O gems/#{gem_name}")
+ end
+ end
clean.add("autom4te.cache")
print "creating prerequisites..."
if File.file?("common.mk") && /^prereq/ =~ commonmk = IO.read("common.mk")
View
@@ -556,65 +556,6 @@ class << (w = [])
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 @@ def files
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}"

This comment has been minimized.

Show comment Hide comment
@zzak

zzak Jun 2, 2014

Member

Why 30 spaces?

@zzak

zzak Jun 2, 2014

Member

Why 30 spaces?

This comment has been minimized.

Show comment Hide comment
@nobu

nobu Jun 2, 2014

Member

"installing %-18s" will use same 30 columns in prepare.

@nobu

nobu Jun 2, 2014

Member

"installing %-18s" will use same 30 columns in prepare.

+ end
+end
+
parse_args()
include FileUtils