lib/potassium/templates/application/helpers/template-helpers.rb in potassium-1.3.4 vs lib/potassium/templates/application/helpers/template-helpers.rb in potassium-1.3.5
- old
+ new
@@ -1,11 +1,16 @@
module TemplateHelpers
def load_recipe(recipe)
return if exists?(recipe)
- eval_file "recipes/checks/#{recipe}.rb" rescue Exception
- eval_file "recipes/dependencies/#{recipe}.rb" rescue Exception
- eval_file "recipes/asks/#{recipe}.rb" rescue Exception
+ eval_file_with_rescue "recipes/checks/#{recipe}.rb"
+ eval_file_with_rescue "recipes/dependencies/#{recipe}.rb"
+ eval_file_with_rescue "recipes/asks/#{recipe}.rb"
eval_file "recipes/#{recipe}.rb"
+ end
+
+ def eval_file_with_rescue(source)
+ eval_file(source)
+ rescue StandardError
end
def eval_file(source)
location = File.expand_path(find_in_source_paths(source))
unique_name = SecureRandom.hex