diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-09 05:55:28 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-09 05:55:28 +0000 |
| commit | bf45da2072ccda01be8c767b74d12b8ddbcf8b5b (patch) | |
| tree | 7f4f895349c1d5e612d65b817967eae7512ea28b | |
| parent | b47e0fd8eebe1e77d2d3c17f38f58b3e6c225e50 (diff) | |
| download | ruby-bf45da2072ccda01be8c767b74d12b8ddbcf8b5b.tar.gz ruby-bf45da2072ccda01be8c767b74d12b8ddbcf8b5b.tar.xz ruby-bf45da2072ccda01be8c767b74d12b8ddbcf8b5b.zip | |
* instruby.rb (default gems): installs default gemspecs.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rwxr-xr-x | instruby.rb | 11 |
2 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Mon Mar 9 14:55:27 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * instruby.rb (default gems): installs default gemspecs. + Mon Mar 9 14:48:08 2009 NAKAMURA Usaku <usa@ruby-lang.org> * win32/Makefile.sub (OPTFLAGS): simplified. see [ruby-core:22725] diff --git a/instruby.rb b/instruby.rb index 668759585..4d91859fa 100755 --- a/instruby.rb +++ b/instruby.rb @@ -484,6 +484,17 @@ install?(:ext, :comm, :gem) do end gpath = CONFIG["sitelibdir"].sub(%r'/site_ruby/(?=[^/]+)', '/gems/') prepare "default gems", gpath, directories + + destdir = File.join(gpath, directories.grep(/^spec/)[0]) + gems = %w[rake rdoc] + gems.each do |gem| + lib = File.join(srcdir, "lib/#{gem}.rb") + version = open(lib) {|f| f.find {|s| /^\s*\w*VERSION\s*=(?!=)/ =~ s}} or next + version = version.split(%r"=\s*", 2)[1].strip + open_for_install(File.join(destdir, "#{gem}.gemspec"), $data_mode) do |f| + "Gem::Specification.new {|s| s.name, s.version = #{gem.dump}, #{version}}\n" + end + end end $install << :local << :ext if $install.empty? |
