feedjira 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +10 -11
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -2
- data/lib/feedjira/parser/atom.rb +1 -1
- data/lib/feedjira/version.rb +1 -1
- data/spec/feedjira/parser/atom_spec.rb +60 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7c43633bb85f7aa16a1930ba863d404bee83de5365676c1df4600df5640d4d6
|
4
|
+
data.tar.gz: e910be45a7e47e55cec3d4d09e219d6d245834da7360d22338c6380e1bad42ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fbf835d1ae58a7a542fc37362e7c8d1fa9ab5ec435075da34f7a386aac5d0a2acda1e8d24f4138b50ca410582e5fec48409ecf6bcdf93cc2a6f8f6dee55882
|
7
|
+
data.tar.gz: 0ec37861fc3fac82ce93a41df4b84a3800a3a74090f17b5b6322e35c1189e63d83671d0deeca6847bb25803118f9e406c067b1e1363f863edce788b9b985130d
|
data/.rubocop_todo.yml
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 400`
|
3
|
-
# on 2025-
|
3
|
+
# on 2025-09-02 06:40:19 UTC using RuboCop version 1.80.1.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 12
|
10
|
-
# Configuration parameters:
|
11
|
-
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
10
|
+
# Configuration parameters: IgnoredGems, OnlyFor.
|
12
11
|
Bundler/GemComment:
|
13
12
|
Exclude:
|
14
13
|
- 'Gemfile'
|
@@ -75,7 +74,7 @@ Layout/SingleLineBlockChain:
|
|
75
74
|
- 'spec/feedjira/feed_utilities_spec.rb'
|
76
75
|
- 'spec/feedjira/parser/atom_feed_burner_spec.rb'
|
77
76
|
|
78
|
-
# Offense count:
|
77
|
+
# Offense count: 364
|
79
78
|
# Configuration parameters: Only, Ignore.
|
80
79
|
Lint/ConstantResolution:
|
81
80
|
Exclude:
|
@@ -154,6 +153,12 @@ Lint/NumberConversion:
|
|
154
153
|
Exclude:
|
155
154
|
- 'lib/feedjira/parser/podlove_chapter.rb'
|
156
155
|
|
156
|
+
# Offense count: 1
|
157
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
158
|
+
Metrics/ModuleLength:
|
159
|
+
Exclude:
|
160
|
+
- 'spec/feedjira/parser/atom_spec.rb'
|
161
|
+
|
157
162
|
# Offense count: 1
|
158
163
|
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
|
159
164
|
# AllowedMethods: call
|
@@ -285,7 +290,7 @@ Style/InlineComment:
|
|
285
290
|
- 'spec/feedjira/feed_utilities_spec.rb'
|
286
291
|
- 'spec/feedjira/preprocessor_spec.rb'
|
287
292
|
|
288
|
-
# Offense count:
|
293
|
+
# Offense count: 890
|
289
294
|
# This cop supports safe autocorrection (--autocorrect).
|
290
295
|
# Configuration parameters: IgnoreMacros, AllowedMethods, AllowedPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, AllowParenthesesInStringInterpolation, EnforcedStyle.
|
291
296
|
# SupportedStyles: require_parentheses, omit_parentheses
|
@@ -389,9 +394,3 @@ Style/StringHashKeys:
|
|
389
394
|
Style/SuperArguments:
|
390
395
|
Exclude:
|
391
396
|
- 'lib/feedjira/feed_utilities.rb'
|
392
|
-
|
393
|
-
# Offense count: 1
|
394
|
-
# This cop supports safe autocorrection (--autocorrect).
|
395
|
-
Style/SuperWithArgsParentheses:
|
396
|
-
Exclude:
|
397
|
-
- 'lib/feedjira/feed_utilities.rb'
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -4,10 +4,10 @@ source "https://rubygems.org/"
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem "faraday", "~> 2.
|
7
|
+
gem "faraday", "~> 2.13.4"
|
8
8
|
gem "pry", "~> 0.15.0"
|
9
9
|
gem "rspec", "~> 3.13.0"
|
10
|
-
gem "rubocop", "~> 1.
|
10
|
+
gem "rubocop", "~> 1.80.0"
|
11
11
|
gem "rubocop-performance", "~> 1.25.0"
|
12
12
|
gem "rubocop-rake", "~> 0.7.1"
|
13
13
|
gem "rubocop-rspec", "~> 3.6.0"
|
data/lib/feedjira/parser/atom.rb
CHANGED
@@ -17,7 +17,7 @@ module Feedjira
|
|
17
17
|
element :icon
|
18
18
|
|
19
19
|
def self.able_to_parse?(xml)
|
20
|
-
%r{<feed[^>]+xmlns\s?=\s?["'](
|
20
|
+
%r{<feed[^>]+xmlns\s?=\s?["'](https?://www\.w3\.org/2005/Atom|http://purl\.org/atom/ns\#)["'][^>]*>} =~ xml
|
21
21
|
end
|
22
22
|
|
23
23
|
def url
|
data/lib/feedjira/version.rb
CHANGED
@@ -4,21 +4,72 @@ require "spec_helper"
|
|
4
4
|
|
5
5
|
module Feedjira
|
6
6
|
module Parser
|
7
|
-
describe "#
|
8
|
-
it "returns
|
9
|
-
|
7
|
+
describe "#able_to_parse?" do
|
8
|
+
it "returns false if the xmlns value is not the expected value" do
|
9
|
+
xml = '<feed xmlns="http://www.example.org/"></feed>'
|
10
|
+
expect(Atom).not_to be_able_to_parse(xml)
|
10
11
|
end
|
11
12
|
|
12
|
-
it "returns false
|
13
|
-
|
13
|
+
it "returns false if there is no xmlns value" do
|
14
|
+
xml = "<feed></feed>"
|
15
|
+
expect(Atom).not_to be_able_to_parse(xml)
|
14
16
|
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
+
describe "with a w3.org URL present" do
|
19
|
+
it "returns true if contains the expected w3.org URL as xmlns value" do
|
20
|
+
xml = '<feed xmlns="http://www.w3.org/2005/Atom"></feed>'
|
21
|
+
expect(Atom).to be_able_to_parse(xml)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "returns true if contains the HTTPS variant of the expected w3.org URL as xmlns value" do
|
25
|
+
xml = '<feed xmlns="https://www.w3.org/2005/Atom"></feed>'
|
26
|
+
expect(Atom).to be_able_to_parse(xml)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "returns true if contains the expected xmlns value with single quotes" do
|
30
|
+
xml = "<feed xmlns='http://www.w3.org/2005/Atom'></feed>"
|
31
|
+
expect(Atom).to be_able_to_parse(xml)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "returns true with whitespace around the equals sign" do
|
35
|
+
xml = '<feed xmlns = "http://www.w3.org/2005/Atom"></feed>'
|
36
|
+
expect(Atom).to be_able_to_parse(xml)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "with a purl.org URL present" do
|
41
|
+
it "returns true if contains the expected purl.org URL as xmlns value" do
|
42
|
+
xml = '<feed xmlns="http://purl.org/atom/ns#"></feed>'
|
43
|
+
expect(Atom).to be_able_to_parse(xml)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "returns true if contains the expected xmlns value with single quotes" do
|
47
|
+
xml = "<feed xmlns='http://purl.org/atom/ns#'></feed>"
|
48
|
+
expect(Atom).to be_able_to_parse(xml)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "returns true with whitespace around the equals sign" do
|
52
|
+
xml = '<feed xmlns = "http://purl.org/atom/ns#"></feed>'
|
53
|
+
expect(Atom).to be_able_to_parse(xml)
|
54
|
+
end
|
18
55
|
end
|
19
56
|
|
20
|
-
|
21
|
-
|
57
|
+
context "with full sample feeds" do
|
58
|
+
it "returns true for an atom feed" do
|
59
|
+
expect(Atom).to be_able_to_parse(sample_atom_feed)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "returns false for an rdf feed" do
|
63
|
+
expect(Atom).not_to be_able_to_parse(sample_rdf_feed)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "returns false for an rss feedburner feed" do
|
67
|
+
expect(Atom).not_to be_able_to_parse(sample_rss_feed_burner_feed)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "returns true for an atom feed that has line breaks in between attributes in the <feed> node" do
|
71
|
+
expect(Atom).to be_able_to_parse(sample_atom_feed_line_breaks)
|
72
|
+
end
|
22
73
|
end
|
23
74
|
end
|
24
75
|
|