summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hain <shain@getchef.com>2014-07-07 09:14:54 -0700
committerScott Hain <shain@getchef.com>2014-07-07 09:14:54 -0700
commitaad2cd7b186a89829102e2803bf21dde59633577 (patch)
tree32ebbb40585ff5e32d2e52e61757fa81a3eeb8fb
parent9bee980f0d34a40dba803ce135d61173c763395a (diff)
downloadchef-aad2cd7b186a89829102e2803bf21dde59633577.tar.gz
added a default for ruby 1.8 compatibility
-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)