superfeedr_engine 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTRhYWFmNzUxMGI0MTU3YmUwMWZiZDQzYTVjZmE1ZWE2ODA1ZTIzNQ==
5
- data.tar.gz: !binary |-
6
- ZWM1NjgyYTc3ZWVlYTIyNGE3ZjY4ZDc3ZTA2MGExZDI2OWEzMWFmNw==
2
+ SHA1:
3
+ metadata.gz: 6c41a146f01127073bc4fb5b8a3761abcb57fd4e
4
+ data.tar.gz: 40cb80b21ebb748b7f5cbfa2494d1f8dd784c3b4
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzVlNTI3MzQ1Y2MyOWZhNzVmZmJiYjAxYTdlMDNhZGRlMDY1MTg3ZTAyMmZl
10
- YTAxMjVmMTUzMzY4NWQ3ZWI4ZGJiMjE3ZTg2NjlmNzIyOGZmNmZiNWQ4NmEx
11
- ZmU0YzY1MDYwZmUxOWUzNmFjYzhlNjEwZjdlOTBhMDNiNWZiYzI=
12
- data.tar.gz: !binary |-
13
- NmQ5MzNjZTg3ZTVlOTBkZTQ0OGY1YTAyOGY3N2M2NmQxZjNlOWY0MTVmN2M0
14
- YzBiMjU5Y2RkN2EzOTM5YWY4YzhkOTQxMTVlMmI3Nzk4ZDk3OTRiMDNjZjJh
15
- M2UzYTBkOTBiYWRjODZiY2ZiNjE0M2EyNDEyZmY2NjRiM2Q3MWQ=
6
+ metadata.gz: fe8a90c441db5ff74d41adfb62aa3863ea683b58ae2f99f26c76bbcf42b7bf87cfc165a9246b979a6a1ec3407d929bb075d1d98a431906208ed80d9ba972bd56
7
+ data.tar.gz: c542e203a3136570559ace72c24e9892e3c176edb3fcc8911b71a354bf37c94ded604b4b07e3bff6906a3f86d1b174e1f97feba25c9522935305cccab5f77037
@@ -1,4 +1,4 @@
1
- require 'digest/hmac'
1
+ require 'openssl'
2
2
  require_dependency "superfeedr_engine/application_controller"
3
3
 
4
4
  module SuperfeedrEngine
@@ -11,13 +11,14 @@ module SuperfeedrEngine
11
11
  else
12
12
  algo, hash = signature.split('=')
13
13
  if algo != "sha1"
14
- Rails.logger.error("Unknown signature mechanism. Ignored paylod for #{params[:feed_id]}. Use retrieve if missing.")
14
+ Rails.logger.error("Unknown signature mechanism #{algo}. Ignored paylod for #{params[:feed_id]}. Use retrieve if missing.")
15
15
  else
16
16
  feed = feed_klass.find(params[:feed_id])
17
17
  if !feed
18
18
  Rails.logger.error("Unknown notification for #{params[:feed_id]}.")
19
19
  else
20
- computed = Digest::HMAC.hexdigest(request.raw_post, feed.secret, Digest::SHA1)
20
+ digest = OpenSSL::Digest.new(algo)
21
+ computed = OpenSSL::HMAC.hexdigest(digest, feed.secret, request.raw_post)
21
22
  if computed == hash
22
23
  feed.notified(params)
23
24
  else
@@ -58,5 +58,24 @@ module SuperfeedrEngine
58
58
  super(opts)
59
59
  end
60
60
 
61
+ def self.search(query, opts = {})
62
+ opts.merge!({
63
+ format: 'json' # Force the use of the JSON
64
+ });
65
+
66
+ super(query, opts)
67
+ end
68
+
69
+ def self.replay(object, opts = {})
70
+ raise "Missing url method or property on #{object}" unless object.class.method_defined? :url
71
+ raise "Missing id method or property on #{object}" unless object.class.method_defined? :id
72
+
73
+ raise "#{object}#url needs to be a URL" unless valid?(object.url)
74
+ raise "#{object}#id needs to not empty" if object.id.to_s.empty?
75
+
76
+ super(object.url, object.id, opts)
77
+ end
78
+
79
+
61
80
  end
62
81
  end
@@ -1,3 +1,3 @@
1
1
  module SuperfeedrEngine
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superfeedr_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - superfeedr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
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
26
  version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack-superfeedr
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.4.3
33
+ version: 0.4.4
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: 0.4.3
40
+ version: 0.4.4
41
41
  description: SuperfeedrEngine is a Rails engine to consume RSS in a Rails application
42
42
  via Superfeedr. It handles routing, subscriptions, unsubscriptions, retrieval and
43
43
  notifications.
@@ -107,17 +107,17 @@ require_paths:
107
107
  - lib
108
108
  required_ruby_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ! '>='
110
+ - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.9.3
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.4.6
120
+ rubygems_version: 2.4.5
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: A Rails engine to consume RSS in a Rails application via Superfeedr.