lib/dnote/format.rb in dnote-1.2.0 vs lib/dnote/format.rb in dnote-1.2.1
- old
+ new
@@ -14,11 +14,11 @@
require 'rexml/text'
require 'dnote/string'
#DEFAULT_OUTPUT_DIR = "log/dnote"
- EXTENSIONS = { 'soap'=>'xml', 'xoxo'=>'xml' }
+ EXTENSIONS = { 'text'=>'txt', 'soap'=>'xml', 'xoxo'=>'xml' }
#
attr :notes
#
@@ -101,10 +101,11 @@
end
#
def write(result, fname=nil)
if output.end_with?('/') || File.directory?(output)
- ext = EXTENSIONS[format] || format
+ fmt = format.split('/').first
+ ext = EXTENSIONS[fmt] || fmt
file = File.join(output, fname || "notes.#{ext}")
else
file = output
end
if dryrun?