summaryrefslogtreecommitdiff
path: root/lib/chef/search
diff options
context:
space:
mode:
authorScott Hain <shain@getchef.com>2014-07-07 09:14:54 -0700
committerClaire McQuin <claire@getchef.com>2014-09-04 15:52:23 -0700
commit38e7ef5946ba911f8be407cb2d44f6d607ec131f (patch)
tree41d3fc0bd503ca0e767c0e3e24ee5bbdaf7560a7 /lib/chef/search
parentaef5d1807da189ca63c513d48112e5d86c7e7c30 (diff)
downloadchef-38e7ef5946ba911f8be407cb2d44f6d607ec131f.tar.gz
added a default for ruby 1.8 compatibility
Diffstat (limited to 'lib/chef/search')
-rw-r--r--lib/chef/search/query.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb
index 6501d24656..c055934709 100644
--- a/lib/chef/search/query.rb
+++ b/lib/chef/search/query.rb
@@ -87,7 +87,8 @@ class Chef
# new search api that allows for a cleaner implementation of things like return filters
# (formerly known as 'partial search').
- def do_search(type, query="*:*", args, &block)
+ # Also args should never be nil, but that is required for Ruby 1.8 compatibility
+ def do_search(type, query="*:*", args=nil, &block)
raise ArgumentError, "Type must be a string or a symbol!" unless (type.kind_of?(String) || type.kind_of?(Symbol))
query_string = create_query_string(type, query, args)