checkdin 0.2.6 → 0.2.7

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/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- checkdin (0.2.0)
4
+ checkdin (0.2.6)
5
5
  activesupport (>= 2.0.3)
6
- faraday (>= 0.6, < 0.8)
7
- faraday_middleware (>= 0.8)
6
+ faraday (~> 0.8)
7
+ faraday_middleware
8
8
  hashie (~> 1.0)
9
9
 
10
10
  GEM
@@ -16,10 +16,8 @@ GEM
16
16
  addressable (2.2.7)
17
17
  crack (0.3.1)
18
18
  diff-lcs (1.1.3)
19
- faraday (0.7.6)
20
- addressable (~> 2.2)
19
+ faraday (0.8.0)
21
20
  multipart-post (~> 1.1)
22
- rack (~> 1.1)
23
21
  faraday_middleware (0.8.4)
24
22
  faraday (>= 0.7.4, < 0.9)
25
23
  hashie (1.2.0)
@@ -27,7 +25,6 @@ GEM
27
25
  json (1.6.5)
28
26
  multi_json (1.0.4)
29
27
  multipart-post (1.1.5)
30
- rack (1.4.1)
31
28
  rdoc (3.12)
32
29
  json (~> 1.4)
33
30
  rspec (2.8.0)
@@ -52,7 +49,7 @@ PLATFORMS
52
49
  ruby
53
50
 
54
51
  DEPENDENCIES
55
- bundler (~> 1.0.0)
52
+ bundler (~> 1.0)
56
53
  checkdin!
57
54
  rdoc (~> 3.12)
58
55
  rspec (~> 2.8.0)
@@ -12,6 +12,7 @@ module Checkdin
12
12
  include CustomActivities
13
13
  include Leaderboard
14
14
  include Votes
15
+ include Clients
15
16
 
16
17
  attr_reader :client_id, :client_secret
17
18
  attr_reader :ssl
@@ -0,0 +1,11 @@
1
+ module Checkdin
2
+ module Clients
3
+
4
+ # Retrieve information about the authenticated client
5
+
6
+ def client_details
7
+ response = connection.get("clients/me")
8
+ return_error_or_body(response)
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Checkdin
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
data/lib/checkdin.rb CHANGED
@@ -15,6 +15,7 @@ require 'checkdin/won_rewards'
15
15
  require 'checkdin/promotions'
16
16
  require 'checkdin/campaigns'
17
17
  require 'checkdin/votes'
18
+ require 'checkdin/clients'
18
19
  require 'checkdin/client'
19
20
  require 'checkdin/api_error'
20
21
 
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Checkdin::Clients do
4
+
5
+ before do
6
+ @client = Checkdin::Client.new(TestCredentials.client_args)
7
+ end
8
+
9
+ context "viewing a client's own information" do
10
+ use_vcr_cassette
11
+ let(:result) { @client.client_details }
12
+
13
+ it "should make the client's information available" do
14
+ result.client.name.should == "A Test"
15
+ result.client.website.should == "http://example.com"
16
+ result.client.signup_redirect.should == "http://example.com/users/return_from_checkdin"
17
+ result.client.custom_domain.should == "custom.staging.checkd.in"
18
+ result.client.shared_authentication_secret.should == "12345"
19
+ result.client.push_api_secret.should be_nil
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://staging.checkd.in:443/api/v1/clients/me?client_id={client_id}&client_secret={client_secret}
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/json
10
+ user-agent:
11
+ - checkdin ruby gem 0.2.6
12
+ accept-encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ response: !ruby/struct:VCR::Response
15
+ status: !ruby/struct:VCR::ResponseStatus
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ server:
20
+ - nginx/1.0.11
21
+ date:
22
+ - Mon, 30 Jul 2012 13:53:06 GMT
23
+ content-type:
24
+ - application/json; charset=utf-8
25
+ transfer-encoding:
26
+ - chunked
27
+ connection:
28
+ - keep-alive
29
+ status:
30
+ - 200 OK
31
+ strict-transport-security:
32
+ - max-age=31536000
33
+ x-ua-compatible:
34
+ - IE=Edge,chrome=1
35
+ etag:
36
+ - "\"41ec4e0bf40b05f1cb6942e8ad224fc5\""
37
+ cache-control:
38
+ - must-revalidate, private, max-age=0
39
+ x-request-id:
40
+ - 6d1c115ae2577724a25b9596b1ac492e
41
+ x-runtime:
42
+ - "0.054093"
43
+ x-rack-cache:
44
+ - miss
45
+ body: "{\"client\":{\"name\":\"A Test\",\"website\":\"http://example.com\",\"signup_redirect\":\"http://example.com/users/return_from_checkdin\",\"custom_domain\":\"custom.staging.checkd.in\",\"shared_authentication_secret\":\"12345\",\"push_api_secret\":null}}"
46
+ http_version: "1.1"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: checkdin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.6
5
+ version: 0.2.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Mueller
@@ -163,6 +163,7 @@ files:
163
163
  - lib/checkdin/user_bridge.rb
164
164
  - lib/checkdin/version.rb
165
165
  - lib/checkdin/votes.rb
166
+ - lib/checkdin/clients.rb
166
167
  - lib/checkdin/won_rewards.rb
167
168
  - spec/checkdin/activities_spec.rb
168
169
  - spec/checkdin/campaigns_spec.rb
@@ -173,6 +174,7 @@ files:
173
174
  - spec/checkdin/users_spec.rb
174
175
  - spec/checkdin/user_bridge_spec.rb
175
176
  - spec/checkdin/won_rewards_spec.rb
177
+ - spec/checkdin/clients_spec.rb
176
178
  - spec/fixtures/vcr_cassettes/Checkdin_Activities/viewing_a_list_of_activities.yml
177
179
  - spec/fixtures/vcr_cassettes/Checkdin_Activities/viewing_a_single_activity.yml
178
180
  - spec/fixtures/vcr_cassettes/Checkdin_Activities/voting_for_an_activity.yml
@@ -191,6 +193,7 @@ files:
191
193
  - spec/fixtures/vcr_cassettes/Checkdin_Votes/viewing_a_list_of_activities.yml
192
194
  - spec/fixtures/vcr_cassettes/Checkdin_WonRewards/viewing_a_list_of_won_rewards.yml
193
195
  - spec/fixtures/vcr_cassettes/Checkdin_WonRewards/viewing_a_single_won_reward.yml
196
+ - spec/fixtures/vcr_cassettes/Checkdin_Clients/viewing_a_client_s_own_information.yml
194
197
  - spec/spec_helper.rb
195
198
  has_rdoc: true
196
199
  homepage: http://github.com/mattmueller/checkdin