title: Can I reference multiple versions of a Chef cookbook?
body: <p>Is it possible to reference multiple versions of a Chef cookbook within a recipe like the following where a recipe in one cookbook (foo) references multiple versions of a recipe in another cookbook (bar) where the version variable is populated before this block?</p>
  
  <pre><code>begin
      case version
      when ""
          include_recipe "cookbook-bar"
      when "1.0.0"
          include_recipe "cookbook-bar@1.0.0"
      when "1.0.1"
          include_recipe "cookbook-bar@1.0.1"
      else
          raise "Invalid Version: " + version
      end
  rescue Chef::Exceptions::CookbookNotFound
      raise "The Specified Cookbook Was Not Found: cookbook-foo-bar@" + version
  end
  </code></pre>
  
  <p>In the <code>metadata.rb</code> file I have set the dependency like the following to hopefully pull in versions <code>1.0.0</code>, <code>1.0.1</code>, and <code>1.0.2</code> of <code>cookbook-bar</code>. </p>
  
  <pre><code>depends          "cookbook-bar", "&lt;= 1.0.2"
  </code></pre>
  
  <p>But when I run it I still get the <code>CookbookNotFound</code> error for versions <code>1.0.0</code> and <code>1.0.1</code> of <code>cookbook-bar</code>.</p>