File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8686 bcrypt (3.1.22 )
8787 bigdecimal (4.1.2 )
8888 bindex (0.8.1 )
89- bootsnap (1.24.6 )
90- msgpack (~> 1.2 )
89+ bootsnap (1.25.0 )
90+ msgpack (~> 1.5 )
9191 brakeman (8.0.5 )
9292 racc
9393 builder (3.3.0 )
131131 railties (>= 6.1 )
132132 drb (2.2.3 )
133133 dumb_delegator (1.1.0 )
134- erb (6.0.6 )
134+ erb (6.0.7 )
135135 erubi (1.13.1 )
136136 et-orbi (1.4.1 )
137137 tzinfo
170170 multi_xml (>= 0.5.2 )
171171 i18n (1.15.2 )
172172 concurrent-ruby (~> 1.0 )
173- io-console (0.8.2 )
173+ io-console (0.9.1 )
174174 irb (1.18.0 )
175175 pp (>= 0.6.0 )
176176 prism (>= 1.3.0 )
299299 readline (0.0.4 )
300300 reline
301301 regexp_parser (2.12.0 )
302- reline (0.6.3 )
302+ reline (0.7.0 )
303303 io-console (~> 0.5 )
304304 rexml (3.4.4 )
305305 rspec (3.13.2 )
325325 rspec-support (3.13.7 )
326326 rspec_junit_formatter (0.6.0 )
327327 rspec-core (>= 2 , < 4 , != 2.12.0 )
328- rubocop (1.88.2 )
328+ rubocop (1.89.0 )
329329 json (~> 2.3 )
330330 language_server-protocol (~> 3.17.0.2 )
331331 lint_roller (~> 1.1.0 )
427427 websocket-extensions (>= 0.1.0 )
428428 websocket-extensions (0.1.5 )
429429 will_paginate (4.0.1 )
430- with_model (2.3.0 )
430+ with_model (2.3.1 )
431431 activerecord (>= 7.2 )
432432 xpath (3.2.0 )
433433 nokogiri (~> 1.8 )
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module GenerateXml
4+ ITUNES_NAMESPACE = "http://www.itunes.com/dtds/podcast-1.0.dtd"
5+
46 class << self
57 def call ( feed , items )
68 build_feed ( feed , items ) . to_xml
@@ -26,13 +28,15 @@ def rss_attributes(items)
2628 "xmlns:content" => "http://purl.org/rss/1.0/modules/content/"
2729 }
2830
29- if items . any? { |item | item . try ( :enclosure_url ) }
30- attributes [ "xmlns:itunes" ] = "http://www.itunes.com/dtds/podcast-1.0.dtd"
31- end
31+ attributes [ "xmlns:itunes" ] = ITUNES_NAMESPACE if enclosures? ( items )
3232
3333 attributes
3434 end
3535
36+ def enclosures? ( items )
37+ items . any? { |item | item . try ( :enclosure_url ) }
38+ end
39+
3640 def build_item ( xml , item )
3741 xml . item do
3842 xml . title ( item . title )
You can’t perform that action at this time.
0 commit comments