feedjira 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dangerfile +1 -1
- data/lib/feedjira/feed.rb +1 -1
- data/lib/feedjira/parser/atom_feed_burner.rb +4 -2
- data/lib/feedjira/version.rb +1 -1
- data/spec/feedjira/parser/atom_feed_burner_spec.rb +24 -0
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f71c15f42f104567957f41388dacabbe03f3f8
|
4
|
+
data.tar.gz: 612bc157d51985da2929ca76d16c0032b830f8f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb2b56c274172aaf8ded5524e6ef052c0658a125e020878542c5bad24f8b6198e8807b514632bd983373c4721ff99e81190cc41f28bbe9fc8f3f05489d6876b
|
7
|
+
data.tar.gz: b5ec34dbf6508a8b083fa3a79cd99a951aed26f352d3dbe853f85aaabb79b50ced57bcf5fd70c6d5e0b8e644d33bd3bfd0ab4d92074fe276a832d55c24a7fb8d
|
data/Dangerfile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
commit_lint.check
|
1
|
+
commit_lint.check(warn: :all)
|
data/lib/feedjira/feed.rb
CHANGED
@@ -81,7 +81,7 @@ module Feedjira
|
|
81
81
|
def connection(url)
|
82
82
|
Faraday.new(url: url, headers: headers, request: request_options) do |conn|
|
83
83
|
conn.use FaradayMiddleware::FollowRedirects, limit: Feedjira.follow_redirect_limit
|
84
|
-
conn.adapter
|
84
|
+
conn.adapter Faraday.default_adapter
|
85
85
|
end
|
86
86
|
end
|
87
87
|
# rubocop:enable LineLength
|
@@ -17,6 +17,8 @@ module Feedjira
|
|
17
17
|
elements :"atom10:link", as: :hubs, value: :href, with: { rel: 'hub' }
|
18
18
|
elements :entry, as: :entries, class: AtomFeedBurnerEntry
|
19
19
|
|
20
|
+
attr_writer :url, :feed_url
|
21
|
+
|
20
22
|
def self.able_to_parse?(xml)
|
21
23
|
((/Atom/ =~ xml) && (/feedburner/ =~ xml) && !(/\<rss|\<rdf/ =~ xml)) || false # rubocop:disable Metrics/LineLength
|
22
24
|
end
|
@@ -24,13 +26,13 @@ module Feedjira
|
|
24
26
|
# Feed url is <link> with type="text/html" if present,
|
25
27
|
# <link> with no type attribute otherwise
|
26
28
|
def url
|
27
|
-
@url_text_html || url_notype
|
29
|
+
@url || @url_text_html || @url_notype
|
28
30
|
end
|
29
31
|
|
30
32
|
# Feed feed_url is <link> with type="application/atom+xml" if present,
|
31
33
|
# <atom10:link> with type="application/atom+xml" otherwise
|
32
34
|
def feed_url
|
33
|
-
@feed_url_link || feed_url_atom10_link
|
35
|
+
@feed_url || @feed_url_link || @feed_url_atom10_link
|
34
36
|
end
|
35
37
|
|
36
38
|
def self.preprocess(xml)
|
data/lib/feedjira/version.rb
CHANGED
@@ -54,6 +54,18 @@ module Feedjira::Parser
|
|
54
54
|
it 'should parse entries' do
|
55
55
|
expect(@feed.entries.size).to eq 5
|
56
56
|
end
|
57
|
+
|
58
|
+
it 'should change url' do
|
59
|
+
new_url = 'http://some.url.com'
|
60
|
+
expect { @feed.url = new_url }.not_to raise_error
|
61
|
+
expect(@feed.url).to eq new_url
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should change feed_url' do
|
65
|
+
new_url = 'http://some.url.com'
|
66
|
+
expect { @feed.feed_url = new_url }.not_to raise_error
|
67
|
+
expect(@feed.feed_url).to eq new_url
|
68
|
+
end
|
57
69
|
end
|
58
70
|
|
59
71
|
describe 'parsing alternate style feeds' do
|
@@ -85,6 +97,18 @@ module Feedjira::Parser
|
|
85
97
|
it 'should parse entries' do
|
86
98
|
expect(@feed.entries.size).to eq 3
|
87
99
|
end
|
100
|
+
|
101
|
+
it 'should change url' do
|
102
|
+
new_url = 'http://some.url.com'
|
103
|
+
expect { @feed.url = new_url }.not_to raise_error
|
104
|
+
expect(@feed.url).to eq new_url
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'should change feed_url' do
|
108
|
+
new_url = 'http://some.url.com'
|
109
|
+
expect { @feed.feed_url = new_url }.not_to raise_error
|
110
|
+
expect(@feed.feed_url).to eq new_url
|
111
|
+
end
|
88
112
|
end
|
89
113
|
|
90
114
|
describe 'preprocessing' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedjira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Dix
|
@@ -11,104 +11,104 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-03-
|
14
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '0.9'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0.9'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: faraday_middleware
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '0.9'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0.9'
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: loofah
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '2.0'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- -
|
55
|
+
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '2.0'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sax-machine
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
|
-
- -
|
62
|
+
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '1.0'
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '1.0'
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: danger
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ">="
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: danger-commit_lint
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
type: :development
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
|
-
- -
|
97
|
+
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: rspec
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- -
|
104
|
+
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
type: :development
|
108
108
|
prerelease: false
|
109
109
|
version_requirements: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
|
-
- -
|
111
|
+
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
- !ruby/object:Gem::Dependency
|
@@ -129,28 +129,28 @@ dependencies:
|
|
129
129
|
name: vcr
|
130
130
|
requirement: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- -
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
type: :development
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
|
-
- -
|
139
|
+
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: yard
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
145
145
|
requirements:
|
146
|
-
- - ~>
|
146
|
+
- - "~>"
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0.9'
|
149
149
|
type: :development
|
150
150
|
prerelease: false
|
151
151
|
version_requirements: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
|
-
- - ~>
|
153
|
+
- - "~>"
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0.9'
|
156
156
|
description:
|
@@ -159,10 +159,10 @@ executables: []
|
|
159
159
|
extensions: []
|
160
160
|
extra_rdoc_files: []
|
161
161
|
files:
|
162
|
-
- .gitignore
|
163
|
-
- .rspec
|
164
|
-
- .rubocop.yml
|
165
|
-
- .travis.yml
|
162
|
+
- ".gitignore"
|
163
|
+
- ".rspec"
|
164
|
+
- ".rubocop.yml"
|
165
|
+
- ".travis.yml"
|
166
166
|
- CHANGELOG.md
|
167
167
|
- Dangerfile
|
168
168
|
- Gemfile
|
@@ -272,17 +272,17 @@ require_paths:
|
|
272
272
|
- lib
|
273
273
|
required_ruby_version: !ruby/object:Gem::Requirement
|
274
274
|
requirements:
|
275
|
-
- -
|
275
|
+
- - ">="
|
276
276
|
- !ruby/object:Gem::Version
|
277
277
|
version: 1.9.3
|
278
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- -
|
280
|
+
- - ">="
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: '0'
|
283
283
|
requirements: []
|
284
284
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.
|
285
|
+
rubygems_version: 2.6.8
|
286
286
|
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: A feed fetching and parsing library
|