Sha256: 3b40ae781b3a3033e66750e872a4570d443591298771000d6b32e629c486dc61
Contents?: true
Size: 572 Bytes
Versions: 1
Compression:
Stored size: 572 Bytes
Contents
require 'yaml' module Calrom module Formatter # Prints list of available bundled calendars class Calendars < Formatter 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 def load_front_matter(data_file) YAML.load File.read data_file.path end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
calrom-0.3.0 | lib/calrom/formatter/calendars.rb |