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
- #file(filename) ⇒ Object
- #init ⇒ Object
-
#method_missing(method, *_args, &_block) ⇒ Object
This actions are equals: * asker demo/foo.haml * asker file demo/fool.haml.
-
#new_input(dirname) ⇒ Object
Create Asker demo input files.
- #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
72 73 74 |
# File 'lib/asker/cli.rb', line 72 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
82 83 84 |
# File 'lib/asker/cli.rb', line 82 def self.exit_on_failure? true end |
Instance Method Details
#check(filename) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/asker/cli.rb', line 39 def check(filename) # Enable/disable color output Rainbow.enabled = false if ['color'] == false # Asker start processing input file Asker.check(filename) end |
#file(filename) ⇒ Object
63 64 65 66 |
# File 'lib/asker/cli.rb', line 63 def file(filename) # Asker start processing input file Asker.start(filename) end |
#new_input(dirname) ⇒ Object
Create Asker demo input files
32 33 34 35 |
# File 'lib/asker/cli.rb', line 32 def new_input(dirname) Asker.new_input(dirname) exit 0 end |
#respond_to_missing?(_method_name) ⇒ Boolean
76 77 78 |
# File 'lib/asker/cli.rb', line 76 def respond_to_missing?(_method_name) true end |