rack-superfeedr 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/VERSION +1 -1
- data/lib/rack-superfeedr.rb +33 -2
- data/rack-superfeedr.gemspec +6 -5
- data/test/test_rack-superfeedr.rb +11 -0
- metadata +17 -30
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZmNlOGUxM2U3N2Q4ZTEzZDlhYTkyOGFjYTA3Zjg4ODRlNDI4ZDlkYw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWU4ZjlmZmQ1ZDI2ZGNkZmFkNjkwMDQ3MjA5ZjUxZTVkNjg3OTMwMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2UxM2E1Njc1NzlhZDRkZjZjNTIwZWIzNmM3NTBjYjk1ZTI0ODBlOTE4ZmJj
|
10
|
+
ZjI0NTdlY2IzZjc5ZmQ0Y2Y0MmE4N2JjNzNkNjg5MGU0YjYxNzgwNGUxZjEy
|
11
|
+
M2VmNzc2MmI0MTkwM2U5NGFiMDI4NWUwYzBlMDk2MTk2YjVhMGE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDAyM2ViZTExZWY4NGRlODVhM2ViYmYzODI4NjNlZTZiYzdkY2JmZjZhMWE1
|
14
|
+
NThkNGM0OTc0MDdjOTVlNDg4ZDYxYjdmOTc4ZDBiNmEyODVlNWUxMDRmMzNl
|
15
|
+
NmRhZDE0N2FjYWJkYzY2M2QyZDUzMmI2NTFiMzQ5OWY3ZDlmNmM=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/rack-superfeedr.rb
CHANGED
@@ -178,9 +178,40 @@ module SuperfeedrAPI
|
|
178
178
|
r
|
179
179
|
end
|
180
180
|
|
181
|
+
def list(opts = {}, &blk)
|
182
|
+
endpoint = @@superfeedr_endpoint
|
183
|
+
request = {
|
184
|
+
'hub.mode' => 'list',
|
185
|
+
'detailed' => true
|
186
|
+
}
|
187
|
+
|
188
|
+
if opts[:page]
|
189
|
+
request['page'] = opts[:page]
|
190
|
+
end
|
191
|
+
|
192
|
+
if opts[:by_page]
|
193
|
+
request['by_page'] = opts[:by_page]
|
194
|
+
end
|
195
|
+
|
196
|
+
if opts[:search]
|
197
|
+
request['search'] = opts[:search]
|
198
|
+
end
|
199
|
+
|
200
|
+
request['authorization'] = Base64.encode64( "#{@@login}:#{@@password}" ).chomp
|
201
|
+
|
202
|
+
response = http_get(endpoint, request)
|
203
|
+
|
204
|
+
r = [response.body, Integer(response.code) == 200, response]
|
205
|
+
if blk
|
206
|
+
blk.call(r)
|
207
|
+
end
|
208
|
+
r
|
209
|
+
|
210
|
+
end
|
211
|
+
|
181
212
|
protected
|
182
213
|
|
183
|
-
def prep_request(url, id, endpoint, opts)
|
214
|
+
def prep_request(url = nil, id = nil, endpoint = nil, opts = {})
|
184
215
|
feed_id = "#{id ? id : Base64.urlsafe_encode64(url)}"
|
185
216
|
|
186
217
|
request = {
|
@@ -224,7 +255,7 @@ module SuperfeedrAPI
|
|
224
255
|
end
|
225
256
|
|
226
257
|
def generate_callback(url, feed_id)
|
227
|
-
if @@scheme == "https"
|
258
|
+
if @@scheme == "https"
|
228
259
|
URI::HTTPS.build({:scheme => @@scheme, :host => @@host, :path => "#{@@base_path}#{feed_id}", :port => @@port }).to_s
|
229
260
|
else
|
230
261
|
URI::HTTP.build({:scheme => @@scheme, :host => @@host, :path => "#{@@base_path}#{feed_id}", :port => @@port }).to_s
|
data/rack-superfeedr.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: rack-superfeedr 0.4.3 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "rack-superfeedr"
|
8
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.3"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["julien51"]
|
12
|
-
s.date = "2015-04-
|
14
|
+
s.date = "2015-04-17"
|
13
15
|
s.description = "A gem that provides a rack middleware to interract with Superfeedr's API. "
|
14
16
|
s.email = "julien@superfeedr.com"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -32,12 +34,11 @@ Gem::Specification.new do |s|
|
|
32
34
|
]
|
33
35
|
s.homepage = "http://rubygems.org/gems/rack-superfeedr"
|
34
36
|
s.licenses = ["MIT"]
|
35
|
-
s.
|
36
|
-
s.rubygems_version = "1.8.23.2"
|
37
|
+
s.rubygems_version = "2.4.6"
|
37
38
|
s.summary = "A gem that provides a rack middleware to interract with Superfeedr's API."
|
38
39
|
|
39
40
|
if s.respond_to? :specification_version then
|
40
|
-
s.specification_version =
|
41
|
+
s.specification_version = 4
|
41
42
|
|
42
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
44
|
s.add_runtime_dependency(%q<rack>, [">= 0"])
|
@@ -58,6 +58,17 @@ class TestRackSuperfeedr < Test::Unit::TestCase
|
|
58
58
|
|
59
59
|
context "Without Callbacks" do
|
60
60
|
|
61
|
+
context "Listing" do
|
62
|
+
should "yield a list of subscriptions" do
|
63
|
+
body, success, response = Rack::Superfeedr.subscribe('http://push-pub.appspot.com/feed', '12345')
|
64
|
+
success || flunk("Could not subscribe")
|
65
|
+
body, success, response = Rack::Superfeedr.list
|
66
|
+
success || flunk("Could not list #{body}")
|
67
|
+
hash = JSON.parse body
|
68
|
+
hash["subscriptions"] || flunk("List empty")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
61
72
|
context "Subscribing" do
|
62
73
|
|
63
74
|
should "yield true with a simple subscribe" do
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-superfeedr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- julien51
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rack
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,23 +27,22 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: nokogiri
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
33
|
+
version: !binary |-
|
34
|
+
MS42LjE=
|
38
35
|
type: :runtime
|
39
36
|
prerelease: false
|
40
37
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
39
|
- - ! '>='
|
44
40
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
41
|
+
version: !binary |-
|
42
|
+
MS42LjE=
|
46
43
|
- !ruby/object:Gem::Dependency
|
47
44
|
name: shoulda
|
48
45
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
46
|
requirements:
|
51
47
|
- - ! '>='
|
52
48
|
- !ruby/object:Gem::Version
|
@@ -54,7 +50,6 @@ dependencies:
|
|
54
50
|
type: :development
|
55
51
|
prerelease: false
|
56
52
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
53
|
requirements:
|
59
54
|
- - ! '>='
|
60
55
|
- !ruby/object:Gem::Version
|
@@ -62,7 +57,6 @@ dependencies:
|
|
62
57
|
- !ruby/object:Gem::Dependency
|
63
58
|
name: turn
|
64
59
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
60
|
requirements:
|
67
61
|
- - ! '>='
|
68
62
|
- !ruby/object:Gem::Version
|
@@ -70,7 +64,6 @@ dependencies:
|
|
70
64
|
type: :development
|
71
65
|
prerelease: false
|
72
66
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
67
|
requirements:
|
75
68
|
- - ! '>='
|
76
69
|
- !ruby/object:Gem::Version
|
@@ -78,39 +71,38 @@ dependencies:
|
|
78
71
|
- !ruby/object:Gem::Dependency
|
79
72
|
name: bundler
|
80
73
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
74
|
requirements:
|
83
75
|
- - ! '>='
|
84
76
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
77
|
+
version: !binary |-
|
78
|
+
MS4wLjA=
|
86
79
|
type: :development
|
87
80
|
prerelease: false
|
88
81
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
82
|
requirements:
|
91
83
|
- - ! '>='
|
92
84
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
85
|
+
version: !binary |-
|
86
|
+
MS4wLjA=
|
94
87
|
- !ruby/object:Gem::Dependency
|
95
88
|
name: jeweler
|
96
89
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
90
|
requirements:
|
99
91
|
- - ! '>='
|
100
92
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
93
|
+
version: !binary |-
|
94
|
+
MS42LjQ=
|
102
95
|
type: :development
|
103
96
|
prerelease: false
|
104
97
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
98
|
requirements:
|
107
99
|
- - ! '>='
|
108
100
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
101
|
+
version: !binary |-
|
102
|
+
MS42LjQ=
|
110
103
|
- !ruby/object:Gem::Dependency
|
111
104
|
name: thin
|
112
105
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
106
|
requirements:
|
115
107
|
- - ! '>='
|
116
108
|
- !ruby/object:Gem::Version
|
@@ -118,7 +110,6 @@ dependencies:
|
|
118
110
|
type: :development
|
119
111
|
prerelease: false
|
120
112
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
113
|
requirements:
|
123
114
|
- - ! '>='
|
124
115
|
- !ruby/object:Gem::Version
|
@@ -147,29 +138,25 @@ files:
|
|
147
138
|
homepage: http://rubygems.org/gems/rack-superfeedr
|
148
139
|
licenses:
|
149
140
|
- MIT
|
141
|
+
metadata: {}
|
150
142
|
post_install_message:
|
151
143
|
rdoc_options: []
|
152
144
|
require_paths:
|
153
145
|
- lib
|
154
146
|
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
-
none: false
|
156
147
|
requirements:
|
157
148
|
- - ! '>='
|
158
149
|
- !ruby/object:Gem::Version
|
159
150
|
version: '0'
|
160
|
-
segments:
|
161
|
-
- 0
|
162
|
-
hash: 4382464025338648913
|
163
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
152
|
requirements:
|
166
153
|
- - ! '>='
|
167
154
|
- !ruby/object:Gem::Version
|
168
155
|
version: '0'
|
169
156
|
requirements: []
|
170
157
|
rubyforge_project:
|
171
|
-
rubygems_version:
|
158
|
+
rubygems_version: 2.4.6
|
172
159
|
signing_key:
|
173
|
-
specification_version:
|
160
|
+
specification_version: 4
|
174
161
|
summary: A gem that provides a rack middleware to interract with Superfeedr's API.
|
175
162
|
test_files: []
|