Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update deprecated syntax. #234

Merged
merged 1 commit into from

2 participants

@juliandunn
Owner

Per the discussion in ChefSpec: sethvargo/chefspec#368

@jamescott
Collaborator

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.

Thanks!

@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
View
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
end
Something went wrong with that request. Please try again.