Class: Creategem::CLI

Inherits:
Thor
  • Object
show all
Includes:
Git, Thor::Actions
Defined in:
lib/creategem/cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Git

#create_local_git_repository, #create_remote_git_repository, #gem_server_url, #git_repository_user_name

Instance Attribute Details

#gem_nameObject

there has to be a method gem_name to use gem_name in the file names in the template directory: %gem_name%



12
13
14
# File 'lib/creategem/cli.rb', line 12

def gem_name
  @gem_name
end

Class Method Details

.source_rootObject

this is where the thor generator templates are found



15
16
17
# File 'lib/creategem/cli.rb', line 15

def self.source_root
  File.expand_path('../../../templates', __FILE__)
end

Instance Method Details

#gem(gem_name) ⇒ Object



23
24
25
26
# File 'lib/creategem/cli.rb', line 23

def gem(gem_name)
  create_gem_scaffold(gem_name)
  initialize_repository(gem_name)
end

#plugin(gem_name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/creategem/cli.rb', line 34

def plugin(gem_name)
  @plugin = true
  @engine = options[:engine] || options[:mountable]
  @mountable = options[:mountable]
  create_gem_scaffold(gem_name)
  create_plugin_scaffold(gem_name)
  create_engine_scaffold(gem_name) if @engine
  create_mountable_scaffold(gem_name) if @mountable
  initialize_repository(gem_name)
end