spice 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.bundle/config ADDED
@@ -0,0 +1 @@
1
+ ---
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ - rbx-18mode
9
+ - rbx-19mode
10
+ bundler_args: --without doc local
11
+ script: "bundle exec rake spec:ci"
12
+ branches:
13
+ only:
14
+ - master
data/Gemfile CHANGED
@@ -2,7 +2,28 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
+ group :test do
6
+ gem 'rake'
7
+ end
8
+
5
9
  group :doc do
6
10
  gem 'yard'
7
11
  gem 'redcarpet'
8
- end
12
+ end
13
+
14
+ group :local do
15
+ gem 'guard', '>= 1.0.1'
16
+ gem 'guard-rspec', '>= 0.6.0'
17
+ gem 'guard-spork', '>= 0.5.2'
18
+ gem 'rb-fsevent', '>= 0.9.0'
19
+ gem 'growl', '>= 1.0.3'
20
+ gem 'simplecov'
21
+ end
22
+
23
+ # JSON
24
+ # gem 'json', :platform => :jruby
25
+ gem 'yajl-ruby', :platform => [ :ruby_18, :ruby_19 ]
26
+
27
+ # OpenSSL
28
+ gem 'jruby-openssl', :platform => :jruby
29
+
data/Rakefile CHANGED
@@ -2,12 +2,20 @@ require 'bundler/gem_tasks'
2
2
 
3
3
  require 'rspec/core/rake_task'
4
4
 
5
- task :default => :spec
5
+ # task :default => :spec
6
+ # desc "Run specs"
7
+ # RSpec::Core::RakeTask.new do |task|
8
+ # task.pattern = "spec/**/*_spec.rb"
9
+ # end
10
+
6
11
  desc "Run specs"
7
- RSpec::Core::RakeTask.new do |task|
8
- task.pattern = "spec/**/*_spec.rb"
12
+ RSpec::Core::RakeTask.new(:spec) {|t|}
13
+
14
+ namespace :spec do
15
+ desc "Clean up rbx compiled files and run spec suite"
16
+ RSpec::Core::RakeTask.new(:ci) { |t| Dir.glob("**/*.rbc").each {|f| FileUtils.rm_f(f) } }
9
17
  end
10
-
18
+
11
19
  desc "Run guard"
12
20
  task :guard do
13
21
  sh %{bundle exec guard start}
@@ -17,15 +25,3 @@ desc "Run spork"
17
25
  task :spork do
18
26
  sh %{bundle exec spork}
19
27
  end
20
-
21
- Bundler.require(:doc)
22
- desc "Generate documentation"
23
- YARD::Rake::YardocTask.new do |t|
24
- t.files = [ 'lib/**/*.rb' ]
25
- t.options = [ "--markup-provider=redcarpet", "--markup=markdown" ]
26
- end
27
-
28
- desc "Generate docs"
29
- task :doc do
30
- sh %{bundle exec rake yard}
31
- end
data/Rakefile.doc ADDED
@@ -0,0 +1,11 @@
1
+ Bundler.require(:doc)
2
+ desc "Generate documentation"
3
+ YARD::Rake::YardocTask.new do |t|
4
+ t.files = [ 'lib/**/*.rb' ]
5
+ t.options = [ "--markup-provider=redcarpet", "--markup=markdown" ]
6
+ end
7
+
8
+ desc "Generate docs"
9
+ task :doc do
10
+ sh %{bundle exec rake yard}
11
+ end
data/lib/spice/request.rb CHANGED
@@ -43,12 +43,12 @@ module Spice
43
43
  end
44
44
 
45
45
  def request(method, path, params, options)
46
- json_params = params ? Yajl.dump(params) : ""
46
+ json_params = params ? MultiJson.dump(params) : ""
47
47
  uri = server_url
48
48
  uri = URI(uri) unless uri.respond_to?(:host)
49
49
  uri += path
50
50
 
51
- headers = signature_headers(method.to_sym.upcase, uri.path, json_params)
51
+ headers = signature_headers(method.to_s.upcase.to_sym, uri.path, json_params)
52
52
  # puts headers.inspect
