diff --git a/lib/itamae/recipe.rb b/lib/itamae/recipe.rb index 68eafce0..5c0b34f1 100644 --- a/lib/itamae/recipe.rb +++ b/lib/itamae/recipe.rb @@ -121,7 +121,7 @@ def define(name, params = {}, &block) def include_recipe(target) expanded_path = ::File.expand_path(target, File.dirname(@recipe.path)) - expanded_path = ::File.join(expanded_path, 'default.rb') if ::Dir.exists?(expanded_path) + expanded_path = ::File.join(expanded_path, 'default.rb') if ::Dir.exist?(expanded_path) expanded_path.concat('.rb') unless expanded_path.end_with?('.rb') candidate_paths = [expanded_path, Recipe.find_recipe_in_gem(target)].compact path = candidate_paths.find {|path| File.exist?(path) }