Class: Guides::CLI
- Inherits:
-
Thor
- Object
- Thor
- Guides::CLI
- Defined in:
- lib/guides/cli.rb
Constant Summary collapse
- ASSETS_ROOT =
File.("../assets", __FILE__)
- SOURCE_ROOT =
File.("../source", __FILE__)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.basename ⇒ Object
11 12 13 |
# File 'lib/guides/cli.rb', line 11 def self.basename "guides" end |
Instance Method Details
#build ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/guides/cli.rb', line 26 def build if [:clean] FileUtils.rm_rf(File.join(Guides.root, [:production] ? 'output' : 'staging')) end require "guides/generator" opts = .dup opts[:only] ||= [] generator = Guides::Generator.new(opts) generator.generate end |
#new(name) ⇒ Object
17 18 19 |
# File 'lib/guides/cli.rb', line 17 def new(name) invoke "guides:new:copy", [name, [:name] || name] end |