Class: Gem::Commands::ReleaseCommand

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

Constant Summary collapse

OPTIONS =
{ :tag => false }

Constants included from GemRelease

GemRelease::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReleaseCommand

Returns a new instance of ReleaseCommand.



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

def initialize
  super 'release', 'Build gem from a gemspec and push to rubygems.org'
  option :tag, '-t', 'Create a git tag and push --tags to origin'
  @arguments = "gemspec - optional gemspec file name, will use the first *.gemspec if not specified"
  @usage = "#{program_name} [gemspec]"
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



11
12
13
# File 'lib/rubygems/commands/release_command.rb', line 11

def arguments
  @arguments
end

#usageObject (readonly)

Returns the value of attribute usage.



11
12
13
# File 'lib/rubygems/commands/release_command.rb', line 11

def usage
  @usage
end

Instance Method Details

#executeObject



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

def execute
  build
  push
  remove
  tag if options[:tag]
  say "All is good, thanks buddy.\n"
end