1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/gem-unpack.rb
nagachika 5045461656 merge revision(s) 56399:
* tool/downloader.rb: Removed verification of gem certification.
	  Because signed gem is not working on rubygems ecosystem.

	* tool/gem-unpack.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-12 13:33:19 +00:00

15 lines
370 B
Ruby
Executable file

require 'rubygems'
require 'rubygems/package'
def Gem.unpack(file, dir = nil)
pkg = Gem::Package.new(file)
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