Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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
  • Loading branch information...
commit 5f3a8912f770d0a629a744364217c8478cab96bd 1 parent f555a53
@nobu nobu authored
Showing with 15 additions and 10 deletions.
  1. +3 −1 ChangeLog
  2. +0 −3  defs/default_gems
  3. +12 −6 tool/rbinstall.rb
View
4 ChangeLog
@@ -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.
View
3  defs/default_gems
@@ -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
View
18 tool/rbinstall.rb
@@ -556,7 +556,7 @@ def self.load(path)
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 @@ def version
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 @@ def self.generator_for(file)
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 @@ def self.generator_for(file)
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}"
Please sign in to comment.
Something went wrong with that request. Please try again.