mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* tool/rbinstall.rb (gem): install all gemspecs under lib and ext.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f555a533d0
commit
5f3a8912f7
3 changed files with 15 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
|||
Thu Aug 4 15:44:10 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Thu Aug 4 16:08:45 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* tool/rbinstall.rb (gem): install all gemspecs under lib and ext.
|
||||
|
||||
* tool/rbinstall.rb (Gem::Specification): may not be defined when
|
||||
cross-compiling and BASERUBY is 1.8.
|
||||
|
|
|
@ -3,6 +3,3 @@ rake lib/rake/version.rb [rake]
|
|||
rdoc lib/rdoc.rb [rdoc ri]
|
||||
minitest lib/minitest/unit.rb
|
||||
json ext/json/lib/json/version.rb
|
||||
io-console ext/io/console/io-console.gemspec
|
||||
bigdecimal ext/bigdecimal/bigdecimal.gemspec
|
||||
psych ext/psych/psych.gemspec
|
||||
|
|
|
@ -556,7 +556,7 @@ end
|
|||
|
||||
module RbInstall
|
||||
module Specs
|
||||
class Reader < Struct.new(:name, :src, :execs)
|
||||
class Reader < Struct.new(:src)
|
||||
def gemspec
|
||||
@gemspec ||= begin
|
||||
Gem::Specification.load(src) || raise("invalid spec in #{src}")
|
||||
|
@ -592,10 +592,6 @@ end
|
|||
version.split(%r"=\s*", 2)[1].strip[/\A([\'\"])(.*?)\1/, 2]
|
||||
end
|
||||
end
|
||||
|
||||
def self.generator_for(file)
|
||||
File.extname(file) == '.gemspec' ? Reader : Generator
|
||||
end
|
||||
end
|
||||
end
|
||||
# :startdoc:
|
||||
|
@ -608,6 +604,7 @@ install?(:ext, :comm, :gem) do
|
|||
prepare "default gems", gem_dir, directories
|
||||
|
||||
spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
|
||||
gems = {}
|
||||
File.foreach(File.join(srcdir, "defs/default_gems")) do |line|
|
||||
line.chomp!
|
||||
line.sub!(/\s*#.*/, '')
|
||||
|
@ -620,7 +617,16 @@ install?(:ext, :comm, :gem) do
|
|||
next unless name and src
|
||||
|
||||
src = File.join(srcdir, src)
|
||||
specgen = RbInstall::Specs.generator_for(src).new(name, src, execs || [])
|
||||
specgen = RbInstall::Specs::Generator.new(name, src, execs || [])
|
||||
gems[name] ||= specgen
|
||||
end
|
||||
|
||||
Dir.glob(srcdir+"/{lib,ext}/**/*.gemspec").each do |src|
|
||||
specgen = RbInstall::Specs::Reader.new(src)
|
||||
gems[specgen.gemspec.name] ||= specgen
|
||||
end
|
||||
|
||||
gems.sort.each do |name, specgen|
|
||||
gemspec = specgen.gemspec
|
||||
full_name = "#{gemspec.name}-#{gemspec.version}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue