Sha256: aa7377818382f83a39523e716d3b2e180f7648f24035f6febccceba893adb261

Contents?: true

Size: 488 Bytes

Versions: 4

Compression:

Stored size: 488 Bytes

Contents

module Util
  def Util.init_date_of_book(book)
    if not book["end"]
      book["end"] = Time.now.year
    end

    if not book["start"]
      book["start"] = book["end"]
    end

    if book["start"] == book["end"]
      book["date"] = book["start"].to_s
    else
      book["date"] = "#{book["start"]}-#{book["end"]}"
    end
  end

  def Util.cover_default(default, params)
    for key in default
      default[key] = params[key] unless params[key].nil?
    end
    default
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jekyll-books-0.3.1 lib/util.rb
jekyll-books-0.3.0 lib/util.rb
jekyll-books-0.2.1 lib/util.rb
jekyll-books-0.2.0 lib/util.rb