Class: Gem::Commands::GemspecCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::GemspecCommand
- Includes:
- CommandOptions, GemRelease, Helpers
- Defined in:
- lib/rubygems/commands/gemspec_command.rb
Constant Summary collapse
- DEFAULTS =
{ :strategy => 'git', :quiet => false }
Constants included from GemRelease
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ GemspecCommand
constructor
A new instance of GemspecCommand.
Constructor Details
#initialize(options = {}) ⇒ GemspecCommand
Returns a new instance of GemspecCommand.
12 13 14 15 16 17 |
# File 'lib/rubygems/commands/gemspec_command.rb', line 12 def initialize( = {}) super 'bootstrap', 'Bootstrap a new gem source repository', DEFAULTS.merge() option :strategy, '-f', 'Strategy for collecting files [glob|git] in .gemspec' option :quiet, '-q', 'Do not output status messages' end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
10 11 12 |
# File 'lib/rubygems/commands/gemspec_command.rb', line 10 def arguments @arguments end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
10 11 12 |
# File 'lib/rubygems/commands/gemspec_command.rb', line 10 def usage @usage end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/rubygems/commands/gemspec_command.rb', line 19 def execute gemspec = GemspecTemplate.new() if gemspec.exists? say "Skipping #{gemspec.filename}: already exists" unless quiet? else say "Creating #{gemspec.filename}" unless quiet? gemspec.write end end |