winnie 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- winnie (0.0.4)
4
+ winnie (0.0.5)
5
5
  json
6
6
  rest-client
7
7
 
@@ -14,16 +14,14 @@ GEM
14
14
  mime-types (1.16)
15
15
  rest-client (1.6.1)
16
16
  mime-types (>= 1.16)
17
- rspec (2.0.1)
18
- rspec-core (~> 2.0.1)
19
- rspec-expectations (~> 2.0.1)
20
- rspec-mocks (~> 2.0.1)
21
- rspec-core (2.0.1)
22
- rspec-expectations (2.0.1)
23
- diff-lcs (>= 1.1.2)
24
- rspec-mocks (2.0.1)
25
- rspec-core (~> 2.0.1)
26
- rspec-expectations (~> 2.0.1)
17
+ rspec (2.1.0)
18
+ rspec-core (~> 2.1.0)
19
+ rspec-expectations (~> 2.1.0)
20
+ rspec-mocks (~> 2.1.0)
21
+ rspec-core (2.1.0)
22
+ rspec-expectations (2.1.0)
23
+ diff-lcs (~> 1.1.2)
24
+ rspec-mocks (2.1.0)
27
25
 
28
26
  PLATFORMS
29
27
  ruby
@@ -32,5 +30,5 @@ DEPENDENCIES
32
30
  fakefs
33
31
  json
34
32
  rest-client
35
- rspec (~> 2.0.0)
33
+ rspec (~> 2.1.0)
36
34
  winnie!
data/lib/winnie/client.rb CHANGED
@@ -29,14 +29,14 @@ module Winnie
29
29
  end
30
30
 
31
31
  def request(path, method, params = {})
32
- headers = {:accept => 'application/json'}.merge(Client.winnie_headers)
32
+ headers = {:accept => :json, :content_type => :json}.merge(Client.winnie_headers)
33
33
  params.merge!(:api_key => @api_key)
34
34
 
35
35
  RestClient::Request.execute(
36
36
  :method => method,
37
37
  :url => "#{winnie_url}#{path}",
38
38
  :headers => headers,
39
- :payload => params
39
+ :payload => params.to_json
40
40
  ) { |response, request| process_response(response) }
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module Winnie
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -17,9 +17,7 @@ describe Winnie::Client do
17
17
 
18
18
  it "should include provided parameters in the request" do
19
19
  RestClient::Request.should_receive(:execute).with(
20
- request_parameters('/api/account', :post,
21
- :payload => {:api_key => 'secret_one', :name => 'test'}
22
- )
20
+ request_parameters('/api/account', :post, {:api_key => 'secret_one', :name => 'test'})
23
21
  )
24
22
  @client.request('/api/account', :post, :name => 'test')
25
23
  end
@@ -27,18 +25,7 @@ describe Winnie::Client do
27
25
  it "should include api_key in the request parameters" do
28
26
  @client = Winnie::Client.new('AABBCC')
29
27
  RestClient::Request.should_receive(:execute).with(
30
- request_parameters('/api/account', :get,
31
- :payload => {:api_key => 'AABBCC'}
32
- )
33
- )
34
- @client.request('/api/account', :get)
35
- end
36
-
37
- it "should accept json responses only" do
38
- RestClient::Request.should_receive(:execute).with(
39
- request_parameters('/api/account', :get,
40
- :headers => {:accept => 'application/json'}
41
- )
28
+ request_parameters('/api/account', :get, {:api_key => 'AABBCC'})
42
29
  )
43
30
  @client.request('/api/account', :get)
44
31
  end
@@ -52,12 +39,12 @@ describe Winnie::Client do
52
39
  @client.request('/api/account', :get)
53
40
  end
54
41
 
55
- def request_parameters(path, method, params = {})
56
- {:payload => {:api_key => 'secret_one'},
42
+ def request_parameters(path, method, payload = {})
43
+ {:payload => ({:api_key => 'secret_one'}.merge(payload)).to_json,
57
44
  :method => method,
58
- :headers => {:accept => 'application/json'},
45
+ :headers => {:accept => :json, :content_type => :json},
59
46
  :url => "https://admin.winniecloud.com#{path}"
60
- }.merge(params)
47
+ }
61
48
  end
62
49
  end
63
50
 
data/winnie.gemspec CHANGED
@@ -21,19 +21,6 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency "json"
23
23
  s.add_dependency "rest-client"
24
- s.add_development_dependency "rspec", "~> 2.0.0"
24
+ s.add_development_dependency "rspec", "~> 2.1.0"
25
25
  s.add_development_dependency "fakefs"
26
-
27
- # TODO: remove after few releases
28
- s.post_install_message = %q{
29
- ========================================================================
30
-
31
- If upgrading from 0.0.1 version of winnie do the following:
32
- > winnie auth
33
- Enter your API key
34
- confirm changes
35
-
36
- This is important to protect your Winnie Cloud credentials.
37
- ========================================================================
38
- }
39
26
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winnie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - winnie
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-29 00:00:00 +02:00
18
+ date: 2010-11-19 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -54,12 +54,12 @@ dependencies:
54
54
  requirements:
55
55
  - - ~>
56
56
  - !ruby/object:Gem::Version
57
- hash: 15
57
+ hash: 11
58
58
  segments:
59
59
  - 2
60
+ - 1
60
61
  - 0
61
- - 0
62
- version: 2.0.0
62
+ version: 2.1.0
63
63
  type: :development
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
@@ -114,18 +114,7 @@ has_rdoc: true
114
114
  homepage: http://winniecloud.com
115
115
  licenses: []
116
116
 
117
- post_install_message: |
118
-
119
- ========================================================================
120
-
121
- If upgrading from 0.0.1 version of winnie do the following:
122
- > winnie auth
123
- Enter your API key
124
- confirm changes
125
-
126
- This is important to protect your Winnie Cloud credentials.
127
- ========================================================================
128
-
117
+ post_install_message:
129
118
  rdoc_options: []
130
119
 
131
120
  require_paths:
@@ -155,11 +144,5 @@ rubygems_version: 1.3.7
155
144
  signing_key:
156
145
  specification_version: 3
157
146
  summary: Winnie command line tool
158
- test_files:
159
- - spec/client_spec.rb
160
- - spec/command_spec.rb
161
- - spec/commands/app_spec.rb
162
- - spec/commands/auth_spec.rb
163
- - spec/commands/base_spec.rb
164
- - spec/spec_helper.rb
165
- - spec/winnie_spec.rb
147
+ test_files: []
148
+