Class: Gem::Commands::SpecifyCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/gm/rubygems_plugin.rb

Defined Under Namespace

Classes: Proxy

Instance Method Summary collapse

Constructor Details

#initializeSpecifyCommand

Returns a new instance of SpecifyCommand.



5
6
7
# File 'lib/gm/rubygems_plugin.rb', line 5

def initialize
  super 'specify', 'Generate a spec file'
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
# File 'lib/gm/rubygems_plugin.rb', line 9

def execute
  code = IO.read('Gmfile')
  eval(code, binding, 'Gmfile')
  complete_configuration
  if spec.validate
    File.open("#{spec.name}.gemspec", 'w+') { |f| f.write spec.to_ruby }
  end
end