Class: Clir::State
- Inherits:
-
Object
- Object
- Clir::State
- Defined in:
- lib/clir/state_methods.rb
Class Method Summary collapse
- .debug? ⇒ Boolean
- .help? ⇒ Boolean
- .reset ⇒ Object
- .test? ⇒ Boolean
- .verbose? ⇒ Boolean
- .version? ⇒ Boolean
Class Method Details
.debug? ⇒ Boolean
31 32 33 |
# File 'lib/clir/state_methods.rb', line 31 def debug? :TRUE == @__debugon ||= true_or_false(CLI.[:debug] === true) end |
.help? ⇒ Boolean
39 40 41 |
# File 'lib/clir/state_methods.rb', line 39 def help? :TRUE == @__helpon ||= true_or_false(CLI.[:help] === true || ['help','aide'].include?(CLI.main_command)) end |
.reset ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/clir/state_methods.rb', line 47 def reset @__isverbose = nil @__debugon = nil @__teston = nil @__helpon = nil @__versionon = nil end |
.test? ⇒ Boolean
35 36 37 |
# File 'lib/clir/state_methods.rb', line 35 def test? :TRUE == @__teston ||= true_or_false((CLI.[:test]||CLI.[:tests]) === true || ENV['CLI_TEST'] == 'true' || ENV['CLI_TESTS'] == 'true' || File.exist?(CLI::MARKER_TESTS_FILE)) end |
.verbose? ⇒ Boolean
27 28 29 |
# File 'lib/clir/state_methods.rb', line 27 def verbose? :TRUE == @__isverbose ||= true_or_false(CLI.[:verbose] === true) end |
.version? ⇒ Boolean
43 44 45 |
# File 'lib/clir/state_methods.rb', line 43 def version? :TRUE == @__versionon ||= true_or_false(CLI.[:version] === true || ['version'].include?(CLI.main_command)) end |