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
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/calrom/formatter/calendars.rb', line 5 def call(calendar, date_range) last_locale = nil CR::Data.each do |d| sanctorale = d.load_with_parents = sanctorale. puts if last_locale && last_locale != ['locale'] default = d == Config::DEFAULT_DATA ? ' [default]' : '' puts "%-20s: %s [%s]%s" % [d.siglum, ['title'], ['locale'], default] next unless ['components'] parents = ['components'] .collect {|c| c['extends'] } .compact .map {|e| e.is_a?(Array) ? e : [e] } # 'extends' is String or Array .flatten .map {|p| p.sub(/\.\w{3,4}$/, '') } # file name to "siglum" parents.each {|p| puts " < #{p}" } last_locale = ['locale'] end end |