Class: Gem::Commands::BumpCommand

Inherits:
Gem::Command
  • Object
show all
Includes:
CommandOptions, Gem::Commands, GemRelease, Helpers
Defined in:
lib/rubygems/commands/bump_command.rb

Constant Summary collapse

OPTIONS =
{ :version => 'patch', :push => false, :tag => false, :release => false }

Constants included from GemRelease

GemRelease::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBumpCommand

Returns a new instance of BumpCommand.



12
13
14
15
16
17
18
19
# File 'lib/rubygems/commands/bump_command.rb', line 12

def initialize
  super 'bump', 'Bump the gem version', OPTIONS

  option :version, '-v', 'Target version: next [major|minor|patch] or a given version number [x.x.x]'
  option :push,    '-p', 'Push to origin'
  option :tag,     '-t', 'Create a git tag and push --tags to origin'
  option :release, '-r', 'Build gem from a gemspec and push to rubygems.org'
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



8
9
10
# File 'lib/rubygems/commands/bump_command.rb', line 8

def arguments
  @arguments
end

#usageObject (readonly)

Returns the value of attribute usage.



8
9
10
# File 'lib/rubygems/commands/bump_command.rb', line 8

def usage
  @usage
end

Instance Method Details

#executeObject



21
22
23
24
25
26
27
# File 'lib/rubygems/commands/bump_command.rb', line 21

def execute
  bump
  commit
  push    if options[:push] || options[:tag]
  release if options[:release]
  tag     if options[:tag]
end