feedjira 2.0.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/.rubocop.yml +15 -0
- data/.travis.yml +31 -12
- data/CHANGELOG.md +34 -1
- data/Dangerfile +1 -0
- data/Gemfile +2 -1
- data/LICENSE +1 -1
- data/README.md +210 -7
- data/Rakefile +11 -1
- data/feedjira.gemspec +17 -14
- data/fixtures/vcr_cassettes/fetch_failure.yml +62 -0
- data/fixtures/vcr_cassettes/parse_error.yml +222 -0
- data/fixtures/vcr_cassettes/success.yml +281 -0
- data/lib/feedjira/configuration.rb +76 -0
- data/lib/feedjira/core_ext/date.rb +3 -1
- data/lib/feedjira/core_ext/string.rb +2 -1
- data/lib/feedjira/core_ext/time.rb +24 -17
- data/lib/feedjira/core_ext.rb +3 -3
- data/lib/feedjira/date_time_utilities/date_time_epoch_parser.rb +13 -0
- data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +24 -0
- data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +34 -0
- data/lib/feedjira/date_time_utilities.rb +32 -0
- data/lib/feedjira/feed.rb +89 -62
- data/lib/feedjira/feed_entry_utilities.rb +20 -19
- data/lib/feedjira/feed_utilities.rb +37 -22
- data/lib/feedjira/parser/atom.rb +10 -8
- data/lib/feedjira/parser/atom_entry.rb +11 -13
- data/lib/feedjira/parser/atom_feed_burner.rb +27 -10
- data/lib/feedjira/parser/atom_feed_burner_entry.rb +12 -14
- data/lib/feedjira/parser/atom_youtube.rb +21 -0
- data/lib/feedjira/parser/atom_youtube_entry.rb +30 -0
- data/lib/feedjira/parser/google_docs_atom.rb +8 -7
- data/lib/feedjira/parser/google_docs_atom_entry.rb +13 -11
- data/lib/feedjira/parser/itunes_rss.rb +41 -22
- data/lib/feedjira/parser/itunes_rss_category.rb +39 -0
- data/lib/feedjira/parser/itunes_rss_item.rb +32 -20
- data/lib/feedjira/parser/itunes_rss_owner.rb +4 -4
- data/lib/feedjira/parser/podlove_chapter.rb +22 -0
- data/lib/feedjira/parser/rss.rb +11 -8
- data/lib/feedjira/parser/rss_entry.rb +17 -21
- data/lib/feedjira/parser/rss_feed_burner.rb +5 -6
- data/lib/feedjira/parser/rss_feed_burner_entry.rb +24 -28
- data/lib/feedjira/parser/rss_image.rb +15 -0
- data/lib/feedjira/parser.rb +1 -1
- data/lib/feedjira/preprocessor.rb +4 -2
- data/lib/feedjira/version.rb +1 -1
- data/lib/feedjira.rb +15 -0
- data/spec/feedjira/configuration_spec.rb +25 -0
- data/spec/feedjira/date_time_utilities_spec.rb +47 -0
- data/spec/feedjira/feed_entry_utilities_spec.rb +23 -19
- data/spec/feedjira/feed_spec.rb +140 -75
- data/spec/feedjira/feed_utilities_spec.rb +83 -63
- data/spec/feedjira/parser/atom_entry_spec.rb +54 -34
- data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +27 -20
- data/spec/feedjira/parser/atom_feed_burner_spec.rb +87 -30
- data/spec/feedjira/parser/atom_spec.rb +50 -48
- data/spec/feedjira/parser/atom_youtube_entry_spec.rb +86 -0
- data/spec/feedjira/parser/atom_youtube_spec.rb +43 -0
- data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +5 -4
- data/spec/feedjira/parser/google_docs_atom_spec.rb +6 -6
- data/spec/feedjira/parser/itunes_rss_item_spec.rb +49 -29
- data/spec/feedjira/parser/itunes_rss_owner_spec.rb +10 -9
- data/spec/feedjira/parser/itunes_rss_spec.rb +87 -30
- data/spec/feedjira/parser/podlove_chapter_spec.rb +37 -0
- data/spec/feedjira/parser/rss_entry_spec.rb +50 -33
- data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +55 -33
- data/spec/feedjira/parser/rss_feed_burner_spec.rb +31 -26
- data/spec/feedjira/parser/rss_spec.rb +56 -24
- data/spec/feedjira/preprocessor_spec.rb +11 -3
- data/spec/sample_feeds/AmazonWebServicesBlog.xml +797 -797
- data/spec/sample_feeds/AtomEscapedHTMLInPreTag.xml +13 -0
- data/spec/sample_feeds/CRE.xml +5849 -0
- data/spec/sample_feeds/FeedBurnerXHTML.xml +400 -400
- data/spec/sample_feeds/GiantRobotsSmashingIntoOtherGiantRobots.xml +682 -0
- data/spec/sample_feeds/ITunesWithSingleQuotedAttributes.xml +67 -0
- data/spec/sample_feeds/InvalidDateFormat.xml +20 -0
- data/spec/sample_feeds/PaulDixExplainsNothing.xml +175 -175
- data/spec/sample_feeds/PaulDixExplainsNothingAlternate.xml +175 -175
- data/spec/sample_feeds/PaulDixExplainsNothingFirstEntryContent.xml +16 -16
- data/spec/sample_feeds/PaulDixExplainsNothingWFW.xml +174 -174
- data/spec/sample_feeds/TenderLovemaking.xml +12 -2
- data/spec/sample_feeds/TrotterCashionHome.xml +611 -611
- data/spec/sample_feeds/TypePadNews.xml +368 -368
- data/spec/sample_feeds/itunes.xml +31 -2
- data/spec/sample_feeds/pet_atom.xml +229 -229
- data/spec/sample_feeds/youtube_atom.xml +395 -0
- data/spec/sample_feeds.rb +31 -21
- data/spec/spec_helper.rb +6 -0
- metadata +132 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b8cec1f08ed12a497f98c7e4b622f8ab06b688a75e968175dd985ad93cfd4bd
|
4
|
+
data.tar.gz: 1015179ce20e86b0a02253411e02e9b78bf0294c8f18a8e2fba3fc92c5c04b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba84e098bed14b11cf07a816500ff853e3337039bce117abf1bedc17d28d5bc3072d39bb43f747580f8c48de57417df23284fb0d71eb1d79d9f35896ae5c2f5c
|
7
|
+
data.tar.gz: 8ab31a4eb8427f70d5f26f817c3296a5ab5ea650b1885d4ac5f9518cb7c85fc852ccd29923b29c2f3300f67c6efa558de44a2f4290314ba9b206fe428b6ca13e
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,18 +1,37 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
branches:
|
6
|
-
only:
|
7
|
-
- master
|
3
|
+
cache: bundler
|
8
4
|
|
9
5
|
rvm:
|
10
|
-
- 1
|
11
|
-
- 2.
|
12
|
-
- 2.
|
13
|
-
-
|
6
|
+
- 2.1
|
7
|
+
- 2.2
|
8
|
+
- 2.3
|
9
|
+
- jruby-9
|
10
|
+
- ruby-head
|
14
11
|
|
15
12
|
env:
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
- HANDLER=nokogiri
|
14
|
+
- HANDLER=ox
|
15
|
+
- HANDLER=oga
|
16
|
+
|
17
|
+
matrix:
|
18
|
+
fast_finish: true
|
19
|
+
allow_failures:
|
20
|
+
- rvm: jruby-9
|
21
|
+
- rvm: ruby-head
|
22
|
+
exclude:
|
23
|
+
- rvm: jruby-9
|
24
|
+
env: HANDLER=ox
|
25
|
+
|
26
|
+
before_install:
|
27
|
+
- gem update bundler
|
28
|
+
|
29
|
+
script:
|
30
|
+
- bundle exec rake
|
31
|
+
- bundle exec danger
|
32
|
+
|
33
|
+
notifications:
|
34
|
+
email: false
|
35
|
+
webhooks:
|
36
|
+
urls:
|
37
|
+
secure: XjoUz2rPXFHnitw//jN4qA92jq7bH19iOI/5KnuptLzz5HrWq1VAXxAr/Fh0KxYZT29G/9i5szaHX1QacfO7he4xa2tZKudRL70Dw3KRLgqLi70G6kFuZYlh+MgMHZy6KwZ/4/250wO31fpv24PCb2M56iTsev2g2uporeobO0Q=
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,43 @@
|
|
1
1
|
# Feedjira Changelog
|
2
2
|
|
3
|
+
## 2.2.0
|
4
|
+
|
5
|
+
* General
|
6
|
+
* Backport support for parsing new iTunes podcasting tags
|
7
|
+
|
8
|
+
## 2.1.4
|
9
|
+
|
10
|
+
* Bug fixes
|
11
|
+
* Prevent errors when a feed has multiple dates and some are unparseable
|
12
|
+
|
13
|
+
## 2.1.3
|
14
|
+
|
15
|
+
* Enhancements
|
16
|
+
* No longer log date parsing errors as warnings, they are now debug messages
|
17
|
+
|
18
|
+
## 2.1.1
|
19
|
+
|
20
|
+
configurable logging and parsing
|
21
|
+
|
22
|
+
## 2.1.0
|
23
|
+
|
24
|
+
* Enhancements
|
25
|
+
* AtomYoutube is now a supported parser [#337][] (@jfiorato)
|
26
|
+
* Oga parsing is now supported [#331][] (@krasnoukhov)
|
27
|
+
* DateTime Handler now supports localized dates [#313][] (@PascalTurbo)
|
28
|
+
* RSS now supports language attribute [#344][] (@PascalTurbo)
|
29
|
+
* ITunesRSS added support for:
|
30
|
+
* `ttl` and `last_built` [#343][] (@sferik)
|
31
|
+
* `itunes_category` and `itunes_category_paths` [#329][] (@knu)
|
32
|
+
* `itunes_complete` [#328][] (@knu)
|
33
|
+
* single quoted attributes [#326][] (@sferik)
|
34
|
+
* Add image attribute [#349][] (@sferik)
|
35
|
+
|
3
36
|
## 2.0.0
|
4
37
|
|
5
38
|
* General
|
6
39
|
* Replaced curb with faraday
|
7
|
-
* Removed update
|
40
|
+
* Removed update functionality
|
8
41
|
|
9
42
|
## 1.6.0
|
10
43
|
|
data/Dangerfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
commit_lint.check(warn: :all)
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,217 @@
|
|
1
|
-
# Feedjira
|
1
|
+
# Feedjira
|
2
2
|
|
3
|
-
[travis-badge]
|
3
|
+
[![Build Status][travis-badge]][travis] [![Code Climate][code-climate-badge]][code-climate] [![Gitter][gitter-badge]][gitter]
|
4
|
+
|
5
|
+
[travis-badge]: https://travis-ci.org/feedjira/feedjira.svg?branch=master
|
4
6
|
[travis]: http://travis-ci.org/feedjira/feedjira
|
5
|
-
[code-climate-badge]: https://codeclimate.com/github/feedjira/feedjira.
|
7
|
+
[code-climate-badge]: https://codeclimate.com/github/feedjira/feedjira/badges/gpa.svg
|
6
8
|
[code-climate]: https://codeclimate.com/github/feedjira/feedjira
|
9
|
+
[gitter-badge]: https://badges.gitter.im/feedjira/feedjira.svg
|
10
|
+
[gitter]: https://gitter.im/feedjira/feedjira?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
|
7
11
|
|
8
12
|
Feedjira (formerly Feedzirra) is a Ruby library designed to fetch and parse
|
9
|
-
feeds as quickly as possible.
|
10
|
-
|
13
|
+
feeds as quickly as possible.
|
14
|
+
|
15
|
+
## Getting Started
|
16
|
+
|
17
|
+
Feedjira is tested with Ruby version 1.9.3 and 2.x so like any Ruby gem, the
|
18
|
+
first step is to install the gem:
|
19
|
+
|
20
|
+
```
|
21
|
+
$ gem install feedjira
|
22
|
+
```
|
23
|
+
|
24
|
+
Or add it to your Gemfile:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem "feedjira"
|
28
|
+
```
|
29
|
+
|
30
|
+
## Fetching and Parsing
|
31
|
+
|
32
|
+
For many users, the `fetch_and_parse` method is what they use Feedjira for. This
|
33
|
+
method takes a url and returns a Parser object:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
url = "http://feedjira.com/blog/feed.xml"
|
37
|
+
feed = Feedjira::Feed.fetch_and_parse(url)
|
38
|
+
# => #<Feedjira::Parser::Atom...>
|
39
|
+
```
|
40
|
+
|
41
|
+
These feed objects have both the meta data for a feed and an `entries`
|
42
|
+
collection that contains all the entries that were found:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
feed.title
|
46
|
+
# => "Feedjira Blog"
|
47
|
+
feed.url
|
48
|
+
# => "http://feedjira.com/blog"
|
49
|
+
feed.entries # returns an array of Entry objects
|
50
|
+
# => [<Feedjira::Feed::Entry ...>, <Feedjira::Feed::Entry ...>, ...]
|
51
|
+
```
|
52
|
+
|
53
|
+
These entry objects contain the data parsed from the feed XML:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
entry = feed.entries.first
|
57
|
+
entry.title
|
58
|
+
# => "Announcing verison 1.0"
|
59
|
+
entry.url
|
60
|
+
# => "http://feedjira.com/blog/2014-02-12-announcing-version-10.html"
|
61
|
+
```
|
62
|
+
|
63
|
+
## Just Parsing
|
64
|
+
|
65
|
+
The parsing functionality of Feedjira has been exposed so that it can be used in
|
66
|
+
isolation:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
xml = Faraday.get(url).body
|
70
|
+
feed = Feedjira::Feed.parse xml
|
71
|
+
feed.entries.first.title
|
72
|
+
# => "Announcing verison 1.0"
|
73
|
+
```
|
74
|
+
|
75
|
+
## Adding a feed parsing class
|
76
|
+
|
77
|
+
When determining which parser to use for a given XML document, the following
|
78
|
+
list of parser classes is used:
|
79
|
+
|
80
|
+
* `Feedjira::Parser::RSSFeedBurner`
|
81
|
+
* `Feedjira::Parser::GoogleDocsAtom`
|
82
|
+
* `Feedjira::Parser::AtomFeedBurner`
|
83
|
+
* `Feedjira::Parser::Atom`
|
84
|
+
* `Feedjira::Parser::ITunesRSS`
|
85
|
+
* `Feedjira::Parser::RSS`
|
86
|
+
|
87
|
+
You can insert your own parser at the front of this stack by calling
|
88
|
+
`add_feed_class`, like this:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
Feedjira::Feed.add_feed_class(MyAwesomeParser)
|
92
|
+
```
|
93
|
+
|
94
|
+
Now when you `fetch_and_parse`, `MyAwesomeParser` will be the first one to get a
|
95
|
+
chance to parse the feed.
|
96
|
+
|
97
|
+
If you have the XML and just want to provide a parser class for one parse, you
|
98
|
+
can specify that using `parse_with`:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
Feedjira::Feed.parse_with(MyAwesomeParser, xml)
|
102
|
+
```
|
103
|
+
|
104
|
+
## Adding attributes to all feeds types / all entries types
|
105
|
+
|
106
|
+
```ruby
|
107
|
+
# Add the generator attribute to all feed types
|
108
|
+
Feedjira::Feed.add_common_feed_element("generator")
|
109
|
+
Feedjira::Feed.fetch_and_parse("http://www.pauldix.net/atom.xml").generator
|
110
|
+
# => "TypePad"
|
111
|
+
```
|
112
|
+
|
113
|
+
## Adding attributes to only one class
|
114
|
+
|
115
|
+
If you want to add attributes for only one class you simply have to declare them
|
116
|
+
in the class
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
# Add some GeoRss information
|
120
|
+
class Feedjira::Parser::RSSEntry
|
121
|
+
element "georss:elevation", as: :elevation
|
122
|
+
end
|
123
|
+
|
124
|
+
# Fetch a feed containing GeoRss info and print them
|
125
|
+
url = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.atom"
|
126
|
+
Feedjira::Feed.fetch_and_parse(url).entries.each do |entry|
|
127
|
+
puts "Elevation: #{entry.elevation}"
|
128
|
+
end
|
129
|
+
```
|
130
|
+
|
131
|
+
## Configuration
|
132
|
+
|
133
|
+
#### Stripping whitespace from XML
|
134
|
+
|
135
|
+
Feedjira can be configured to strip all whitespace but defaults to lstrip only:
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
Feedjira.configure do |config|
|
139
|
+
config.strip_whitespace = true
|
140
|
+
end
|
141
|
+
```
|
142
|
+
|
143
|
+
#### Follow redirect limit
|
144
|
+
|
145
|
+
For fetching feeds, the follow redirect limit defaults to 3 but can be set:
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
Feedjira.configure do |config|
|
149
|
+
config.follow_redirect_limit = 5
|
150
|
+
end
|
151
|
+
```
|
152
|
+
|
153
|
+
#### Request timeout
|
154
|
+
|
155
|
+
The request timeout defaults to 30 but can be set:
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
Feedjira.configure do |config|
|
159
|
+
config.request_timeout = 45
|
160
|
+
end
|
161
|
+
```
|
162
|
+
|
163
|
+
#### User agent
|
164
|
+
|
165
|
+
The default user agent is "Feedjira #{Version}" but can be set:
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
Feedjira.configure do |config|
|
169
|
+
config.user_agent = "Awesome Feed Reader"
|
170
|
+
end
|
171
|
+
```
|
172
|
+
|
173
|
+
## Testing
|
174
|
+
|
175
|
+
Feedjira uses [faraday][] to perform requests, so testing Feedjira is really
|
176
|
+
about [stubbing out faraday requests][stub].
|
177
|
+
|
178
|
+
[faraday]: https://github.com/lostisland/faraday
|
179
|
+
[stub]: https://github.com/lostisland/faraday#using-faraday-for-testing
|
180
|
+
|
181
|
+
## Projects that use Feedjira
|
182
|
+
|
183
|
+
Feedjira is used in some awesome projects around the web - from RSS readers to
|
184
|
+
add-ons and everything in between. Here are some of them:
|
185
|
+
|
186
|
+
* [Feedbin][]: Feedbin bills itself as a fast, simple RSS reader that delivers a
|
187
|
+
great reading experience. It's a paid RSS reader that integrates with mobile
|
188
|
+
apps and it even has a fully featured API!
|
189
|
+
|
190
|
+
* [Stringer][]: Stringer is a self-hosted, anti-social RSS reader. It's an
|
191
|
+
open-source project that's easy to deploy to any host, there's even a
|
192
|
+
one-click button to deploy on Heroku.
|
193
|
+
|
194
|
+
* [BlogFeeder][]: BlogFeeder is a paid Shopify App that makes it easy for you to
|
195
|
+
import any external blog into your Shopify store. It helps improve your
|
196
|
+
store's SEO and keeps your blogs in sync, plus a lot more.
|
197
|
+
|
198
|
+
* [Feedbunch][]: Feedbunch is an open source feed reader built to fill the hole
|
199
|
+
left by Google Reader. It aims to support all features of Google Reader and
|
200
|
+
actually improve on others.
|
201
|
+
|
202
|
+
* [The Old Reader][old]: The Old Reader advertises as the ultimate social RSS
|
203
|
+
reader. It's free to start and also has a paid premium version. There's an API
|
204
|
+
and it integrates with many different mobile apps.
|
205
|
+
|
206
|
+
* [Solve for All][solve]: Solve for All combines search engine and feed parsing
|
207
|
+
while protecting your privacy. It's even extendable by the community!
|
11
208
|
|
12
|
-
[
|
209
|
+
[Feedbin]: https://feedbin.com/
|
210
|
+
[Stringer]: https://github.com/swanson/stringer
|
211
|
+
[BlogFeeder]: https://apps.shopify.com/blogfeeder
|
212
|
+
[Feedbunch]: https://github.com/amatriain/feedbunch
|
213
|
+
[old]: http://theoldreader.com/
|
214
|
+
[solve]: https://solveforall.com/
|
13
215
|
|
14
|
-
|
216
|
+
Note: to get your project on this list, simply [send an email](mailto:feedjira@gmail.com)
|
217
|
+
with your project's details.
|
data/Rakefile
CHANGED
@@ -1,7 +1,17 @@
|
|
1
1
|
require 'rspec/core/rake_task'
|
2
|
+
require 'rubocop/rake_task'
|
3
|
+
require 'yard'
|
2
4
|
|
3
5
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
4
6
|
t.verbose = false
|
5
7
|
end
|
6
8
|
|
7
|
-
|
9
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
10
|
+
t.options = ['--display-cop-names']
|
11
|
+
end
|
12
|
+
|
13
|
+
YARD::Rake::YardocTask.new do |t|
|
14
|
+
t.files = ['lib/**/*.rb', '-', 'LICENSE']
|
15
|
+
end
|
16
|
+
|
17
|
+
task default: [:spec, :rubocop]
|
data/feedjira.gemspec
CHANGED
@@ -2,27 +2,30 @@
|
|
2
2
|
require File.expand_path('../lib/feedjira/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
|
-
s.name = 'feedjira'
|
6
|
-
s.version = Feedjira::VERSION
|
7
|
-
s.license = 'MIT'
|
8
|
-
|
9
5
|
s.authors = ['Paul Dix', 'Julien Kirch', 'Ezekiel Templin', 'Jon Allured']
|
10
6
|
s.email = 'feedjira@gmail.com'
|
11
7
|
s.homepage = 'http://feedjira.com'
|
12
|
-
|
13
|
-
s.
|
14
|
-
s.
|
8
|
+
s.license = 'MIT'
|
9
|
+
s.name = 'feedjira'
|
10
|
+
s.platform = Gem::Platform::RUBY
|
11
|
+
s.summary = 'A feed fetching and parsing library'
|
12
|
+
s.version = Feedjira::VERSION
|
15
13
|
|
16
14
|
s.files = `git ls-files`.split("\n")
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
15
|
s.require_paths = ['lib']
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
17
|
|
20
|
-
s.
|
18
|
+
s.required_ruby_version = '>=1.9.3'
|
21
19
|
|
22
|
-
s.add_dependency '
|
23
|
-
s.add_dependency '
|
24
|
-
s.add_dependency '
|
25
|
-
s.add_dependency '
|
20
|
+
s.add_dependency 'faraday', '>= 0.9'
|
21
|
+
s.add_dependency 'faraday_middleware', '>= 0.9'
|
22
|
+
s.add_dependency 'loofah', '>= 2.0'
|
23
|
+
s.add_dependency 'sax-machine', '>= 1.0'
|
26
24
|
|
27
|
-
s.add_development_dependency '
|
25
|
+
s.add_development_dependency 'danger'
|
26
|
+
s.add_development_dependency 'danger-commit_lint'
|
27
|
+
s.add_development_dependency 'rspec'
|
28
|
+
s.add_development_dependency 'rubocop', '0.46'
|
29
|
+
s.add_development_dependency 'vcr'
|
30
|
+
s.add_development_dependency 'yard', '~> 0.9'
|
28
31
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.example.com/feed.xml
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 404
|
15
|
+
message:
|
16
|
+
headers:
|
17
|
+
cache-control:
|
18
|
+
- max-age=604800
|
19
|
+
content-type:
|
20
|
+
- text/html
|
21
|
+
date:
|
22
|
+
- Mon, 31 Oct 2016 02:29:13 GMT
|
23
|
+
etag:
|
24
|
+
- '"359670651+gzip"'
|
25
|
+
expires:
|
26
|
+
- Mon, 07 Nov 2016 02:29:13 GMT
|
27
|
+
last-modified:
|
28
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
29
|
+
server:
|
30
|
+
- ECS (oxr/83C7)
|
31
|
+
vary:
|
32
|
+
- Accept-Encoding
|
33
|
+
x-cache:
|
34
|
+
- HIT
|
35
|
+
x-ec-custom-error:
|
36
|
+
- '1'
|
37
|
+
content-length:
|
38
|
+
- '606'
|
39
|
+
connection:
|
40
|
+
- close
|
41
|
+
body:
|
42
|
+
encoding: ASCII-8BIT
|
43
|
+
string: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
\ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
|
45
|
+
charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
|
46
|
+
initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
|
47
|
+
#f0f0f2;\n margin: 0;\n padding: 0;\n font-family: \"Open
|
48
|
+
Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n
|
49
|
+
\ div {\n width: 600px;\n margin: 5em auto;\n padding:
|
50
|
+
50px;\n background-color: #fff;\n border-radius: 1em;\n }\n
|
51
|
+
\ a:link, a:visited {\n color: #38488f;\n text-decoration:
|
52
|
+
none;\n }\n @media (max-width: 700px) {\n body {\n background-color:
|
53
|
+
#fff;\n }\n div {\n width: auto;\n margin:
|
54
|
+
0 auto;\n border-radius: 0;\n padding: 1em;\n }\n
|
55
|
+
\ }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n
|
56
|
+
\ <p>This domain is established to be used for illustrative examples in
|
57
|
+
documents. You may use this\n domain in examples without prior coordination
|
58
|
+
or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
|
59
|
+
information...</a></p>\n</div>\n</body>\n</html>\n"
|
60
|
+
http_version:
|
61
|
+
recorded_at: Mon, 31 Oct 2016 02:29:13 GMT
|
62
|
+
recorded_with: VCR 3.0.3
|