rack-superfeedr 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rack-superfeedr.rb +17 -14
- data/rack-superfeedr.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/rack-superfeedr.rb
CHANGED
@@ -63,7 +63,7 @@ module Rack
|
|
63
63
|
opts[:params][:retrieve] = true
|
64
64
|
end
|
65
65
|
|
66
|
-
opts[:params][:'hub.verify'] = @params[:async] ? 'async' : 'sync'
|
66
|
+
opts[:params][:'hub.verify'] = @params[:async] ? 'async' : 'sync'
|
67
67
|
|
68
68
|
response = ::Typhoeus::Request.post(endpoint, opts)
|
69
69
|
|
@@ -72,21 +72,24 @@ module Rack
|
|
72
72
|
@params[:async] && response.code == 202 || response.code == 204 # We return true to indicate the status.
|
73
73
|
else
|
74
74
|
|
75
|
-
if
|
76
|
-
content = Nokogiri.XML(response.body)
|
77
|
-
else
|
78
|
-
content = JSON.parse(response.body)
|
75
|
+
if response.code == 200
|
79
76
|
|
77
|
+
if @params[:format] != "json"
|
78
|
+
content = Nokogiri.XML(response.body)
|
79
|
+
else
|
80
|
+
content = JSON.parse(response.body)
|
81
|
+
end
|
82
|
+
# Let's now send that data back to the user.
|
83
|
+
if defined? Hashie::Mash
|
84
|
+
info = Hashie::Mash.new(req: req, body: body)
|
85
|
+
end
|
86
|
+
if !@callback.call(content, feed_id, info)
|
87
|
+
# We need to unsubscribe the user
|
88
|
+
end
|
89
|
+
true
|
90
|
+
else
|
91
|
+
false
|
80
92
|
end
|
81
|
-
# Let's now send that data back to the user.
|
82
|
-
if defined? Hashie::Mash
|
83
|
-
info = Hashie::Mash.new(req: req, body: body)
|
84
|
-
end
|
85
|
-
if !@callback.call(content, feed_id, info)
|
86
|
-
# We need to unsubscribe the user
|
87
|
-
end
|
88
|
-
|
89
|
-
true
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
data/rack-superfeedr.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-superfeedr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -143,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
segments:
|
145
145
|
- 0
|
146
|
-
hash:
|
146
|
+
hash: 48070522357503993
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|