Class: Clir::State

Inherits:
Object
  • Object
show all
Defined in:
lib/clir/state_methods.rb

Class Method Summary collapse

Class Method Details

.debug?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/clir/state_methods.rb', line 31

def debug?
  :TRUE == @__debugon ||= true_or_false(CLI.options[:debug] === true)
end

.help?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/clir/state_methods.rb', line 39

def help?
  :TRUE == @__helpon ||= true_or_false(CLI.options[:help] === true || ['help','aide'].include?(CLI.main_command))
end

.resetObject



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

Returns:

  • (Boolean)


35
36
37
# File 'lib/clir/state_methods.rb', line 35

def test?
  :TRUE == @__teston ||= true_or_false((CLI.options[:test]||CLI.options[:tests]) === true || ENV['CLI_TEST'] == 'true' || ENV['CLI_TESTS'] == 'true' || File.exist?(CLI::MARKER_TESTS_FILE))
end

.verbose?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/clir/state_methods.rb', line 27

def verbose?
  :TRUE == @__isverbose ||= true_or_false(CLI.options[:verbose] === true)    
end

.version?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/clir/state_methods.rb', line 43

def version?
  :TRUE == @__versionon ||= true_or_false(CLI.options[:version] === true || ['version'].include?(CLI.main_command))
end