Class: Gem::Commands::CreateCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/create_command.rb

Overview

This class facilitates the ‘gem create` command.

Defined Under Namespace

Classes: Builder

Constant Summary collapse

IDENTIFIER =
'%gem_name%'.freeze

Instance Method Summary collapse

Constructor Details

#initializeCreateCommand

Initializes the plugin.



38
39
40
41
# File 'lib/rubygems/commands/create_command.rb', line 38

def initialize
  super "create", "Creates a new RubyGem skeleton"
  add_options!
end

Instance Method Details

#defaults_strObject



55
56
57
# File 'lib/rubygems/commands/create_command.rb', line 55

def defaults_str
  '--template-directory ~/.gem/skel --data-file ~/.gem/skel.yml'
end

#executeObject

Creates the gem.



44
45
46
47
48
# File 'lib/rubygems/commands/create_command.rb', line 44

def execute
  @gem_name = get_one_gem_name

  create_gem!
end

#usageObject

The usage banner displayed for ‘gem create –help`.



51
52
53
# File 'lib/rubygems/commands/create_command.rb', line 51

def usage
  "gem create GEM_NAME"
end