totter 0.2.4 → 0.2.5
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/lib/totter/client/avatars.rb +1 -1
- data/lib/totter/client/choices.rb +1 -1
- data/lib/totter/client/decisions.rb +1 -1
- data/lib/totter/client/slugs.rb +1 -1
- data/lib/totter/client/stickers.rb +16 -0
- data/lib/totter/client/timelines.rb +1 -1
- data/lib/totter/client/votes.rb +1 -1
- data/lib/totter/version.rb +1 -1
- data/test/cassettes/stickers/show.yml +86 -0
- data/test/totter/client/stickers_test.rb +13 -0
- metadata +7 -2
data/lib/totter/client/slugs.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Totter
|
2
|
+
class Client
|
3
|
+
# Client methods for working with stickers.
|
4
|
+
module Slugs
|
5
|
+
# Get all of the users with a given sticker.
|
6
|
+
#
|
7
|
+
# @param sticker_name [String] the sticker to get users for
|
8
|
+
# @return [Array] an array of `Hashie::Mash` objects representing users
|
9
|
+
# @example
|
10
|
+
# Seesaw.sticker('staff')
|
11
|
+
def sticker(sticker_name)
|
12
|
+
get "stickers/#{sticker_name}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/totter/client/votes.rb
CHANGED
data/lib/totter/version.rb
CHANGED
@@ -0,0 +1,86 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:5000/v1/stickers/staff
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- ! '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
Authorization:
|
15
|
+
- Bearer 9774e653f7b3c1de5f21b61adc08ba24
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
X-Ua-Compatible:
|
26
|
+
- IE=Edge
|
27
|
+
Etag:
|
28
|
+
- ! '"3b67e7ba4465a6279377d9612e7ab631"'
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
X-Request-Id:
|
32
|
+
- 3ba95ec0d35deef75d07925e5ac261cb
|
33
|
+
X-Runtime:
|
34
|
+
- '0.351143'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- thin 1.5.0 codename Knife
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ! '[{"biography":null,"created_at":"2013-02-05T16:18:54Z","family_name":"Soffes","given_name":"Sam","id":3,"meta":null,"moderated_decisions_count":null,"stickers":["awesome","staff"],"updated_at":"2013-02-05T22:31:32Z","username":"soffes","website":null,"avatar_url":"https://recess-dev.s3.amazonaws.com/default_avatars/v1/photo_2.png","full_name":"Sam
|
42
|
+
Soffes","short_name":"Sam S","display_name":"soffes","short_display_name":"soffes","analytics":{"votes":0,"decisions":0,"followers":0,"following":0}}]'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Tue, 05 Feb 2013 23:05:35 GMT
|
45
|
+
- request:
|
46
|
+
method: get
|
47
|
+
uri: http://localhost:5000/v1/stickers/lame
|
48
|
+
body:
|
49
|
+
encoding: US-ASCII
|
50
|
+
string: ''
|
51
|
+
headers:
|
52
|
+
Accept:
|
53
|
+
- ! '*/*'
|
54
|
+
User-Agent:
|
55
|
+
- Ruby
|
56
|
+
Authorization:
|
57
|
+
- Bearer 9774e653f7b3c1de5f21b61adc08ba24
|
58
|
+
Content-Type:
|
59
|
+
- application/json
|
60
|
+
response:
|
61
|
+
status:
|
62
|
+
code: 200
|
63
|
+
message: OK
|
64
|
+
headers:
|
65
|
+
Content-Type:
|
66
|
+
- application/json; charset=utf-8
|
67
|
+
X-Ua-Compatible:
|
68
|
+
- IE=Edge
|
69
|
+
Etag:
|
70
|
+
- ! '"d751713988987e9331980363e24189ce"'
|
71
|
+
Cache-Control:
|
72
|
+
- max-age=0, private, must-revalidate
|
73
|
+
X-Request-Id:
|
74
|
+
- 21785ff087717065de80f73646a11a91
|
75
|
+
X-Runtime:
|
76
|
+
- '0.010451'
|
77
|
+
Connection:
|
78
|
+
- close
|
79
|
+
Server:
|
80
|
+
- thin 1.5.0 codename Knife
|
81
|
+
body:
|
82
|
+
encoding: US-ASCII
|
83
|
+
string: ! '[]'
|
84
|
+
http_version:
|
85
|
+
recorded_at: Tue, 05 Feb 2013 23:05:35 GMT
|
86
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class StickersTest < Totter::TestCase
|
4
|
+
def test_show
|
5
|
+
VCR.use_cassette 'stickers/show' do
|
6
|
+
users = local_client.sticker('staff')
|
7
|
+
assert_equal 1, users.length
|
8
|
+
|
9
|
+
users = local_client.sticker('lame')
|
10
|
+
assert_equal 0, users.length
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- lib/totter/client/choices.rb
|
66
66
|
- lib/totter/client/decisions.rb
|
67
67
|
- lib/totter/client/slugs.rb
|
68
|
+
- lib/totter/client/stickers.rb
|
68
69
|
- lib/totter/client/timelines.rb
|
69
70
|
- lib/totter/client/users.rb
|
70
71
|
- lib/totter/client/votes.rb
|
@@ -88,6 +89,7 @@ files:
|
|
88
89
|
- test/cassettes/decisions/show.yml
|
89
90
|
- test/cassettes/decisions/unflag.yml
|
90
91
|
- test/cassettes/slugs/show.yml
|
92
|
+
- test/cassettes/stickers/show.yml
|
91
93
|
- test/cassettes/timelines/flagged.yml
|
92
94
|
- test/cassettes/timelines/global.yml
|
93
95
|
- test/cassettes/timelines/hashtags.yml
|
@@ -105,6 +107,7 @@ files:
|
|
105
107
|
- test/totter/client/choices_test.rb
|
106
108
|
- test/totter/client/decisions_test.rb
|
107
109
|
- test/totter/client/slugs_test.rb
|
110
|
+
- test/totter/client/stickers_test.rb
|
108
111
|
- test/totter/client/timelines_test.rb
|
109
112
|
- test/totter/client/users_test.rb
|
110
113
|
- test/totter/client/votes_test.rb
|
@@ -132,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
135
|
version: '0'
|
133
136
|
segments:
|
134
137
|
- 0
|
135
|
-
hash:
|
138
|
+
hash: 1986829954371603191
|
136
139
|
requirements: []
|
137
140
|
rubyforge_project:
|
138
141
|
rubygems_version: 1.8.23
|
@@ -156,6 +159,7 @@ test_files:
|
|
156
159
|
- test/cassettes/decisions/show.yml
|
157
160
|
- test/cassettes/decisions/unflag.yml
|
158
161
|
- test/cassettes/slugs/show.yml
|
162
|
+
- test/cassettes/stickers/show.yml
|
159
163
|
- test/cassettes/timelines/flagged.yml
|
160
164
|
- test/cassettes/timelines/global.yml
|
161
165
|
- test/cassettes/timelines/hashtags.yml
|
@@ -173,6 +177,7 @@ test_files:
|
|
173
177
|
- test/totter/client/choices_test.rb
|
174
178
|
- test/totter/client/decisions_test.rb
|
175
179
|
- test/totter/client/slugs_test.rb
|
180
|
+
- test/totter/client/stickers_test.rb
|
176
181
|
- test/totter/client/timelines_test.rb
|
177
182
|
- test/totter/client/users_test.rb
|
178
183
|
- test/totter/client/votes_test.rb
|