spice 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +0 -0
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/Gemfile +6 -4
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +18 -18
- data/TODO.md +0 -0
- data/lib/spice.rb +40 -32
- data/lib/spice/authentication.rb +0 -0
- data/lib/spice/chef.rb +0 -0
- data/lib/spice/client.rb +0 -0
- data/lib/spice/connection.rb +22 -18
- data/lib/spice/cookbook.rb +0 -0
- data/lib/spice/core_ext/hash.rb +18 -8
- data/lib/spice/data_bag.rb +0 -0
- data/lib/spice/mock.rb +2 -2
- data/lib/spice/node.rb +0 -0
- data/lib/spice/role.rb +0 -0
- data/lib/spice/version.rb +1 -1
- data/spec/spec_helper.rb +8 -2
- data/spec/spice/authentication_spec.rb +0 -0
- data/spec/spice/chef_spec.rb +0 -0
- data/spec/spice/client_spec.rb +0 -0
- data/spec/spice/connection_spec.rb +0 -0
- data/spec/spice/cookbook_spec.rb +0 -0
- data/spec/spice/data_bag_spec.rb +0 -0
- data/spec/spice/node_spec.rb +0 -0
- data/spec/spice/role_spec.rb +0 -0
- data/spec/spice_spec.rb +30 -90
- data/spec/support/client_requests.rb +0 -0
- data/spice.gemspec +13 -8
- metadata +96 -37
- data/spec/support/requests.rb +0 -97
data/.document
CHANGED
File without changes
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/Gemfile
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem 'mixlib-authentication'
|
5
|
-
gem 'yajl-ruby'
|
3
|
+
gemspec
|
6
4
|
|
7
5
|
group :development, :test do
|
8
|
-
gem "yard", "~> 0.6.4"
|
9
6
|
gem 'rspec', '>= 2.6.0'
|
10
7
|
gem "webmock", ">= 1.6.2"
|
11
8
|
gem "timecop", ">= 0.3.5"
|
9
|
+
gem 'fakefs', '>= 0.3.2'
|
12
10
|
gem 'guard', '>= 0.6.2'
|
13
11
|
gem 'guard-rspec', '>= 0.4.2'
|
14
12
|
gem 'guard-spork', '>= 0.2.1'
|
15
13
|
gem 'spork', '>= 0.9.0.rc8'
|
16
14
|
gem 'rb-fsevent', '>= 0.4.3.1'
|
17
15
|
gem 'growl', '>= 1.0.3'
|
16
|
+
end
|
17
|
+
|
18
|
+
group :doc do
|
19
|
+
gem 'yard'
|
18
20
|
end
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler::GemHelper.install_tasks
|
1
|
+
require 'bundler/gem_tasks'
|
3
2
|
|
4
|
-
require 'rspec/core'
|
5
3
|
require 'rspec/core/rake_task'
|
6
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
7
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
8
|
-
end
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
task :default => :spec
|
6
|
+
desc "Run specs"
|
7
|
+
RSpec::Core::RakeTask.new do |task|
|
8
|
+
task.pattern = "spec/**/*_spec.rb"
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Run guard"
|
12
|
+
task :guard do
|
13
|
+
sh %{bundle exec guard start}
|
13
14
|
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
desc "Run spork"
|
17
|
+
task :spork do
|
18
|
+
sh %{bundle exec spork}
|
19
|
+
end
|
19
20
|
|
20
|
-
require 'yard'
|
21
|
-
YARD::Rake::YardocTask.new
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
Bundler.require(:doc)
|
23
|
+
desc "Generate documentation"
|
24
|
+
YARD::Rake::YardocTask.new do |t|
|
25
|
+
t.files = [ 'lib/**/*.rb' ]
|
26
26
|
end
|
data/TODO.md
CHANGED
File without changes
|
data/lib/spice.rb
CHANGED
@@ -23,34 +23,19 @@ require 'spice/mock'
|
|
23
23
|
module Spice
|
24
24
|
|
25
25
|
class << self
|
26
|
-
attr_writer :
|
26
|
+
attr_writer :server_url, :client_name, :connection,
|
27
|
+
:key_file, :raw_key, :chef_version
|
27
28
|
|
28
|
-
def
|
29
|
-
@
|
30
|
-
end
|
31
|
-
|
32
|
-
def default_port
|
33
|
-
@default_port || "4000"
|
34
|
-
end
|
35
|
-
|
36
|
-
def default_scheme
|
37
|
-
@default_scheme || "http"
|
29
|
+
def default_server_url
|
30
|
+
@default_server_url || "http://localhost:4000"
|
38
31
|
end
|
39
32
|
|
40
33
|
def default_url_path
|
41
34
|
@default_url_path || ""
|
42
35
|
end
|
43
36
|
|
44
|
-
def
|
45
|
-
@
|
46
|
-
end
|
47
|
-
|
48
|
-
def port
|
49
|
-
@port || default_port
|
50
|
-
end
|
51
|
-
|
52
|
-
def scheme
|
53
|
-
@scheme || default_scheme
|
37
|
+
def server_url
|
38
|
+
@server_url || default_server_url
|
54
39
|
end
|
55
40
|
|
56
41
|
def client_name
|
@@ -73,16 +58,12 @@ module Spice
|
|
73
58
|
end
|
74
59
|
|
75
60
|
def default_chef_version
|
76
|
-
@default_chef_version || "0.
|
61
|
+
@default_chef_version || "0.10.4"
|
77
62
|
end
|
78
63
|
|
79
64
|
def chef_version
|
80
65
|
@chef_version || default_chef_version
|
81
66
|
end
|
82
|
-
|
83
|
-
def url_path
|
84
|
-
@url_path || default_url_path
|
85
|
-
end
|
86
67
|
|
87
68
|
def connection
|
88
69
|
@connection
|
@@ -90,17 +71,14 @@ module Spice
|
|
90
71
|
|
91
72
|
def connect!
|
92
73
|
@connection = Connection.new(
|
93
|
-
:
|
74
|
+
:server_url => server_url,
|
94
75
|
:client_name => client_name,
|
95
76
|
:key_file => key_file
|
96
77
|
)
|
97
78
|
end
|
98
79
|
|
99
80
|
def reset!
|
100
|
-
@
|
101
|
-
@port = default_port
|
102
|
-
@scheme = default_scheme
|
103
|
-
@url_path = default_url_path
|
81
|
+
@server_url = default_server_url
|
104
82
|
@chef_version = default_chef_version
|
105
83
|
@key_file = nil
|
106
84
|
@client_name = nil
|
@@ -108,13 +86,39 @@ module Spice
|
|
108
86
|
end
|
109
87
|
|
110
88
|
def setup
|
111
|
-
|
89
|
+
if block_given?
|
90
|
+
yield self
|
91
|
+
end
|
92
|
+
connect!
|
112
93
|
end
|
113
94
|
|
114
95
|
def mock
|
115
96
|
Spice::Mock.setup_mock_client
|
116
97
|
end
|
117
98
|
|
99
|
+
# def autoconfigure!(path=nil)
|
100
|
+
# path ||= "~/.chef/"
|
101
|
+
# knife = File.exist?("~/.chef/knife.rb") && File.expand_path(path + "~/.chef/knife.rb")
|
102
|
+
# client = File.exist?("/etc/chef/client.rb") && File.expand_path("/etc/chef/client.rb")
|
103
|
+
#
|
104
|
+
# if knife
|
105
|
+
# raw_config = IO.read(knife)
|
106
|
+
# elsif
|
107
|
+
# raw_config = IO.read(client)
|
108
|
+
# end
|
109
|
+
#
|
110
|
+
# @values = {}
|
111
|
+
# raw_config.each_line do |line|
|
112
|
+
# if line =~ /^chef_server_url.*/
|
113
|
+
# @values[:chef_server_url] = parse_line(line)
|
114
|
+
# elsif line =~ /^node_name.*/
|
115
|
+
# @values[:node_name] = parse_line(line)
|
116
|
+
# elsif line =~ /^client_key.*/
|
117
|
+
# @values[:client_key] = parse_line(line)
|
118
|
+
# end
|
119
|
+
# end
|
120
|
+
# end
|
121
|
+
|
118
122
|
private
|
119
123
|
|
120
124
|
def assert_valid_key_format!(raw_key)
|
@@ -125,5 +129,9 @@ module Spice
|
|
125
129
|
raise ArgumentError, msg
|
126
130
|
end
|
127
131
|
end
|
132
|
+
|
133
|
+
def parse_line(line)
|
134
|
+
line.strip.split.last.gsub("'", "")
|
135
|
+
end
|
128
136
|
end
|
129
137
|
end
|
data/lib/spice/authentication.rb
CHANGED
File without changes
|
data/lib/spice/chef.rb
CHANGED
File without changes
|
data/lib/spice/client.rb
CHANGED
File without changes
|
data/lib/spice/connection.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
require 'yajl
|
1
|
+
require 'yajl'
|
2
2
|
|
3
3
|
module Spice
|
4
4
|
class Connection
|
5
|
-
attr_accessor :client_name, :key_file, :auth_credentials, :
|
5
|
+
attr_accessor :client_name, :key_file, :auth_credentials, :server_url, :url_path
|
6
6
|
|
7
7
|
def initialize(options={})
|
8
|
-
endpoint = URI.parse(options[:
|
9
|
-
@
|
10
|
-
@host = endpoint.host
|
11
|
-
@scheme = endpoint.scheme
|
8
|
+
endpoint = URI.parse(options[:server_url])
|
9
|
+
@server_url = options[:server_url]
|
12
10
|
@port = endpoint.port
|
11
|
+
@scheme = endpoint.scheme
|
13
12
|
@url_path = endpoint.path
|
14
13
|
@auth_credentials = Authentication.new(options[:client_name], options[:key_file])
|
15
14
|
@sign_on_redirect, @sign_request = true, true
|
@@ -18,10 +17,11 @@ module Spice
|
|
18
17
|
def get(path, headers={})
|
19
18
|
begin
|
20
19
|
response = RestClient.get(
|
21
|
-
"#{@
|
20
|
+
"#{@server_url}#{path}",
|
22
21
|
build_headers(:GET, "#{@url_path}#{path}", headers)
|
23
22
|
)
|
24
|
-
|
23
|
+
puts "#{@server_url}#{path}"
|
24
|
+
return Yajl.load(response.body)
|
25
25
|
|
26
26
|
rescue => e
|
27
27
|
e.response
|
@@ -31,10 +31,12 @@ module Spice
|
|
31
31
|
def post(path, payload, headers={})
|
32
32
|
begin
|
33
33
|
response = RestClient.post(
|
34
|
-
"#{@
|
35
|
-
|
36
|
-
build_headers(:POST, "#{@url_path}#{path}", headers,
|
37
|
-
)
|
34
|
+
"#{@server_url}#{path}",
|
35
|
+
Yajl.dump(payload),
|
36
|
+
build_headers(:POST, "#{@url_path}#{path}", headers, Yajl.dump(payload))
|
37
|
+
)
|
38
|
+
return Yajl.load(response.body)
|
39
|
+
|
38
40
|
rescue => e
|
39
41
|
e.response
|
40
42
|
end
|
@@ -43,11 +45,12 @@ module Spice
|
|
43
45
|
def put(path, payload, headers={})
|
44
46
|
begin
|
45
47
|
response = RestClient.put(
|
46
|
-
|
47
|
-
|
48
|
-
build_headers(:PUT, "#{@url_path}#{path}", headers,
|
48
|
+
"#{@server_url}#{path}",
|
49
|
+
Yajl.dump(payload),
|
50
|
+
build_headers(:PUT, "#{@url_path}#{path}", headers, Yajl.dump(payload))
|
49
51
|
)
|
50
|
-
response
|
52
|
+
return Yajl.load(response.body)
|
53
|
+
|
51
54
|
rescue => e
|
52
55
|
e.response
|
53
56
|
end
|
@@ -56,10 +59,11 @@ module Spice
|
|
56
59
|
def delete(path, headers={})
|
57
60
|
begin
|
58
61
|
response = RestClient.delete(
|
59
|
-
|
62
|
+
"#{@server_url}#{path}",
|
60
63
|
build_headers(:DELETE, "#{@url_path}#{path}", headers)
|
61
64
|
)
|
62
|
-
response
|
65
|
+
return Yajl.load(response.body)
|
66
|
+
|
63
67
|
rescue => e
|
64
68
|
e.response
|
65
69
|
end
|
data/lib/spice/cookbook.rb
CHANGED
File without changes
|
data/lib/spice/core_ext/hash.rb
CHANGED
@@ -1,11 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Spice
|
2
|
+
module CoreExt
|
3
|
+
module Hash
|
4
|
+
|
5
|
+
def symbolize_keys!
|
6
|
+
keys.each do |key|
|
7
|
+
self[(key.to_sym rescue key) || key] = delete(key)
|
8
|
+
end
|
9
|
+
self
|
10
|
+
end
|
11
|
+
def symbolize_keys
|
12
|
+
dup.symbolize_keys!
|
13
|
+
end
|
14
|
+
|
5
15
|
end
|
6
|
-
self
|
7
|
-
end
|
8
|
-
def symbolize_keys
|
9
|
-
dup.symbolize_keys!
|
10
16
|
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Hash
|
20
|
+
extend Spice::CoreExt::Hash
|
11
21
|
end
|
data/lib/spice/data_bag.rb
CHANGED
File without changes
|
data/lib/spice/mock.rb
CHANGED
@@ -3,10 +3,10 @@ module Spice
|
|
3
3
|
class << self
|
4
4
|
def setup_mock_client
|
5
5
|
self.setup_authentication
|
6
|
-
Spice.
|
6
|
+
Spice.server_url = 'http://localhost:4000'
|
7
7
|
Spice.client_name = "testclient"
|
8
8
|
Spice.key_file = "/tmp/keyfile.pem"
|
9
|
-
Spice.chef_version = "0.
|
9
|
+
Spice.chef_version = "0.10.4"
|
10
10
|
Spice.connect!
|
11
11
|
end
|
12
12
|
|
data/lib/spice/node.rb
CHANGED
File without changes
|
data/lib/spice/role.rb
CHANGED
File without changes
|
data/lib/spice/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -11,19 +11,25 @@ Spork.prefork do
|
|
11
11
|
require 'webmock/rspec'
|
12
12
|
require 'timecop'
|
13
13
|
require 'rest-client'
|
14
|
-
|
14
|
+
require 'fakefs'
|
15
|
+
require 'fileutils'
|
16
|
+
|
15
17
|
require 'spice'
|
18
|
+
|
16
19
|
# Requires supporting files with custom matchers and macros, etc,
|
17
20
|
# in ./support/ and its subdirectories.
|
18
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
19
21
|
|
20
22
|
RSpec.configure do |config|
|
21
23
|
config.before do
|
24
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
25
|
+
|
22
26
|
Timecop.freeze
|
23
27
|
Spice.mock
|
28
|
+
FakeFS.activate!
|
24
29
|
end
|
25
30
|
config.after do
|
26
31
|
Timecop.return
|
32
|
+
FakeFS.deactivate!
|
27
33
|
end
|
28
34
|
end
|
29
35
|
end
|
File without changes
|
data/spec/spice/chef_spec.rb
CHANGED
File without changes
|
data/spec/spice/client_spec.rb
CHANGED
File without changes
|
File without changes
|
data/spec/spice/cookbook_spec.rb
CHANGED
File without changes
|
data/spec/spice/data_bag_spec.rb
CHANGED
File without changes
|
data/spec/spice/node_spec.rb
CHANGED
File without changes
|
data/spec/spice/role_spec.rb
CHANGED
File without changes
|
data/spec/spice_spec.rb
CHANGED
@@ -1,95 +1,37 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
describe "Spice" do
|
4
|
-
describe ".
|
5
|
-
it "should default to 'localhost'" do
|
6
|
-
Spice.
|
4
|
+
describe ".default_server_url" do
|
5
|
+
it "should default to 'http://localhost:4000'" do
|
6
|
+
Spice.default_server_url.should == "http://localhost:4000"
|
7
7
|
end
|
8
8
|
it "should not be settable" do
|
9
|
-
lambda { Spice.
|
10
|
-
end
|
11
|
-
# @default_host || "localhost"
|
12
|
-
end
|
13
|
-
|
14
|
-
describe ".default_port" do
|
15
|
-
it "should default to '4000'" do
|
16
|
-
Spice.default_port.should == "4000"
|
17
|
-
end
|
18
|
-
it "should not be settable" do
|
19
|
-
lambda { Spice.default_port = "9000" }.should raise_error
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe ".default_scheme" do
|
24
|
-
it "should default to 'http'" do
|
25
|
-
Spice.default_scheme.should == "http"
|
26
|
-
end
|
27
|
-
it "should not be settable" do
|
28
|
-
lambda { Spice.default_scheme = "ftp" }.should raise_error
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe ".default_url_path" do
|
33
|
-
it "should default to ''" do
|
34
|
-
Spice.default_url_path.should == ""
|
35
|
-
end
|
36
|
-
it "should not be settable" do
|
37
|
-
lambda { Spice.default_url_path = "/woohah" }.should raise_error
|
9
|
+
lambda { Spice.default_server_url = "chef.example.com" }.should raise_error
|
38
10
|
end
|
39
11
|
end
|
40
12
|
|
41
13
|
describe ".default_chef_version" do
|
42
|
-
it "should default to '0.
|
43
|
-
Spice.default_chef_version.should == "0.
|
14
|
+
it "should default to '0.10.4'" do
|
15
|
+
Spice.default_chef_version.should == "0.10.4"
|
44
16
|
end
|
45
17
|
it "should not be settable" do
|
46
18
|
lambda { Spice.default_chef_version = "0.9.12" }.should raise_error
|
47
19
|
end
|
48
20
|
end
|
49
21
|
|
50
|
-
describe ".
|
22
|
+
describe ".server_url" do
|
51
23
|
it "should default to 'localhost' if not set" do
|
52
|
-
Spice.
|
53
|
-
end
|
54
|
-
it "should be settable" do
|
55
|
-
Spice.host = "chef.example.com"
|
56
|
-
Spice.host.should == "chef.example.com"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
describe ".port" do
|
61
|
-
it "should default to '4000' if not set" do
|
62
|
-
Spice.port.should == "4000"
|
63
|
-
end
|
64
|
-
it "should be settable" do
|
65
|
-
Spice.port = "9000"
|
66
|
-
Spice.port.should == "9000"
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe ".scheme" do
|
71
|
-
it "should default to 'http' if not set" do
|
72
|
-
Spice.scheme.should == "http"
|
24
|
+
Spice.server_url.should == "http://localhost:4000"
|
73
25
|
end
|
74
26
|
it "should be settable" do
|
75
|
-
Spice.
|
76
|
-
Spice.
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe ".url_path" do
|
81
|
-
it "should default to '' if not set" do
|
82
|
-
Spice.url_path.should == ""
|
83
|
-
end
|
84
|
-
it "should be settable" do
|
85
|
-
Spice.url_path = "/woohah"
|
86
|
-
Spice.url_path.should == "/woohah"
|
27
|
+
Spice.server_url = "https://chef.example.com:4000"
|
28
|
+
Spice.server_url.should == "https://chef.example.com:4000"
|
87
29
|
end
|
88
30
|
end
|
89
31
|
|
90
32
|
describe ".chef_version" do
|
91
|
-
it "should default to '0.
|
92
|
-
Spice.chef_version.should == "0.
|
33
|
+
it "should default to '0.10.4' if not set" do
|
34
|
+
Spice.chef_version.should == "0.10.4"
|
93
35
|
end
|
94
36
|
it "should be settable" do
|
95
37
|
Spice.chef_version = "0.9.12"
|
@@ -131,33 +73,20 @@ describe "Spice" do
|
|
131
73
|
end
|
132
74
|
end
|
133
75
|
|
76
|
+
|
134
77
|
describe ".reset!" do
|
135
78
|
before do
|
136
|
-
Spice.
|
137
|
-
Spice.port = "9000"
|
138
|
-
Spice.scheme = "https"
|
79
|
+
Spice.server_url = "chef.example.com"
|
139
80
|
Spice.key_file = "/tmp/keyfile.pem"
|
140
81
|
Spice.client_name = "testduder"
|
141
82
|
end
|
142
|
-
it "should reset Spice.
|
143
|
-
Spice.reset!
|
144
|
-
Spice.host.should == "localhost"
|
145
|
-
end
|
146
|
-
it "should reset Spice.port" do
|
83
|
+
it "should reset Spice.server_url" do
|
147
84
|
Spice.reset!
|
148
|
-
Spice.
|
149
|
-
end
|
150
|
-
it "should reset Spice.scheme" do
|
151
|
-
Spice.reset!
|
152
|
-
Spice.scheme.should == "http"
|
85
|
+
Spice.server_url.should == "http://localhost:4000"
|
153
86
|
end
|
154
87
|
it "should reset Spice.chef_version" do
|
155
88
|
Spice.reset!
|
156
|
-
Spice.chef_version.should == "0.
|
157
|
-
end
|
158
|
-
it "should reset Spice.url_path" do
|
159
|
-
Spice.reset!
|
160
|
-
Spice.url_path.should == ""
|
89
|
+
Spice.chef_version.should == "0.10.4"
|
161
90
|
end
|
162
91
|
it "should unset Spice.key_file" do
|
163
92
|
Spice.reset!
|
@@ -174,8 +103,19 @@ describe "Spice" do
|
|
174
103
|
Spice.connect!
|
175
104
|
Spice.connection.should be_a_kind_of(Spice::Connection)
|
176
105
|
end
|
177
|
-
it "connection should contain a
|
178
|
-
Spice.connection.
|
106
|
+
it "connection should contain a server_url" do
|
107
|
+
Spice.connection.server_url.should == "http://localhost:4000"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe ".autoconfigure!" do
|
112
|
+
it "should locate /etc/chef/client.rb and create a connection object" do
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should locate ~/.chef/client.rb and create a connection object" do
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should locate ~/.chef/knife.rb and create a connection object" do
|
179
119
|
end
|
180
120
|
end
|
181
121
|
end
|
File without changes
|
data/spice.gemspec
CHANGED
@@ -14,15 +14,20 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = "spice"
|
16
16
|
|
17
|
-
s.add_dependency "
|
18
|
-
s.add_dependency "
|
19
|
-
s.add_dependency "
|
17
|
+
s.add_dependency "rake", ">= 0.9.2"
|
18
|
+
s.add_dependency "rest-client", '>= 1.6.6'
|
19
|
+
s.add_dependency "mixlib-authentication", '>= 1.1.4'
|
20
|
+
s.add_dependency "yajl-ruby", '>= 0.8.3'
|
20
21
|
|
21
|
-
s.add_development_dependency
|
22
|
-
s.add_development_dependency "
|
23
|
-
s.add_development_dependency "
|
24
|
-
s.add_development_dependency
|
25
|
-
s.add_development_dependency
|
22
|
+
s.add_development_dependency 'rspec', '>= 2.6.0'
|
23
|
+
s.add_development_dependency "webmock", ">= 1.6.2"
|
24
|
+
s.add_development_dependency "timecop", ">= 0.3.5"
|
25
|
+
s.add_development_dependency 'guard', '>= 0.6.2'
|
26
|
+
s.add_development_dependency 'guard-rspec', '>= 0.4.2'
|
27
|
+
s.add_development_dependency 'guard-spork', '>= 0.2.1'
|
28
|
+
s.add_development_dependency 'spork', '>= 0.9.0.rc8'
|
29
|
+
s.add_development_dependency 'rb-fsevent', '>= 0.4.3.1'
|
30
|
+
s.add_development_dependency 'growl', '>= 1.0.3'
|
26
31
|
|
27
32
|
s.files = `git ls-files`.split("\n")
|
28
33
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,96 +9,151 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-09-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: rake
|
16
|
+
requirement: &70138046296360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.9.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70138046296360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: rest-client
|
27
|
+
requirement: &70138046295740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 1.6.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70138046295740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: mixlib-authentication
|
38
|
+
requirement: &70138046295180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: 1.1.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70138046295180
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: yajl-ruby
|
49
|
+
requirement: &70138046294600 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
55
|
-
type: :
|
54
|
+
version: 0.8.3
|
55
|
+
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70138046294600
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70138046294020 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - ! '>='
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 2.
|
65
|
+
version: 2.6.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70138046294020
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
|
-
requirement: &
|
71
|
+
requirement: &70138046293460 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ! '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: 1.6.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70138046293460
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: timecop
|
82
|
-
requirement: &
|
82
|
+
requirement: &70138046292880 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ! '>='
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: 0.3.5
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70138046292880
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
93
|
-
requirement: &
|
92
|
+
name: guard
|
93
|
+
requirement: &70138046292360 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ! '>='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
98
|
+
version: 0.6.2
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70138046292360
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: guard-rspec
|
104
|
+
requirement: &70138046291860 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.4.2
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70138046291860
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: guard-spork
|
115
|
+
requirement: &70138046291280 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 0.2.1
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70138046291280
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: spork
|
126
|
+
requirement: &70138046290720 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.9.0.rc8
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: *70138046290720
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: rb-fsevent
|
137
|
+
requirement: &70138046290160 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 0.4.3.1
|
143
|
+
type: :development
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: *70138046290160
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: growl
|
148
|
+
requirement: &70138046289700 !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 1.0.3
|
99
154
|
type: :development
|
100
155
|
prerelease: false
|
101
|
-
version_requirements: *
|
156
|
+
version_requirements: *70138046289700
|
102
157
|
description: Spice is a zesty Chef API wrapper. Its primary purpose is to let you
|
103
158
|
easily integrate your apps with a Chef server easily. Spice provides support for
|
104
159
|
the entire released Chef API
|
@@ -152,7 +207,6 @@ files:
|
|
152
207
|
- spec/support/data_bag_requests.rb
|
153
208
|
- spec/support/environment_requests.rb
|
154
209
|
- spec/support/node_requests.rb
|
155
|
-
- spec/support/requests.rb
|
156
210
|
- spec/support/respond_with_matcher.rb
|
157
211
|
- spec/support/role_requests.rb
|
158
212
|
- spice.gemspec
|
@@ -168,12 +222,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
222
|
- - ! '>='
|
169
223
|
- !ruby/object:Gem::Version
|
170
224
|
version: '0'
|
225
|
+
segments:
|
226
|
+
- 0
|
227
|
+
hash: 3716504645551320101
|
171
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
229
|
none: false
|
173
230
|
requirements:
|
174
231
|
- - ! '>='
|
175
232
|
- !ruby/object:Gem::Version
|
176
233
|
version: '0'
|
234
|
+
segments:
|
235
|
+
- 0
|
236
|
+
hash: 3716504645551320101
|
177
237
|
requirements: []
|
178
238
|
rubyforge_project: spice
|
179
239
|
rubygems_version: 1.8.8
|
@@ -200,6 +260,5 @@ test_files:
|
|
200
260
|
- spec/support/data_bag_requests.rb
|
201
261
|
- spec/support/environment_requests.rb
|
202
262
|
- spec/support/node_requests.rb
|
203
|
-
- spec/support/requests.rb
|
204
263
|
- spec/support/respond_with_matcher.rb
|
205
264
|
- spec/support/role_requests.rb
|
data/spec/support/requests.rb
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
# def stub_client_list(name="testclient")
|
2
|
-
# stub_request(:get, "http://localhost:4000/clients").
|
3
|
-
# to_return(
|
4
|
-
# :status => 200,
|
5
|
-
# :body => "{\"#{name}\":\"http://localhost:4000/clients/#{name}\"}",
|
6
|
-
# :headers => {})
|
7
|
-
# end
|
8
|
-
#
|
9
|
-
# def stub_client_show(name, status=200)
|
10
|
-
# case status
|
11
|
-
# when 200
|
12
|
-
# stub_request(:get, "http://localhost:4000/clients/#{name}").
|
13
|
-
# to_return(
|
14
|
-
# :status => status,
|
15
|
-
# :body => %Q{{"name": "#{name}",
|
16
|
-
# "chef_type": "client",
|
17
|
-
# "json_class": "Chef::ApiClient",
|
18
|
-
# "public_key": "RSA PUBLIC KEY",
|
19
|
-
# "_rev": "1-68532bf2122a54464db6ad65a24e2225",
|
20
|
-
# "admin": true}
|
21
|
-
# }
|
22
|
-
# )
|
23
|
-
# when 404
|
24
|
-
# stub_request(:get, "http://localhost:4000/clients/#{name}").
|
25
|
-
# to_return(
|
26
|
-
# :status => status,
|
27
|
-
# :body => "{\"error\":[\"Cannot load client #{name}\"]}")
|
28
|
-
# end
|
29
|
-
# end
|
30
|
-
#
|
31
|
-
# def stub_client_create(name, admin=false, status=201)
|
32
|
-
# case status
|
33
|
-
# when 201
|
34
|
-
# stub_request(:post, "http://localhost:4000/clients").
|
35
|
-
# with(
|
36
|
-
# :body => "{\"name\":\"#{name}\",\"admin\":#{admin}}").
|
37
|
-
# to_return(
|
38
|
-
# :status => status,
|
39
|
-
# :body => %Q{
|
40
|
-
# {
|
41
|
-
# "private_key":"RSA PRIVATE KEY",
|
42
|
-
# "uri":"http://http://localhost:4000/clients/#{name}"}
|
43
|
-
# },
|
44
|
-
# :headers => {}
|
45
|
-
# )
|
46
|
-
# when 409
|
47
|
-
# stub_request(:post, "http://localhost:4000/clients").
|
48
|
-
# with(
|
49
|
-
# :body => "{\"name\":\"#{name}\",\"admin\":#{admin}}").
|
50
|
-
# to_return(
|
51
|
-
# :status => status,
|
52
|
-
# :body => %Q{
|
53
|
-
# {
|
54
|
-
# "private_key":"RSA PRIVATE KEY",
|
55
|
-
# "uri":"http://http://localhost:4000/clients/#{name}"}
|
56
|
-
# },
|
57
|
-
# :headers => {}
|
58
|
-
# )
|
59
|
-
# end
|
60
|
-
# end
|
61
|
-
#
|
62
|
-
# def stub_client_update(name, admin=false, private_key=false, status=200)
|
63
|
-
# case status
|
64
|
-
# when 200
|
65
|
-
# stub_request(:put, "http://localhost:4000/clients/#{name}").
|
66
|
-
# with(:body => "{\"admin\":#{admin},\"private_key\":#{private_key}}").
|
67
|
-
# to_return(
|
68
|
-
# :status => status,
|
69
|
-
# :body => %Q{{#{"\"private_key\":\"RSA PRIVATE KEY\"," if private_key}\"admin\": true}
|
70
|
-
# }
|
71
|
-
# )
|
72
|
-
# # when 404
|
73
|
-
# # stub_request(:get, "http://localhost:4000/clients/#{name}").
|
74
|
-
# # to_return(
|
75
|
-
# # :status => status,
|
76
|
-
# # :body => "{\"error\":[\"Cannot load client #{name}\"]}")
|
77
|
-
# end
|
78
|
-
# end
|
79
|
-
#
|
80
|
-
# def stub_client_delete(name, status=200)
|
81
|
-
# case status
|
82
|
-
# when 200
|
83
|
-
# stub_request(:delete, "http://localhost:4000/clients/#{name}").
|
84
|
-
# with(:body => "").
|
85
|
-
# to_return(
|
86
|
-
# :status => status,
|
87
|
-
# :body => ""
|
88
|
-
# )
|
89
|
-
# when 404
|
90
|
-
# stub_request(:delete, "http://localhost:4000/clients/#{name}").
|
91
|
-
# with(:body => "").
|
92
|
-
# to_return(
|
93
|
-
# :status => status,
|
94
|
-
# :body => "{\"error\":[\"Cannot load client sasdasdf\"]}"
|
95
|
-
# )
|
96
|
-
# end
|
97
|
-
# end
|