snapcat 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca9e5b503ceac5e5ca3718afb03247f4f4025ad5
4
- data.tar.gz: 005d1017eb32f3d8e1d52174b77e4c984ab16a5b
3
+ metadata.gz: 210ff4b78bf0a20179d05f40946180261f0b4f6c
4
+ data.tar.gz: b102a50953b9ceec9b7aba1c8a1ea57e47762ce0
5
5
  SHA512:
6
- metadata.gz: cd531769fa3d94fc41405dab785056cf51217c3959702cfe74bb534a457126731bc3ab28785fff7174d135c9940c00dcba72a37e784617cd09cd155886364c89
7
- data.tar.gz: 6e49c51b8b707135607d4103034f42f77286547356ccdec2e433b122000c2bf1e863c05ee404456f54caec8e37e4a5af331a016c9fed5c10feaeb10743dadc2a
6
+ metadata.gz: b80f2ae4bc3023b231129a5fc5b0fb4f70554e3b55d2c3fc0fc3ad79226da3bda425fb9a4447a2c84110ae317604f7b1ded722ecbed00dc6e35045a15277d987
7
+ data.tar.gz: f7c7899e72168bac1898b32348e2ddadafa743df7f8f83502872c4108039389e9cfea7631addca2df8cc1b55924ce4f0d860fe575e8b789dcd8415c9fb30d572
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
+ - 2.1.0
data/README.md CHANGED
@@ -98,6 +98,9 @@ user.friends
98
98
  **Friends**
99
99
 
100
100
  ```ruby
101
+ # Add a new friend
102
+ snapcat.add_friend('mybestbuddy')
103
+
101
104
  # Grab a friend
102
105
  friend = user.friends.first
103
106
 
@@ -38,6 +38,14 @@ module Snapcat
38
38
  )
39
39
  end
40
40
 
41
+ def add_friend(username)
42
+ @requestor.request_with_username(
43
+ 'friend',
44
+ action: 'add',
45
+ friend: username
46
+ )
47
+ end
48
+
41
49
  def set_display_name(username, display_name)
42
50
  @requestor.request_with_username(
43
51
  'friend',
data/snapcat.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'snapcat'
7
- spec.version = '0.0.2'
7
+ spec.version = '0.0.3'
8
8
  spec.authors = ['Neal Kemp']
9
9
  spec.email = ['']
10
10
  spec.description = %q{Snapchat API wrapper}
@@ -18,11 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency 'httmultiparty', '~> 0.3.5'
22
- spec.add_runtime_dependency 'json', '>= 1.6.0'
21
+ spec.add_runtime_dependency 'httmultiparty', '~> 0.3'
22
+ spec.add_runtime_dependency 'json', '>= 1.6'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.3'
25
- spec.add_development_dependency 'mocha'
26
- spec.add_development_dependency 'rake'
27
- spec.add_development_dependency 'webmock', '>= 1.10'
25
+ spec.add_development_dependency 'mocha', '~> 0'
26
+ spec.add_development_dependency 'rake', '~> 10'
27
+ spec.add_development_dependency 'webmock', '~> 1.10'
28
+ spec.add_development_dependency 'rspec', '~> 2.14'
28
29
  end
@@ -38,6 +38,17 @@ describe Snapcat::Client do
38
38
  end
39
39
  end
40
40
 
41
+ describe '#add_friends' do
42
+ it 'adds this friend' do
43
+ ux = UserExperience.new
44
+ ux.login
45
+
46
+ result = ux.client.add_friend(ux.friend.username)
47
+
48
+ result.success?.must_equal true
49
+ end
50
+ end
51
+
41
52
  describe '#fetch_updates' do
42
53
  it 'resets all of the users update fields' do
43
54
  ux = UserExperience.new
@@ -10,7 +10,8 @@ module RequestStub
10
10
  stub_basics
11
11
  block
12
12
  clear_feed
13
- delete
13
+ delete_friend
14
+ add_friend
14
15
  fetch_updates
15
16
  logout
16
17
  media
@@ -144,7 +145,7 @@ module RequestStub
144
145
  )
145
146
  end
146
147
 
147
- def delete
148
+ def delete_friend
148
149
  request_body = requestify(
149
150
  {
150
151
  action: 'delete',
@@ -161,6 +162,23 @@ module RequestStub
161
162
  )
162
163
  end
163
164
 
165
+ def add_friend
166
+ request_body = requestify(
167
+ {
168
+ action: 'add',
169
+ friend: Fixture::FRIEND_USERNAME
170
+ },
171
+ username: true
172
+ )
173
+ stub_request(:post, "#{BASE_URI}/friend").with(
174
+ body: request_body
175
+ ).to_return(
176
+ status: 200,
177
+ body: ResponseHelper.json_for(:add),
178
+ headers: json_headers
179
+ )
180
+ end
181
+
164
182
  def set_display_name
165
183
  request_body = requestify(
166
184
  {
@@ -0,0 +1,5 @@
1
+ {
2
+ "message": "catsaregreat is now your friend!",
3
+ "param":"iluva",
4
+ "logged":true
5
+ }
metadata CHANGED
@@ -1,99 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neal Kemp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-26 00:00:00.000000000 Z
11
+ date: 2013-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httmultiparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.5
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.5
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.0
33
+ version: '1.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.0
40
+ version: '1.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '10'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '10'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.10'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.14'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.14'
97
111
  description: Snapchat API wrapper
98
112
  email:
99
113
  - ''
@@ -101,8 +115,8 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
- - .gitignore
105
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".travis.yml"
106
120
  - Gemfile
107
121
  - LICENSE.txt
108
122
  - README.md
@@ -134,6 +148,7 @@ files:
134
148
  - spec/support/minitest_spec_context.rb
135
149
  - spec/support/request_stub.rb
136
150
  - spec/support/response_helper.rb
151
+ - spec/support/responses/add_success.json
137
152
  - spec/support/responses/block_success.json
138
153
  - spec/support/responses/delete_success.json
139
154
  - spec/support/responses/login_success.json
@@ -165,17 +180,17 @@ require_paths:
165
180
  - lib
166
181
  required_ruby_version: !ruby/object:Gem::Requirement
167
182
  requirements:
168
- - - '>='
183
+ - - ">="
169
184
  - !ruby/object:Gem::Version
170
185
  version: 1.9.3
171
186
  required_rubygems_version: !ruby/object:Gem::Requirement
172
187
  requirements:
173
- - - '>='
188
+ - - ">="
174
189
  - !ruby/object:Gem::Version
175
190
  version: '0'
176
191
  requirements: []
177
192
  rubyforge_project:
178
- rubygems_version: 2.0.14
193
+ rubygems_version: 2.2.0
179
194
  signing_key:
180
195
  specification_version: 4
181
196
  summary: Ruby wrapper for Snapchat's private API
@@ -195,6 +210,7 @@ test_files:
195
210
  - spec/support/minitest_spec_context.rb
196
211
  - spec/support/request_stub.rb
197
212
  - spec/support/response_helper.rb
213
+ - spec/support/responses/add_success.json
198
214
  - spec/support/responses/block_success.json
199
215
  - spec/support/responses/delete_success.json
200
216
  - spec/support/responses/login_success.json