Sha256: 5827ac60a621c1dfccbb499156c6cd90d01e1e0b025e9f1da24459cd1ee3aa86

Contents?: true

Size: 627 Bytes

Versions: 11

Compression:

Stored size: 627 Bytes

Contents

module XmlHelper
  def pub_date(time)
    time.rfc822
  end

  def post_title(post)
    h(post.title)
  end

  def blog_title
    this_blog.blog_name || "Unnamed blog"
  end

  def collection_lastmod(collection)
    article_updated = collection.articles.find(:first, :order => 'updated_at DESC')
    article_published = collection.articles.find(:first, :order => 'published_at DESC')

    times = []
    times.push article_updated.updated_at if article_updated
    times.push article_published.updated_at if article_published

    if times.empty?
      Time.at(0).xmlschema
    else
      times.max.xmlschema
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
typo-4.1.1 app/helpers/xml_helper.rb
typo-5.0.2 app/helpers/xml_helper.rb
typo-5.0.1 app/helpers/xml_helper.rb
typo-4.1 app/helpers/xml_helper.rb
typo-5.0.3.98.1 app/helpers/xml_helper.rb
typo-5.0.3.98 app/helpers/xml_helper.rb
typo-5.0 app/helpers/xml_helper.rb
typo-5.1.1 app/helpers/xml_helper.rb
typo-5.1.2 app/helpers/xml_helper.rb
typo-5.1.3 app/helpers/xml_helper.rb
typo-5.1 app/helpers/xml_helper.rb