Module: EacCli::RunnerWith::Input

Defined in:
lib/eac_cli/runner_with/input.rb

Constant Summary collapse

STDIN_OPTION =
'-'
BLANK_OPTION =
'+'
DEFAULT_DEFAULT_INPUT_OPTION =
BLANK_OPTION

Instance Method Summary collapse

Instance Method Details

#input_contentObject



19
20
21
22
23
24
25
# File 'lib/eac_cli/runner_with/input.rb', line 19

def input_content
  case input_option
  when STDIN_OPTION then $stdin.read
  when BLANK_OPTION then ''
  else input_option.to_pathname.read
  end
end

#input_optionObject



27
28
29
# File 'lib/eac_cli/runner_with/input.rb', line 27

def input_option
  parsed.input || setting_value(:default_input_option, default: DEFAULT_DEFAULT_INPUT_OPTION)
end