readit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/readit/railtie.rb +5 -1
- data/lib/readit/version.rb +1 -1
- data/lib/readit.rb +3 -2
- data/spec/cases/api_spec.rb +6 -0
- metadata +6 -7
data/lib/readit/railtie.rb
CHANGED
@@ -6,8 +6,12 @@ module Readit
|
|
6
6
|
if consumer_info
|
7
7
|
Readit::Config.consumer_key = consumer_info["consumer_key"]
|
8
8
|
Readit::Config.consumer_secret = consumer_info["consumer_secret"]
|
9
|
+
else
|
10
|
+
Rails.logger.warn "Please check your config/readability.yml file, no consumer_key and consumer_sercret under #{Rails.env} found"
|
9
11
|
end
|
10
|
-
|
12
|
+
else
|
13
|
+
Rails.logger.warn "Please provide consumer_key and consumer_sercret on config/readability.yml file"
|
14
|
+
end
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
data/lib/readit/version.rb
CHANGED
data/lib/readit.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "readit/version"
|
2
2
|
require 'multi_json'
|
3
3
|
require 'oauth'
|
4
|
+
require 'uri'
|
4
5
|
# plugin railtie hook when using rails
|
5
6
|
require 'readit/railtie' if defined?(Rails)
|
6
7
|
|
@@ -78,7 +79,7 @@ module Readit
|
|
78
79
|
# updated_until
|
79
80
|
# order
|
80
81
|
# page
|
81
|
-
# per_page
|
82
|
+
# per_page default 20,max 50
|
82
83
|
# exclude_accessibility
|
83
84
|
# only_deleted
|
84
85
|
def bookmarks(args={})
|
@@ -86,7 +87,7 @@ module Readit
|
|
86
87
|
request(:get,"/bookmarks/#{args[:bookmark_id]}")
|
87
88
|
else
|
88
89
|
params = args.map{|k,v| "#{k}=#{v}"}.join('&')
|
89
|
-
request(:get,
|
90
|
+
request(:get,"/bookmarks?#{URI.escape(params)}")['bookmarks']
|
90
91
|
end
|
91
92
|
end
|
92
93
|
|
data/spec/cases/api_spec.rb
CHANGED
@@ -45,6 +45,12 @@ describe "Readit::API" do
|
|
45
45
|
puts bookmark
|
46
46
|
end
|
47
47
|
|
48
|
+
it "should get bookmarks according to added since" do
|
49
|
+
bookmarks = @api.bookmarks({:added_until=>'2012-1-1',:per_page=>2})
|
50
|
+
puts bookmarks
|
51
|
+
bookmarks.count.should > 0
|
52
|
+
end
|
53
|
+
|
48
54
|
it "should update bookmark to favarite" do
|
49
55
|
bm_id = bookmark_ids.first
|
50
56
|
@api.favorite bm_id
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: readit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-11 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
16
|
-
requirement: &
|
16
|
+
requirement: &2155484380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2155484380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: oauth
|
27
|
-
requirement: &
|
27
|
+
requirement: &2155483960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2155483960
|
36
36
|
description: a simple readability api client
|
37
37
|
email:
|
38
38
|
- mike.d.1984@gmail.com
|
@@ -79,4 +79,3 @@ summary: a simple readability api client
|
|
79
79
|
test_files:
|
80
80
|
- spec/cases/api_spec.rb
|
81
81
|
- spec/spec_helper.rb
|
82
|
-
has_rdoc:
|