Skip to content

Commit 0753ef2

Browse files
committed
Add atomp parser.
1 parent 8a34e65 commit 0753ef2

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# encoding: utf-8
2+
3+
require 'faraday'
4+
5+
module Github
6+
class Response::AtomParser < Response
7+
define_parser do |body|
8+
require 'rss'
9+
RSS::Parser.parse(body)
10+
end
11+
12+
def initialize(app, options = {})
13+
super(app, options.merge(content_type: /(\batom|\brss)/))
14+
end
15+
16+
def on_complete(env)
17+
if parse_body?(env)
18+
process_body(env)
19+
end
20+
end
21+
end
22+
end

0 commit comments

Comments
 (0)