instance method
Gem::Commands::RebuildCommand#execute
execute
lib/rubygems/commands/rebuild_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/commands/rebuild_command.rb, line 72
def execute
gem_name, gem_version = get_gem_name_and_version
old_dir, new_dir = prep_dirs
gem_filename = "#{gem_name}-#{gem_version}.gem"
old_file = File.join(old_dir, gem_filename)
new_file = File.join(new_dir, gem_filename)
if options[:original_gem_file]
FileUtils.copy_file(options[:original_gem_file], old_file)
else
download_gem(gem_name, gem_version, old_file)
end
rg_version = rubygems_version(old_file)
unless rg_version == Gem::VERSION
alert_error <<-EOF
You need to use the same RubyGems version #{gem_name} v#{gem_version} was built with.
#{gem_name} v#{gem_version} was built using RubyGems v#{rg_version}.
Gem files include the version of RubyGems used to build them.
This means in order to reproduce #{gem_filename}, you must also use RubyGems v#{rg_version}.
You're using RubyGems v#{Gem::VERSION}.
Please install RubyGems v#{rg_version} and try again.
EOF
terminate_interaction 1
end
source_date_epoch = get_timestamp(old_file).to_s
if build_path = options[:build_path]
Dir.chdir(build_path) { build_gem(gem_name, source_date_epoch, new_file) }
else
build_gem(gem_name, source_date_epoch, new_file)
end
compare(source_date_epoch, old_file, new_file)
end
No documentation available