class Gem::Commands::RebuildCommand

def build_package(gemspec, source_date_epoch, output_file)

def build_package(gemspec, source_date_epoch, output_file)
  with_source_date_epoch(source_date_epoch) do
    spec = Gem::Specification.load(gemspec)
    if spec
      Gem::Package.build(
        spec,
        options[:force],
        options[:strict],
        output_file
      )
    else
      alert_error "Error loading gemspec. Aborting."
      terminate_interaction 1
    end
  end
end