Class: Gunter::CLI
- Inherits:
-
Thor
- Object
- Thor
- Gunter::CLI
- Defined in:
- lib/gunter/cli.rb
Overview
Gunter CLI using Thor
Class Method Summary collapse
Instance Method Summary collapse
- #add(repo, name = nil) ⇒ Object
- #init(repo, location = nil) ⇒ Object
- #list ⇒ Object
- #search(term = '') ⇒ Object
- #version ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
9 10 11 |
# File 'lib/gunter/cli.rb', line 9 def self.exit_on_failure? true end |
Instance Method Details
#add(repo, name = nil) ⇒ Object
46 47 48 49 |
# File 'lib/gunter/cli.rb', line 46 def add(repo, name = nil) template = Gunter.model(:template).add(repo, name) Gunter.render(:text, :template_added, template) end |
#init(repo, location = nil) ⇒ Object
21 22 23 |
# File 'lib/gunter/cli.rb', line 21 def init(repo, location = nil) Gunter.model(:project).create(repo, location) end |
#list ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/gunter/cli.rb', line 27 def list templates = Gunter.model(:template).all return Gunter.render(:json, :templates, templates) if [:json] Gunter.render(:text, :templates, templates) end |