lib/rubysketch/processing.rb in rubysketch-0.2.2 vs lib/rubysketch/processing.rb in rubysketch-0.2.3
- old
+ new
@@ -1054,14 +1054,17 @@
tmpdir = Pathname(Dir.tmpdir) + Digest::SHA1.hexdigest(self.class.name)
path = tmpdir + Digest::SHA1.hexdigest(uri)
path = path.sub_ext ext
- URI.open uri do |input|
- tmpdir.mkdir unless tmpdir.directory?
- path.open('w') do |output|
- while buf = input.read(2 ** 16)
- output.write buf
+ unless path.file?
+ p "getting #{uri}"
+ URI.open uri do |input|
+ tmpdir.mkdir unless tmpdir.directory?
+ path.open('w') do |output|
+ while buf = input.read(2 ** 16)
+ output.write buf
+ end
end
end
end
path.to_s
end