Module: CLI

Defined in:
lib/cli.rb

Overview

utility functions to provide CLI

Instance Method Summary collapse

Instance Method Details

#value_for_cli(value) ⇒ Object

skip :reek:UtilityFunction



9
10
11
12
13
14
15
16
17
18
# File 'lib/cli.rb', line 9

def value_for_cli(value)
  case value.class.to_s
  when 'String'
    Shellwords.escape value
  when 'FalseClass', 'TrueClass'
    value ? '1' : '0'
  else
    Shellwords.escape value.to_s
  end
end