Skip to content

Commit

Permalink
Add --force to gem build to skip validation. Fixes RubyGems #297
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx authored and ferrous26 committed Mar 22, 2012
1 parent 5d64e44 commit 0f99698
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rubygems/builder.rb
Expand Up @@ -32,9 +32,9 @@ def initialize(spec)
# Builds the gem from the specification. Returns the name of the file
# written.

def build
def build(skip_validation=false)
@spec.mark_version
@spec.validate
@spec.validate unless skip_validation
@signer = sign
write_package
say success if Gem.configuration.verbose
Expand Down
8 changes: 6 additions & 2 deletions lib/rubygems/commands/build_command.rb
Expand Up @@ -4,7 +4,11 @@
class Gem::Commands::BuildCommand < Gem::Command

def initialize
super('build', 'Build a gem from a gemspec')
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:
Expand All @@ -22,7 +26,7 @@ def execute
spec = load_gemspec gemspec

if spec then
Gem::Builder.new(spec).build
Gem::Builder.new(spec).build options[:force]
else
alert_error "Error loading gemspec. Aborting."
terminate_interaction 1
Expand Down

0 comments on commit 0f99698

Please sign in to comment.