summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--defs/default_gems7
-rwxr-xr-xtool/rbinstall.rb20
3 files changed, 21 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f8d8df..cc7465a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Jul 30 23:19:09 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * defs/default_gems: separate from tool/rbinstall.rb.
+
Sat Jul 30 23:14:44 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_each_byte): rbuf can be refreshed during yield.
diff --git a/defs/default_gems b/defs/default_gems
new file mode 100644
index 0000000..030d84f
--- /dev/null
+++ b/defs/default_gems
@@ -0,0 +1,7 @@
+# gem versioning file [executable files under bin]
+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
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index f58d790..4c5904b 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -540,16 +540,16 @@ install?(:ext, :comm, :gem) do
prepare "default gems", gem_dir, directories
spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
- default_gems = [
- ['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'],
- ]
-
- default_gems.each do |name, src, execs|
+ File.foreach(File.join(srcdir, "defs/default_gems")) do |line|
+ line.chomp!
+ line.sub!(/\s*#.*/, '')
+ next if line.empty?
+ words = []
+ line.scan(/\G\s*([^\[\]\s]+|\[([^\[\]]*)\])/) do
+ words << ($2 ? $2.split : $1)
+ end
+ name, src, execs = *words
+ next unless name and src
execs ||= []
src = File.join(srcdir, src)
version = open(src) {|f| f.find {|s| /^\s*\w*VERSION\s*=(?!=)/ =~ s}} or next