Class: CLI
- Inherits:
-
Thor
- Object
- Thor
- CLI
- Defined in:
- lib/asker/cli.rb
Overview
Command Line User Interface
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Thor stop and show messages on screen on failure.
Instance Method Summary collapse
- #check(filename) ⇒ Object
- #create_input(dirname) ⇒ Object
- #file(filename) ⇒ Object
- #init ⇒ Object
-
#method_missing(method, *_args, &_block) ⇒ Object
This actions are equals: * asker demo/foo.haml * asker file demo/fool.haml.
- #respond_to_missing?(_method_name) ⇒ Boolean
- #version ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *_args, &_block) ⇒ Object
This actions are equals:
-
asker demo/foo.haml
-
asker file demo/fool.haml
93 94 95 |
# File 'lib/asker/cli.rb', line 93 def method_missing(method, *_args, &_block) file(method.to_s) end |
Class Method Details
.exit_on_failure? ⇒ Boolean
Thor stop and show messages on screen on failure
103 104 105 |
# File 'lib/asker/cli.rb', line 103 def self.exit_on_failure? true end |
Instance Method Details
#check(filename) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/asker/cli.rb', line 60 def check(filename) # Enable/disable color output Rainbow.enabled = false if ["color"] == false # Asker start processing input file Asker.check(filename) end |
#create_input(dirname) ⇒ Object
42 43 44 45 |
# File 'lib/asker/cli.rb', line 42 def create_input(dirname) Asker.create_input(dirname) exit 0 end |
#file(filename) ⇒ Object
85 86 87 |
# File 'lib/asker/cli.rb', line 85 def file(filename) Asker.start(filename) end |
#respond_to_missing?(_method_name) ⇒ Boolean
97 98 99 |
# File 'lib/asker/cli.rb', line 97 def respond_to_missing?(_method_name) true end |