Class: UsageMod::FileAppendQueryPlugin
- Inherits:
-
FilePlugin
- Object
- ArgumentParserPlugin
- FilePlugin
- UsageMod::FileAppendQueryPlugin
- Defined in:
- lib/Usage.rb
Instance Attribute Summary
Attributes inherited from ArgumentParserPlugin
Instance Method Summary collapse
-
#initialize(usage_ui, str) ⇒ FileAppendQueryPlugin
constructor
A new instance of FileAppendQueryPlugin.
Methods inherited from FilePlugin
Methods inherited from ArgumentParserPlugin
Constructor Details
#initialize(usage_ui, str) ⇒ FileAppendQueryPlugin
504 505 506 507 508 509 510 511 |
# File 'lib/Usage.rb', line 504 def initialize(usage_ui, str) $TRACE.debug 5, "trying to open file '#{str}' for append(query)" if !FileTest.exist?(str) then $TRACE.debug 5, "file doesn't exist" raise FileAppendDoesntExistError.new(str) if usage_ui.ask_yes_no(APPEND_NO_EXIST_QUERY % str, NO_RESPONSE) == NO_RESPONSE end @value = File.open(str, "a") end |