Class: UsageMod::FileReadLinesPlugin

Inherits:
ArgumentParserPlugin show all
Defined in:
lib/Usage.rb

Instance Attribute Summary

Attributes inherited from ArgumentParserPlugin

#value

Instance Method Summary collapse

Methods inherited from ArgumentParserPlugin

#close

Constructor Details

#initialize(usage_ui, str) ⇒ FileReadLinesPlugin

Returns a new instance of FileReadLinesPlugin.



515
516
517
518
519
520
521
522
# File 'lib/Usage.rb', line 515

def initialize(usage_ui, str)
  $TRACE.debug 5, "trying to open file '#{str}' for read lines"
  if FileTest.exist?(str) then
    @value = File.readlines(str)
  else
    raise InvalidInputFilenameError.new(str)
  end
end