Class: AwesomeAnnotate::CLI
- Inherits:
-
Thor
- Object
- Thor
- AwesomeAnnotate::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/awesome_annotate/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
- #all ⇒ Object
- #init ⇒ Object
- #model(model_name) ⇒ Object
- #models(*model_names) ⇒ Object
- #print_version ⇒ Object
- #routes ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
94 95 96 |
# File 'lib/awesome_annotate/cli.rb', line 94 def self.exit_on_failure? true end |
Instance Method Details
#all ⇒ Object
75 76 77 78 |
# File 'lib/awesome_annotate/cli.rb', line 75 def all model_annotator.annotate_all route_annotator.annotate end |
#init ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/awesome_annotate/cli.rb', line 81 def init path = AwesomeAnnotate::Configuration::DEFAULT_PATH if File.exist?(path) say "Config file already exists: #{path}" else AwesomeAnnotate::Configuration.create(path) say "create #{path}" end end |
#model(model_name) ⇒ Object
59 60 61 |
# File 'lib/awesome_annotate/cli.rb', line 59 def model(model_name) model_annotator.annotate(model_name) end |
#models(*model_names) ⇒ Object
64 65 66 |
# File 'lib/awesome_annotate/cli.rb', line 64 def models(*model_names) model_annotator.annotate_all(model_names) end |
#print_version ⇒ Object
53 54 55 |
# File 'lib/awesome_annotate/cli.rb', line 53 def print_version say AwesomeAnnotate::VERSION end |
#routes ⇒ Object
70 71 72 |
# File 'lib/awesome_annotate/cli.rb', line 70 def routes route_annotator.annotate end |