Class: Gem::Commands::CreateCommand

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

Overview

The Gem::Commands::CreateCommand class facilitates the ‘gem create` command.

Constant Summary collapse

TEMPLATES =

Default path to templates provided by this plugin.

File.expand_path('../../create/templates', __FILE__)

Instance Method Summary collapse

Constructor Details

#initializeCreateCommand

Initializes the plugin.



12
13
14
15
# File 'lib/rubygems/commands/create_command.rb', line 12

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

Instance Method Details

#executeObject

Creates the gem.



18
19
20
21
# File 'lib/rubygems/commands/create_command.rb', line 18

def execute
  @gem_name = get_one_gem_name
  create_gem!
end

#usageObject

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



24
25
26
# File 'lib/rubygems/commands/create_command.rb', line 24

def usage
  "gem create GEM_NAME"
end