Class: Gem::Commands::GemspecCommand

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

Constant Summary collapse

OPTIONS =
{ :strategy => 'git' }

Constants included from GemRelease

GemRelease::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGemspecCommand

Returns a new instance of GemspecCommand.



9
10
11
12
13
# File 'lib/rubygems/commands/gemspec_command.rb', line 9

def initialize
  super 'bootstrap', 'Bootstrap a new gem source repository', OPTIONS

  option :strategy, '-f', 'Strategy for collecting files [glob|git] in .gemspec'
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



7
8
9
# File 'lib/rubygems/commands/gemspec_command.rb', line 7

def arguments
  @arguments
end

#usageObject (readonly)

Returns the value of attribute usage.



7
8
9
# File 'lib/rubygems/commands/gemspec_command.rb', line 7

def usage
  @usage
end

Instance Method Details

#executeObject



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

def execute
  gemspec = Gemspec.new(options)
  if gemspec.exists?
    say "Skipping #{gemspec.filename}: already exists"
  else
    say "Creating #{gemspec.filename}"
    gemspec.write
  end
end