1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* tool/rbinstall.rb (default gems): Install executables into the fake

gem dir for Gem.bin_path.  [#4485]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-07-22 03:16:48 +00:00
parent 00a006511b
commit afd3a18fc3
2 changed files with 28 additions and 8 deletions

View file

@ -1,3 +1,8 @@
Fri Jul 22 12:10:21 2011 Eric Hodel <drbrain@segment7.net>
* tool/rbinstall.rb (default gems): Install executables into the fake
gem dir for Gem.bin_path. [#4485]
Fri Jul 22 11:20:20 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_digest.c: Check return value of EVP_DigestInit_ex.

View file

@ -534,32 +534,47 @@ end
install?(:ext, :comm, :gem) do
$:.unshift(File.join(srcdir, "lib"))
require("rubygems.rb")
gpath = Gem.default_dir
directories = Gem.ensure_gem_subdirectories(gpath)
prepare "default gems", gpath, directories
gem_dir = Gem.default_dir
directories = Gem.ensure_gem_subdirectories(gem_dir)
prepare "default gems", gem_dir, directories
destdir = File.join(gpath, directories.grep(/^spec/)[0])
spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
default_gems = [
['rake', 'lib/rake/version.rb'],
['rdoc', 'lib/rdoc.rb'],
['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'],
]
default_gems.each do |name, src|
default_gems.each do |name, src, execs|
execs ||= []
src = File.join(srcdir, src)
version = open(src) {|f| f.find {|s| /^\s*\w*VERSION\s*=(?!=)/ =~ s}} or next
version = version.split(%r"=\s*", 2)[1].strip[/\A([\'\"])(.*?)\1/, 2]
full_name = "#{name}-#{version}"
puts "#{" "*30}#{name} #{version}"
open_for_install(File.join(destdir, "#{name}-#{version}.gemspec"), $data_mode) do
open_for_install(File.join(spec_dir, "#{full_name}.gemspec"), $data_mode) do
<<-GEMSPEC
Gem::Specification.new do |s|
s.name = #{name.dump}
s.version = #{version.dump}
s.summary = "This #{name} is bundled with Ruby"
s.executables = #{execs.inspect}
end
GEMSPEC
end
unless execs.empty? then
bin_dir = File.join(gem_dir, 'gems', full_name, 'bin')
makedirs(bin_dir)
execs.each do |exec|
exec = File.join(srcdir, 'bin', exec)
install(exec, bin_dir, :mode => $prog_mode)
end
end
end
end