Class: Calrom::Formatter::Calendars
- Inherits:
-
Calrom::Formatter
- Object
- Calrom::Formatter
- Calrom::Formatter::Calendars
- Defined in:
- lib/calrom/formatter/calendars.rb
Overview
Prints list of available bundled calendars
Instance Method Summary collapse
Instance Method Details
#call(calendar, date_range) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/calrom/formatter/calendars.rb', line 7 def call(calendar, date_range) last_locale = nil CR::Data.each do |d| = load_front_matter d puts if last_locale && last_locale != ['locale'] puts "%-20s: %s [%s]" % [d.siglum, ['title'], ['locale']] last_locale = ['locale'] end end |
#load_front_matter(data_file) ⇒ Object
17 18 19 |
# File 'lib/calrom/formatter/calendars.rb', line 17 def load_front_matter(data_file) YAML.load File.read data_file.path end |