レシピから同cookbook内の別レシピの呼ぶ
レシピから別のレシピを呼ぶ場合はinclude_recipeを使う
recipe/my_recipe.rb
include_recipe "other_cookbook::other_recipe"
同cookbook内の別レシピを呼ぶ場合も使えるが、foodcriticに引っかかる
FC007: Ensure recipe dependencies are reflected in cookbook metadata
http://www.foodcritic.io/#FC007
つまりinclude_recipeするcookbookはmetadataに依存性を書いとかなきゃいけない
ただmetadataに自身のcookbookをdependsするのもダメ
FC063: Cookbook incorrectly depends on itself
http://www.foodcritic.io/#FC063
これらのwarning回避するには、自身のcookbook名をハードコードするのではなく、変数を使う
recipe/my_recipe.rb
include_recipe "#{cookbook_name}::my_recipe"
参照
Author And Source
この問題について(レシピから同cookbook内の別レシピの呼ぶ), 我々は、より多くの情報をここで見つけました https://qiita.com/verno3632/items/a616354cb780cd8fa48e著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .