method
execute
v2_1_10 -
Show latest stable
-
0 notes -
Class: UnpackCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
execute()
public
Hide source
# File lib/rubygems/commands/unpack_command.rb, line 64 def execute get_all_gem_names.each do |name| dependency = Gem::Dependency.new name, options[:version] path = get_path dependency unless path then alert_error "Gem '#{name}' not installed nor fetchable." next end if @options[:spec] then spec, metadata = get_metadata path if metadata.nil? then alert_error "--spec is unsupported on '#{name}' (old format gem)" next end spec_file = File.basename spec.spec_file open spec_file, 'w' do |io| io.write metadata end else basename = File.basename path, '.gem' target_dir = File.expand_path basename, options[:target] package = Gem::Package.new path package.extract_files target_dir say "Unpacked gem: '#{target_dir}'" end end end