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
69 70 71 |
# File 'lib/asker/cli.rb', line 69 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
79 80 81 |
# File 'lib/asker/cli.rb', line 79 def self.exit_on_failure? true end |
Instance Method Details
#check(filename) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/asker/cli.rb', line 43 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
36 37 38 39 |
# File 'lib/asker/cli.rb', line 36 def file(filename) # Asker start processing input file Asker.start(filename) end |
#new_input(dirname) ⇒ Object
Create Asker demo input files
61 62 63 |
# File 'lib/asker/cli.rb', line 61 def new_input(dirname) Asker.new_input(dirname) end |
#respond_to_missing?(_method_name) ⇒ Boolean
73 74 75 |
# File 'lib/asker/cli.rb', line 73 def respond_to_missing?(_method_name) true end |
#version ⇒ Object
15 16 17 |
# File 'lib/asker/cli.rb', line 15 def version puts "#{Application::NAME} version #{Application::VERSION}" end |