Class: CalendariumRomanum::CLI Private

Inherits:
Thor
  • Object
show all
Includes:
Helper
Defined in:
lib/calendarium-romanum/cli.rb,
lib/calendarium-romanum/cli.rb,
lib/calendarium-romanum/cli/dumper.rb,
lib/calendarium-romanum/cli/helper.rb,
lib/calendarium-romanum/cli/querier.rb,
lib/calendarium-romanum/cli/comparator.rb,
lib/calendarium-romanum/cli/date_parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Implementation of the calendariumrom executable. Not loaded by default when you require the gem.

Defined Under Namespace

Modules: Helper Classes: Comparator, DateParser, Dumper, Querier

Instance Method Summary collapse

Methods included from Helper

#die!, #sanctorale_from_path

Instance Method Details

#calendarsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
# File 'lib/calendarium-romanum/cli.rb', line 41

def calendars
  Data.each {|c| puts c.siglum }
end

#cmp(a, b) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
# File 'lib/calendarium-romanum/cli.rb', line 57

def cmp(a, b)
  Comparator.new.call(a, b)
end

#dump(year) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



62
63
64
# File 'lib/calendarium-romanum/cli.rb', line 62

def dump(year)
  Dumper.new.regression_tests_dump year.to_i
end

#errors(*files) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



46
47
48
49
50
51
52
53
54
# File 'lib/calendarium-romanum/cli.rb', line 46

def errors(*files)
  files.each do |path|
    begin
      sanctorale_from_path path
    rescue Errno::ENOENT, InvalidDataError => err
      die! err.message
    end
  end
end

#query(date_str = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
36
37
38
# File 'lib/calendarium-romanum/cli.rb', line 34

def query(date_str = nil)
  Querier
    .new(locale: options[:locale], calendar: options[:calendar])
    .call(date_str)
end

#versionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



67
68
69
70
# File 'lib/calendarium-romanum/cli.rb', line 67

def version
  puts 'calendarium-romanum CLI'
  puts "calendarium-romanum: version #{CalendariumRomanum::VERSION}, released #{CalendariumRomanum::RELEASE_DATE}"
end