lib/itamae/recipe.rb in itamae-1.4.4 vs lib/itamae/recipe.rb in itamae-1.4.5
- old
+ new
@@ -104,11 +104,12 @@
def define(name, params = {}, &block)
Resource.define_resource(name, Definition.create_class(name, params, @recipe, &block))
end
def include_recipe(target)
+ expanded_path = ::File.expand_path(target, File.dirname(@recipe.path))
candidate_paths = [
- ::File.expand_path(target, File.dirname(@recipe.path)),
+ ::Dir.exists?(expanded_path) ? ::File.join(expanded_path, "default.rb") : expanded_path,
Recipe.find_recipe_in_gem(target),
].compact
path = candidate_paths.find {|path| File.exist?(path) }
unless path