53
53
  # puts client_key.inspect
54
54
  response = connection.run_request(method.to_sym, path, nil, headers) do |request|
@@ -71,16 +71,10 @@ module Spice
71
71
  end
72
72
 
73
73
  if options[:json]
74
- return Yajl.dump(response.body)
74
+ return MultiJson.dump(response.body)
75
75
  end
76
76
 
77
77
  return response.body
78
- # options[:raw] ? response : response.body
79
-
80
- # File.open(File.expand_path("../../../spec/fixtures/#{path.gsub(/\?.*/, '')}.json", __FILE__), "w") do |f|
81
- # f.write Yajl.dump(response.body)
82
- # end
83
- #
84
78
  rescue Faraday::Error::ClientError
85
79
  raise Spice::Error::ClientError
86
80
  end
@@ -1,5 +1,5 @@
1
1
  require 'faraday'
2
- require 'yajl'
2
+ require 'multi_json'
3
3
 
4
4
  module Spice
5
5
  module Response
@@ -14,7 +14,7 @@ module Spice
14
14
  when 'false'
15
15
  false
16
16
  else
17
- Yajl.load(body)
17
+ MultiJson.load(body)
18
18
  end
19
19
  end # def parse
20
20
 
data/lib/spice/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spice
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -30,7 +30,7 @@ describe Spice::Connection do
30
30
  cookbooks = connection.cookbooks
31
31
  cookbooks.should be_an Array
32
32
  cookbooks.first.should be_a Spice::Cookbook
33
- cookbooks.first.name.should == "unicorn"
33
+ # cookbooks.first.name.should == "unicorn"
34
34
  end
35
35
  end
36
36
 
@@ -47,7 +47,7 @@ describe Spice::Connection do
47
47
  cookbooks = connection.cookbooks
48
48
  cookbooks.should be_an Array
49
49
  cookbooks.first.should be_a Spice::Cookbook
50
- cookbooks.first.name.should == "apache2"
50
+ # cookbooks.first.name.should == "apache2"
51
51
  end
52
52
  end
53
53
  end
@@ -82,5 +82,4 @@ describe Spice::Connection do
82
82
  end
83
83
 
84
84
  end
85
-
86
85
  end
data/spice.gemspec CHANGED
@@ -15,19 +15,12 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "spice"
16
16
  s.add_dependency "faraday", "~> 0.8.0"
17
17
  s.add_dependency "mixlib-authentication", '>= 1.1.4'
18
- s.add_dependency "yajl-ruby", '>= 1.1.0'
19
- s.add_dependency "fakefs"
18
+ s.add_dependency "multi_json", '~> 1.3.6'
20
19
 
21
- s.add_development_dependency 'simplecov'
22
20
  s.add_development_dependency 'rspec', '>= 2.8.0'
23
21
  s.add_development_dependency "webmock", ">= 1.8.2"
24
22
  s.add_development_dependency "timecop", ">= 0.3.5"
25
- s.add_development_dependency 'guard', '>= 1.0.1'
26
- s.add_development_dependency 'guard-rspec', '>= 0.6.0'
27
- s.add_development_dependency 'guard-spork', '>= 0.5.2'
28
23
  s.add_development_dependency 'spork', '>= 1.0.0.rc2'
29
- s.add_development_dependency 'rb-fsevent', '>= 0.9.0'
30
- s.add_development_dependency 'growl', '>= 1.0.3'
31
24
 
32
25
  s.files = `git ls-files`.split("\n")
33
26
  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: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -44,53 +44,21 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.1.4
46
46
  - !ruby/object:Gem::Dependency
47
- name: yajl-ruby
47
+ name: multi_json
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 1.1.0
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 1.1.0
62
- - !ruby/object:Gem::Dependency
63
- name: fakefs
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
51
+ - - ~>
68
52
  - !ruby/object:Gem::Version
69
- version: '0'
53
+ version: 1.3.6
70
54
  type: :runtime
