Sha256: fba63f16d11f1b9cd53b9a31af7c93d66984b30f310bd4d6067e2a579faa3117

Contents?: true

Size: 859 Bytes

Versions: 23

Compression:

Stored size: 859 Bytes

Contents

require 'rubygems/command'
require 'rubygems/package'

class Gem::Commands::BuildCommand < Gem::Command

  def initialize
    super 'build', 'Build a gem from a gemspec'

    add_option '--force', 'skip validation of the spec' do |value, options|
      options[:force] = true
    end
  end

  def arguments # :nodoc:
    "GEMSPEC_FILE  gemspec file name to build a gem for"
  end

  def usage # :nodoc:
    "#{program_name} GEMSPEC_FILE"
  end

  def execute
    gemspec = get_one_gem_name

    if File.exist? gemspec then
      spec = Gem::Specification.load gemspec

      if spec then
        Gem::Package.build spec, options[:force]
      else
        alert_error "Error loading gemspec. Aborting."
        terminate_interaction 1
      end
    else
      alert_error "Gemspec file not found: #{gemspec}"
      terminate_interaction 1
    end
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rubygems-update-2.0.17 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.16 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.15 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.14 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.13 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.12 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.11 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.10 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.9 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.8 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.7 lib/rubygems/commands/build_command.rb
rubygems-update-2.1.0.rc.1 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.6 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.5 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.4 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.3 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.2 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.0 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.0.rc.2 lib/rubygems/commands/build_command.rb
rubygems-update-2.0.0.rc.1 lib/rubygems/commands/build_command.rb