lib/vfs/entries/file.rb in vfs-0.3.10 vs lib/vfs/entries/file.rb in vfs-0.3.11
- old
+ new
@@ -67,11 +67,11 @@
if block
fs.write_file(path, options[:append], &block)
else
fs.write_file(path, options[:append]){|writer| writer.call data}
end
- rescue StandardError => error
+ rescue StandardError => error
entry = self.entry
if entry.exist?
if options[:override]
entry.destroy
else
@@ -84,11 +84,11 @@
raise error
else
parent.create(options)
end
end
-
+
retry if try < 2
end
end
self
end
@@ -157,11 +157,11 @@
to.file #(name)
elsif to.is_a? UniversalEntry
to.file
else
raise "can't copy to unknown Entry!"
- end
+ end
target.write options do |writer|
read(options){|buff| writer.call buff}
end
@@ -189,10 +189,10 @@
def render *args
require 'tilt'
args.unshift Object.new if args.size == 1 and args.first.is_a?(Hash)
- template = Tilt.new path
+ template = Tilt.new(path){read}
template.render *args
end
def size
get :size
\ No newline at end of file