class Calrom::Formatter::Calendars

Prints list of available bundled calendars

Public Instance Methods

call(calendar, date_range) click to toggle source
# File lib/calrom/formatter/calendars.rb, line 7
def call(calendar, date_range)
  last_locale = nil
  CR::Data.each do |d|
    meta = load_front_matter d
    puts if last_locale && last_locale != meta['locale']
    puts "%-20s:  %s  [%s]" % [d.siglum, meta['title'], meta['locale']]
    last_locale = meta['locale']
  end
end
load_front_matter(data_file) click to toggle source
# File lib/calrom/formatter/calendars.rb, line 17
def load_front_matter(data_file)
  YAML.load File.read data_file.path
end