Class: Gem::Commands::ReleaseCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::ReleaseCommand
- Includes:
- CommandOptions, Gem::Commands, GemRelease, Helpers
- Defined in:
- lib/rubygems/commands/release_command.rb
Constant Summary collapse
- DEFAULTS =
{ :tag => false, :quiet => false, :key => '', :host => '', :destination => "origin", }
Constants included from GemRelease
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ ReleaseCommand
constructor
A new instance of ReleaseCommand.
Constructor Details
#initialize(options = {}) ⇒ ReleaseCommand
Returns a new instance of ReleaseCommand.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubygems/commands/release_command.rb', line 19 def initialize( = {}) @name = 'release' super @name, 'Build gem from a gemspec and push to rubygems.org', () option :tag, '-t', 'Create a git tag and push it to the destination' option :destination, '-d', 'Destination git repository' option :quiet, '-q', 'Do not output status messages' option :key, '-k', 'Use the given API key from ~/.gem/credentials' option :host, '-h', 'Push to a gemcutter-compatible host other than rubygems.org' @arguments = "gemspec - optional gemspec file name, will use the first *.gemspec if not specified" @usage = "#{program_name} [gemspec]" end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
17 18 19 |
# File 'lib/rubygems/commands/release_command.rb', line 17 def arguments @arguments end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/rubygems/commands/release_command.rb', line 17 def name @name end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
17 18 19 |
# File 'lib/rubygems/commands/release_command.rb', line 17 def usage @usage end |
Instance Method Details
#execute ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rubygems/commands/release_command.rb', line 33 def execute tasks = [:build, :push, :cleanup] tasks.push(:tag) if [:tag] in_gemspec_dirs do tasks.each do |task| run_cmd(task) end end success end |