From 983cbb1aed57665e3a616f40b759f35bf143e091 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 16 Jan 2015 04:52:59 +0000 Subject: common.mk: extract-gems * common.mk (extract-gems): extract gem files to install them even if zlib is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/gem-unpack.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tool/gem-unpack.rb (limited to 'tool/gem-unpack.rb') diff --git a/tool/gem-unpack.rb b/tool/gem-unpack.rb new file mode 100755 index 0000000000..5f15751d9c --- /dev/null +++ b/tool/gem-unpack.rb @@ -0,0 +1,16 @@ +require 'rubygems' +require 'rubygems/package' + +def Gem.unpack(file, dir = nil) + pkg = Gem::Package.new(file) + pkg.security_policy = Gem::Security::LowSecurity + spec = pkg.spec + target = spec.full_name + target = File.join(dir, target) if dir + pkg.extract_files target + spec_file = File.join(target, "#{spec.name}.gemspec") + open(spec_file, 'wb') do |f| + f.print spec.to_ruby + end + puts "Unpacked #{file}" +end -- cgit v1.2.3