Class: Catfish::CLI
- Inherits:
-
Thor
show all
- Includes:
- Thor::Actions
- Defined in:
- lib/catfish/cli.rb,
lib/catfish/cli/init.rb
Defined Under Namespace
Classes: Clean, Init, Plugin, Provision, Resolve
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
8
9
10
11
12
13
14
|
# File 'lib/catfish/cli.rb', line 8
def initialize(*args)
super
rescue UnknownArgumentError => e
raise InvalidOption, e.message
ensure
self.options ||= {}
end
|
Class Method Details
.source_root ⇒ Object
16
17
18
|
# File 'lib/catfish/cli.rb', line 16
def self.source_root
File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end
|
Instance Method Details
#clean ⇒ Object
61
62
63
64
|
# File 'lib/catfish/cli.rb', line 61
def clean
require 'catfish/cli/clean'
Clean.new.run
end
|
#init ⇒ Object
43
44
45
46
|
# File 'lib/catfish/cli.rb', line 43
def init
require 'catfish/cli/init'
Init.new(options.dup, self).run
end
|
#plugin ⇒ Object
55
56
57
58
|
# File 'lib/catfish/cli.rb', line 55
def plugin
require 'catfish/cli/plugin'
Plugin.new(options.dup).run
end
|
#provision ⇒ Object
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/catfish/cli.rb', line 69
def provision
exists_before_resolve = File.exist?('Catfishfile.lock')
resolve
plugin
require 'catfish/cli/provision'
Provision.new(options.dup).run
clean unless exists_before_resolve
end
|
#resolve ⇒ Object
49
50
51
52
|
# File 'lib/catfish/cli.rb', line 49
def resolve
require 'catfish/cli/resolve'
Resolve.new(options.dup).run
end
|