kippt 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -3
- data/lib/kippt/list.rb +4 -0
- data/lib/kippt/version.rb +1 -1
- data/spec/kippt/list_spec.rb +10 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -91,6 +91,15 @@ list_id = 10
|
|
91
91
|
list = client.lists[list_id] # Returns Kippt::ListItem
|
92
92
|
```
|
93
93
|
|
94
|
+
Get single lists’s clips:
|
95
|
+
|
96
|
+
```ruby
|
97
|
+
client = Kippt::Client.new(username: "vesan", token: "2544d6bfddf5893ec8617")
|
98
|
+
list_id = 10
|
99
|
+
list = Kippt::List.new({ id: list_id }, client)
|
100
|
+
list.clips # Returns a Kippt::ClipCollection
|
101
|
+
```
|
102
|
+
|
94
103
|
|
95
104
|
#### Clips
|
96
105
|
|
@@ -156,7 +165,7 @@ clip.url = "http://github.com"
|
|
156
165
|
clip.save #=> Returns boolean
|
157
166
|
```
|
158
167
|
|
159
|
-
If you are missing required fields `#save` will return `false` and you can use
|
168
|
+
If you are missing required fields `#save` will return `false` and you can use
|
160
169
|
`#errors` to get the error messages returned by the API.
|
161
170
|
|
162
171
|
```ruby
|
@@ -177,8 +186,8 @@ clip.destroy #=> true
|
|
177
186
|
|
178
187
|
### Debugging
|
179
188
|
|
180
|
-
To get more information on what is going on under the covers, set `DEBUG=true`
|
181
|
-
as environment variable or pass `debug: true` in the Kippt::Client options hash
|
189
|
+
To get more information on what is going on under the covers, set `DEBUG=true`
|
190
|
+
as environment variable or pass `debug: true` in the Kippt::Client options hash
|
182
191
|
like:
|
183
192
|
|
184
193
|
```ruby
|
data/lib/kippt/list.rb
CHANGED
@@ -21,6 +21,10 @@ class Kippt::List
|
|
21
21
|
}
|
22
22
|
end
|
23
23
|
|
24
|
+
def clips
|
25
|
+
Kippt::ClipCollection.new(client.get("lists/#{id}/clips").body, client)
|
26
|
+
end
|
27
|
+
|
24
28
|
def follow
|
25
29
|
response = client.post("#{resource_uri}relationship", :data => {:action => "follow"})
|
26
30
|
raise Kippt::APIError.new("There was an error with the request: #{response.body["message"]}") unless response.success?
|
data/lib/kippt/version.rb
CHANGED
data/spec/kippt/list_spec.rb
CHANGED
@@ -33,6 +33,16 @@ describe Kippt::List do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
describe "#clips" do
|
37
|
+
subject { Kippt::List.new({ "id" => 10 }, client).clips }
|
38
|
+
|
39
|
+
it "returns the clips for the list" do
|
40
|
+
stub_get("/lists/#{10}/clips").
|
41
|
+
to_return(:status => 200, :body => fixture("clips.json"))
|
42
|
+
subject.should be_a Kippt::ClipCollection
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
36
46
|
describe "#follow" do
|
37
47
|
context "when request is successful" do
|
38
48
|
let(:client) { Kippt::Client.new(valid_user_credentials) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kippt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
segments:
|
199
199
|
- 0
|
200
|
-
hash:
|
200
|
+
hash: 1554217779717376625
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash:
|
209
|
+
hash: 1554217779717376625
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
212
|
rubygems_version: 1.8.24
|