class Gem::Commands::RebuildCommand

def build_gem(gem_name, source_date_epoch, output_file)

def build_gem(gem_name, source_date_epoch, output_file)
  gemspec = options[:gemspec_file] || find_gemspec("#{gem_name}.gemspec")
  if gemspec
    build_package(gemspec, source_date_epoch, output_file)
  else
    alert_error error_message(gem_name)
    terminate_interaction(1)
  end
end