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

DEFAULTS =
{
  :tag   => false,
  :quiet => false
}

Constants included from GemRelease

GemRelease::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ReleaseCommand

Returns a new instance of ReleaseCommand.



16
17
18
19
20
21
22
23
24
# File 'lib/rubygems/commands/release_command.rb', line 16

def initialize(options = {})
  super 'release', 'Build gem from a gemspec and push to rubygems.org', DEFAULTS.merge(options)

  option :tag,   '-t', 'Create a git tag and push --tags to origin'
  option :quiet, '-q', 'Do not output status messages'

  @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.



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

def arguments
  @arguments
end

#usageObject (readonly)

Returns the value of attribute usage.



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

def usage
  @usage
end

Instance Method Details

#executeObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/rubygems/commands/release_command.rb', line 26

def execute
  in_gemspec_dirs do
    build
    push
    remove
  end

  tag if options[:tag]
  say "All is good, thanks my friend.\n"
end