Module: Mo2tex

Extended by:
CommonParts
Defined in:
lib/mo2tex.rb,
lib/mo2tex/pic.rb,
lib/mo2tex/main.rb,
lib/mo2tex/event.rb,
lib/mo2tex/latex.rb,
lib/mo2tex/course.rb,
lib/mo2tex/school.rb,
lib/mo2tex/version.rb,
lib/mo2tex/calendar.rb,
lib/mo2tex/exceptions.rb,
lib/mo2tex/day_schedule.rb,
lib/mo2tex/exclude_date.rb,
lib/mo2tex/course_helper.rb,
lib/mo2tex/datetime_helper.rb,
lib/mo2tex/exclusion_manager.rb

Defined Under Namespace

Modules: CommonParts, CourseHelper, DateTimeHelper, Pic Classes: Calendar, CollectiveCourse, Course, DateOutOfRange, DayIsNotDateTime, DaySchedule, Error, Event, EventsNotGenerated, ExcludeBase, ExcludeDate, ExcludeDates, ExclusionManager, FreeSlot, GenerationError, IndividualCourse, Latex, LunchBreak, NotAPicContainer, NotEnoughLessons, PureVirtuaMethodCalled, School, SlotBase, TimeIsNotString, UnexistentWeekDay, UnknownCourse, UnknownCourseFrequency, UnknownCourseType, UnknownRepetition, WrongWeekDay

Constant Summary collapse

PATH =
'mo2tex'
EXT_PATH =
File.join(PATH, 'extensions')
DEFAULT_LTDIR =
File.expand_path(File.join(['..']*3, 'config', 'templates', 'latex'), __FILE__)
VERSION =
"1.0.3"

Class Method Summary collapse

Methods included from CommonParts

m2common

Class Method Details

.m2ical(args, io = STDOUT) ⇒ Object

m2ical: produces an iCal file from a configuration



38
39
40
41
42
43
44
45
# File 'lib/mo2tex/main.rb', line 38

def m2ical(args, io = STDOUT)
  ical = m2common(args, io) do
    |school|
    ical = school.cal.create_icalendar(school)
    return ical.to_ical
  end
  return ical
end

.m2latex(args, io = STDOUT) ⇒ Object

m2latex: produces a LaTeX file from a configuration



26
27
28
29
30
31
32
33
# File 'lib/mo2tex/main.rb', line 26

def m2latex(args, io = STDOUT)
  text = m2common(args, io) do
    |school|
    latex = Latex.new(school)
    return latex.generate
  end
  return text
end

.m2pic(args, io = STDOUT) ⇒ Object

m2pic: produces a pic file from a configuration



50
51
52
53
54
55
56
57
# File 'lib/mo2tex/main.rb', line 50

def m2pic(args, io = STDOUT)
  text = m2common(args, io) do
    |school|
    pic = Pic::Writer.new(school)
    return pic.generate
  end
  return text
end