Module: EacRubyBase0::RunnerWith::Input

Defined in:
lib/eac_ruby_base0/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



23
24
25
26
27
28
29
# File 'lib/eac_ruby_base0/runner_with/input.rb', line 23

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



31
32
33
# File 'lib/eac_ruby_base0/runner_with/input.rb', line 31

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