kuzushi 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/kuzushi.rb +4 -9
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.33
|
data/lib/kuzushi.rb
CHANGED
@@ -300,18 +300,13 @@ class Kuzushi
|
|
300
300
|
fetch("/files/#{f.source || File.basename(f.file)}", &blk) unless f.template
|
301
301
|
end
|
302
302
|
|
303
|
+
### this needs to be brought up to date - way last version - no need to read and filter...
|
303
304
|
def fetch(file, filter = lambda { |d| d }, &block)
|
304
|
-
names = config_names.clone
|
305
305
|
begin
|
306
|
-
## its important that we try each name for the script - allows for polymorphic scripts
|
307
306
|
block.call("/tmp/kuzushi/#{@name}/#{file}")
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
rescue RestClient::ResourceNotFound
|
312
|
-
names.shift
|
313
|
-
retry unless names.empty?
|
314
|
-
error("file not found: #{file}")
|
307
|
+
tmpfile(filter.call(File.read("/tmp/kuzushi/#{name}/#{file}")), file) do |tmp|
|
308
|
+
block.call(tmp)
|
309
|
+
end
|
315
310
|
rescue Object => e
|
316
311
|
error("error fetching file: #{names.first}/#{file} : #{e.message}")
|
317
312
|
end
|