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
91 92 93 |
# File 'lib/asker/cli.rb', line 91 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
101 102 103 |
# File 'lib/asker/cli.rb', line 101 def self.exit_on_failure? true end |
Instance Method Details
#check(filename) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/asker/cli.rb', line 59 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
83 84 85 |
# File 'lib/asker/cli.rb', line 83 def file(filename) Asker.start(filename) end |
#respond_to_missing?(_method_name) ⇒ Boolean
95 96 97 |
# File 'lib/asker/cli.rb', line 95 def respond_to_missing?(_method_name) true end |