mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Rubocop autocorrect app directory
This commit is contained in:
parent
ec4aa64cfc
commit
c08ce6864c
10 changed files with 132 additions and 110 deletions
|
@ -1,35 +1,37 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'date'
|
||||
|
||||
xml.instruct! :xml, :version => "1.0"
|
||||
xml.rss :version => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
|
||||
xml.instruct! :xml, version: '1.0'
|
||||
xml.rss :version => '2.0', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/' do
|
||||
xml.channel do
|
||||
xml.title "Search results"
|
||||
xml.description "Papers matching search criteria"
|
||||
xml.title 'Search results'
|
||||
xml.description 'Papers matching search criteria'
|
||||
|
||||
@papers.each do |doc|
|
||||
xml.item do
|
||||
xml.title doc.name
|
||||
if !doc.content.blank?
|
||||
xml.description do
|
||||
xml.cdata! truncate(doc.content.sub("------------------------------- ", ""), length: 768)
|
||||
end
|
||||
unless doc.content.blank?
|
||||
xml.description do
|
||||
xml.cdata! truncate(doc.content.sub('------------------------------- ', ''), length: 768)
|
||||
end
|
||||
end
|
||||
if !doc.published_at.blank?
|
||||
xml.pubDate DateTime.parse(doc.published_at).utc.strftime("%a, %d %b %Y %H:%M:%S %z")
|
||||
unless doc.published_at.blank?
|
||||
xml.pubDate DateTime.parse(doc.published_at).utc.strftime('%a, %d %b %Y %H:%M:%S %z')
|
||||
end
|
||||
doc.originator.each do |originator|
|
||||
xml.dc :creator do
|
||||
xml.cdata! originator
|
||||
end
|
||||
end
|
||||
doc.originator.each do |originator|
|
||||
xml.dc :creator do
|
||||
xml.cdata! originator
|
||||
end
|
||||
end
|
||||
if !doc.paper_type.blank?
|
||||
xml.category do
|
||||
xml.cdata! doc.paper_type
|
||||
end
|
||||
unless doc.paper_type.blank?
|
||||
xml.category do
|
||||
xml.cdata! doc.paper_type
|
||||
end
|
||||
end
|
||||
xml.link doc.url
|
||||
xml.guid doc.url
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue