feedjira 4.0.3 → 4.0.4
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/CHANGELOG.md +4 -0
- data/lib/feedjira/parser/itunes_rss.rb +2 -1
- data/lib/feedjira/version.rb +1 -1
- data/spec/feedjira/parser/itunes_rss_spec.rb +4 -0
- data/spec/sample_feeds/AtomWithITunesNamespace.xml +13 -0
- data/spec/sample_feeds.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f6474b14f1393846dfeb3d06a542cb653b62943f0e41cccf731be876e9e2363
|
|
4
|
+
data.tar.gz: 5f1795b599c600e3a2ee6a9e0c2f2c80d21f822da10ce67791f30026f1ad6cbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24230edd72d9c272b05de0308b8576ebff8ecd5eef592ba4d6b7127dd59519a051dcc40f8d78a5a3e745394fbe57ddf7c21a53367fef98b6819ed960832aeee7
|
|
7
|
+
data.tar.gz: 2d703a159a159a1fa9bf137abbfcd193c451cb2f7e15ea44579dbfc3ab46c25c3c687d7d7e4b6798e41c833175b0d3520c387f735c3c89015316eac3d8ae0fc1
|
data/CHANGELOG.md
CHANGED
|
@@ -64,7 +64,8 @@ module Feedjira
|
|
|
64
64
|
|
|
65
65
|
def self.able_to_parse?(xml)
|
|
66
66
|
xml_without_cdata = xml.gsub(/<!\[CDATA\[.*?\]\]>/m, "")
|
|
67
|
-
|
|
67
|
+
xml_without_cdata.include?("<rss") &&
|
|
68
|
+
%r{xmlns:itunes\s?=\s?["']http://www\.itunes\.com/dtds/podcast-1\.0\.dtd["']}i.match?(xml_without_cdata)
|
|
68
69
|
end
|
|
69
70
|
end
|
|
70
71
|
end
|
data/lib/feedjira/version.rb
CHANGED
|
@@ -28,6 +28,10 @@ module Feedjira
|
|
|
28
28
|
it "returns false for an atom feed with xmlns:itunes inside CDATA" do
|
|
29
29
|
expect(ITunesRSS).not_to be_able_to_parse(sample_atom_with_itunes_in_cdata)
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
it "returns false for an atom feed that declares the itunes namespace" do
|
|
33
|
+
expect(ITunesRSS).not_to be_able_to_parse(sample_atom_with_itunes_namespace)
|
|
34
|
+
end
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
describe "parsing" do
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
|
|
3
|
+
<id>tag:example.com,2013:/posts</id>
|
|
4
|
+
<title>Example</title>
|
|
5
|
+
<updated>2026-11-17T17:58:10Z</updated>
|
|
6
|
+
<itunes:author>Jane Doe</itunes:author>
|
|
7
|
+
<entry>
|
|
8
|
+
<id>tag:example.com,2013:Post/1</id>
|
|
9
|
+
<updated>2026-11-17T17:58:10Z</updated>
|
|
10
|
+
<link rel="alternate" type="text/html" href="https://example.com/post-1"/>
|
|
11
|
+
<title>Post 1</title>
|
|
12
|
+
</entry>
|
|
13
|
+
</feed>
|
data/spec/sample_feeds.rb
CHANGED
|
@@ -38,7 +38,8 @@ module SampleFeeds
|
|
|
38
38
|
sample_rss_feed_permalinks: "Permalinks.xml",
|
|
39
39
|
sample_rss_feed_with_a10_namespace: "a10.xml",
|
|
40
40
|
sample_rss_feed_with_comments: "RSSWithComments.xml",
|
|
41
|
-
sample_atom_with_itunes_in_cdata: "AtomWithITunesInCDATA.xml"
|
|
41
|
+
sample_atom_with_itunes_in_cdata: "AtomWithITunesInCDATA.xml",
|
|
42
|
+
sample_atom_with_itunes_namespace: "AtomWithITunesNamespace.xml"
|
|
42
43
|
}.freeze
|
|
43
44
|
|
|
44
45
|
FEEDS.each do |method, filename|
|
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: 4.0.
|
|
4
|
+
version: 4.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Hess
|
|
@@ -167,6 +167,7 @@ files:
|
|
|
167
167
|
- spec/sample_feeds/AtomEscapedHTMLInPreTag.xml
|
|
168
168
|
- spec/sample_feeds/AtomFeedWithSpacesAroundEquals.xml
|
|
169
169
|
- spec/sample_feeds/AtomWithITunesInCDATA.xml
|
|
170
|
+
- spec/sample_feeds/AtomWithITunesNamespace.xml
|
|
170
171
|
- spec/sample_feeds/CRE.xml
|
|
171
172
|
- spec/sample_feeds/DuplicateContentAtomFeed.xml
|
|
172
173
|
- spec/sample_feeds/FeedBurnerUrlNoAlternate.xml
|