lib/kuzushi.rb in kuzushi-0.0.32 vs lib/kuzushi.rb in kuzushi-0.0.33

- old
+ new

@@ -298,21 +298,16 @@ ## no magic here - move along fetch("/templates/#{f.template}", lambda { |data| erb data }, &blk) if f.template fetch("/files/#{f.source || File.basename(f.file)}", &blk) unless f.template end + ### this needs to be brought up to date - way last version - no need to read and filter... def fetch(file, filter = lambda { |d| d }, &block) - names = config_names.clone begin - ## its important that we try each name for the script - allows for polymorphic scripts block.call("/tmp/kuzushi/#{@name}/#{file}") -# tmpfile(filter.call(http_get("#{@base_url}/#{names.first}#{file}")), file) do |tmp| -# block.call(tmp) -# end - rescue RestClient::ResourceNotFound - names.shift - retry unless names.empty? - error("file not found: #{file}") + tmpfile(filter.call(File.read("/tmp/kuzushi/#{name}/#{file}")), file) do |tmp| + block.call(tmp) + end rescue Object => e error("error fetching file: #{names.first}/#{file} : #{e.message}") end end