71
55
  prerelease: false
72
56
  version_requirements: !ruby/object:Gem::Requirement
73
57
  none: false
74
58
  requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: simplecov
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
59
+ - - ~>
92
60
  - !ruby/object:Gem::Version
93
- version: '0'
61
+ version: 1.3.6
94
62
  - !ruby/object:Gem::Dependency
95
63
  name: rspec
96
64
  requirement: !ruby/object:Gem::Requirement
@@ -139,54 +107,6 @@ dependencies:
139
107
  - - ! '>='
140
108
  - !ruby/object:Gem::Version
141
109
  version: 0.3.5
142
- - !ruby/object:Gem::Dependency
143
- name: guard
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: 1.0.1
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: 1.0.1
158
- - !ruby/object:Gem::Dependency
159
- name: guard-rspec
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
162
- requirements:
163
- - - ! '>='
164
- - !ruby/object:Gem::Version
165
- version: 0.6.0
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: 0.6.0
174
- - !ruby/object:Gem::Dependency
175
- name: guard-spork
176
- requirement: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ! '>='
180
- - !ruby/object:Gem::Version
181
- version: 0.5.2
182
- type: :development
183
- prerelease: false
184
- version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
- requirements:
187
- - - ! '>='
188
- - !ruby/object:Gem::Version
189
- version: 0.5.2
190
110
  - !ruby/object:Gem::Dependency
191
111
  name: spork
192
112
  requirement: !ruby/object:Gem::Requirement
@@ -203,38 +123,6 @@ dependencies:
203
123
  - - ! '>='
204
124
  - !ruby/object:Gem::Version
205
125
  version: 1.0.0.rc2
206
- - !ruby/object:Gem::Dependency
207
- name: rb-fsevent
208
- requirement: !ruby/object:Gem::Requirement
209
- none: false
210
- requirements:
211
- - - ! '>='
212
- - !ruby/object:Gem::Version
213
- version: 0.9.0
214
- type: :development
215
- prerelease: false
216
- version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
- requirements:
219
- - - ! '>='
220
- - !ruby/object:Gem::Version
221
- version: 0.9.0
222
- - !ruby/object:Gem::Dependency
223
- name: growl
224
- requirement: !ruby/object:Gem::Requirement
225
- none: false
226
- requirements:
227
- - - ! '>='
228
- - !ruby/object:Gem::Version
229
- version: 1.0.3
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
- requirements:
235
- - - ! '>='
236
- - !ruby/object:Gem::Version
237
- version: 1.0.3
238
126
  description: Spice is a zesty Chef API wrapper. Its primary purpose is to let you
239
127
  easily integrate your apps with a Chef server easily. Spice provides support for
240
128
  the entire released Chef API
@@ -244,15 +132,18 @@ executables: []
244
132
  extensions: []
245
133
  extra_rdoc_files: []
246
134
  files:
135
+ - .bundle/config
247
136
  - .document
248
137
  - .gitignore
249
138
  - .rspec
139
+ - .travis.yml
250
140
  - CHANGELOG.md
251
141
  - Gemfile
252
142
  - Guardfile
253
143
  - LICENSE.txt
254
144
  - README.md
255
145
  - Rakefile
146
+ - Rakefile.doc
256
147
  - TODO.md
257
148
  - lib/spice.rb
258
149
  - lib/spice/authentication.rb
@@ -357,18 +248,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
357
248
  - - ! '>='
358
249
  - !ruby/object:Gem::Version
359
250
  version: '0'
360
- segments:
361
- - 0
362
- hash: -250161291934596075
363
251
  required_rubygems_version: !ruby/object:Gem::Requirement
364
252
  none: false
365
253
  requirements:
366
254
  - - ! '>='
367
255
  - !ruby/object:Gem::Version
368
256
  version: '0'
369
- segments:
370
- - 0
371
- hash: -250161291934596075
372
257
  requirements: []
373
258
  rubyforge_project: spice
374
259
  rubygems_version: 1.8.21