lib/evertils/common/enml.rb in evertils-common-0.2.8.2 vs lib/evertils/common/enml.rb in evertils-common-0.2.9

- old
+ new

@@ -14,22 +14,20 @@ end private def enml_element - if @file - read_file = File.open(@file, 'rb') { |io| io.read } + read_file = File.open(@file, 'rb') { |io| io.read } - el = ::Evernote::EDAM::Type::Resource.new() - el.mime = MIME::Types.type_for(@file)[0].content_type - el.data = ::Evernote::EDAM::Type::Data.new() - el.data.size = read_file.size - el.data.bodyHash = Digest::MD5.hexdigest(read_file) - el.data.body = read_file - el.attributes = ::Evernote::EDAM::Type::ResourceAttributes.new() - el.attributes.fileName = @file # temporary for now, the actual file name - el - end + el = ::Evernote::EDAM::Type::Resource.new() + el.mime = MIME::Types.type_for(@file)[0].content_type + el.data = ::Evernote::EDAM::Type::Data.new() + el.data.size = read_file.size + el.data.bodyHash = Digest::MD5.hexdigest(read_file) + el.data.body = read_file + el.attributes = ::Evernote::EDAM::Type::ResourceAttributes.new() + el.attributes.fileName = @file # temporary for now, the actual file name + el end end end end \ No newline at end of file