Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Update deprecated syntax. #234

merged 1 commit into from

2 participants


Per the discussion in ChefSpec: sethvargo/chefspec#368


In addition to the search(:node, "*:*") pattern, should search(:admins, "*:*") be updated to search(:admins, "*:*").each?

(found a couple topics with that pattern -- for my reference if those also need to be updated: includes_search_data_bag, includes_search_index)

@jamescott Yes. Every time we have one of these patterns of code where it reads

search(:something, 'key:value') do |blah|

the examples should always be changed to explicitly declare the iterator with .each.


@jamescott jamescott merged commit a0035db into from
@juliandunn juliandunn deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 10, 2014
  1. @juliandunn

    Update deprecated syntax.

    juliandunn authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  includes_search/includes_search_node.rst
2  includes_search/includes_search_node.rst
@@ -36,6 +36,6 @@ Expanded lists of roles (all of the roles that apply to a node, including nested
If you just want to use each result of the search and don't care about the aggregate result you can provide a code block to the search method. Each result is then passed to the block::
# Print every node matching the search pattern
- search(:node, "*:*") do |matching_node|
+ search(:node, "*:*").each do |matching_node|
puts matching_node.to_s
Something went wrong with that request. Please try again.