spice 0.8.0 → 1.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -6
- data/README.md +5 -63
- data/lib/spice.rb +56 -151
- data/lib/spice/client.rb +23 -36
- data/lib/spice/config.rb +52 -0
- data/lib/spice/connection.rb +89 -74
- data/lib/spice/connection/authentication.rb +47 -0
- data/lib/spice/connection/clients.rb +15 -0
- data/lib/spice/connection/cookbooks.rb +42 -0
- data/lib/spice/connection/data_bags.rb +35 -0
- data/lib/spice/connection/environments.rb +16 -0
- data/lib/spice/connection/nodes.rb +15 -0
- data/lib/spice/connection/roles.rb +15 -0
- data/lib/spice/connection/search.rb +49 -0
- data/lib/spice/cookbook.rb +13 -30
- data/lib/spice/cookbook_version.rb +43 -0
- data/lib/spice/data_bag.rb +17 -121
- data/lib/spice/data_bag_item.rb +35 -0
- data/lib/spice/environment.rb +15 -79
- data/lib/spice/error.rb +30 -0
- data/lib/spice/node.rb +19 -36
- data/lib/spice/persistence.rb +42 -0
- data/lib/spice/request.rb +27 -0
- data/lib/spice/request/auth.rb +14 -0
- data/lib/spice/response/client_error.rb +30 -0
- data/lib/spice/response/parse_json.rb +24 -0
- data/lib/spice/role.rb +18 -25
- data/lib/spice/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/spice.gemspec +4 -3
- metadata +65 -42
- data/lib/spice/core_ext/hash.rb +0 -21
- data/lib/spice/search.rb +0 -23
data/lib/spice/search.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module Spice
|
2
|
-
class Search < Spice::Chef
|
3
|
-
def self.search(index, options={})
|
4
|
-
options = {:q => options} if options.is_a? String
|
5
|
-
options.symbolize_keys!
|
6
|
-
|
7
|
-
options[:q] ||= '*:*'
|
8
|
-
options[:sort] ||= "X_CHEF_id_CHEF_X asc"
|
9
|
-
options[:start] ||= 0
|
10
|
-
options[:rows] ||= 1000
|
11
|
-
|
12
|
-
# clean up options hash
|
13
|
-
options.delete_if{|k,v| !%w(q sort start rows).include?(k.to_s)}
|
14
|
-
|
15
|
-
params = options.collect{ |k, v| "#{k}=#{CGI::escape(v.to_s)}"}.join("&")
|
16
|
-
connection.get("/search/#{CGI::escape(index.to_s)}?#{params}")
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.method_missing(*args, &block)
|
20
|
-
self.search(*args, &block)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|