Switch branches/tags
Nothing to show
Commits on Mar 11, 2012
  1. SR::EditFile::Parser

    gsinclair committed Mar 11, 2012
    * Implemented and tested.
    * Lesson#parse(string) added to ease implementation.
      * Also Lesson#== and Lesson#hash
    * Parser emits value objects DayVO and LessonVO.
      * parse(str) -> [DayVO] where DayVO contains schoolday and [LessonVO]
Commits on Mar 4, 2012
  1. SR::EditFile::Creator

    gsinclair committed Mar 4, 2012
    * Implemented and tested.
    * SR::Command::EditCmd will use this to present the lessons in a text editor.
    * TimetabledLesson#lesson attribute added to ease this implementation.
Commits on Mar 3, 2012
  1. DescribeLesson command is unit tested

    gsinclair committed Mar 3, 2012
    * Database#clear_sqlite_database for testing purposes (will only
      clear the :test database)
  2. Error messages have better backtrace

    gsinclair committed Mar 3, 2012
    Any error initiated by sr_err will now start the backtrace where that
    call is made, rather than inside sr_err itself.
  3. Lessons can now be described on the command-line

    gsinclair committed Mar 3, 2012
    * TimetabledLesson#store_lesson implemented and tested.
      * Raises error if asked to overwrite existing description.
    * Every aspect of this command tested interactively (but not automatically)
      * Will describe first available period in the day, thus allowing for
        describing double periods with two iterations.
      * If no suitable lesson is available on the date requested, the user is
        informed: either that class has no lessons that day, or they're already
        described, or there is an obstacle.
    * Database#timetabled_lessons now takes second argument (class label) to
      filter the results.
    * SchoolDay#inspect.
    * The SchoolDay datamapper type now works both ways (it was read-only before)
      thanks to the method "def custom?() true end". Thanks to Adiel Mittmann on
    * Some no-longer-used code and some debugging statements removed.
Commits on Feb 28, 2012
  1. Lesson descriptions loaded from the database

    gsinclair committed Feb 28, 2012
    * TimetabledLesson#description is now implemented and (using planted
      data) tested.
    * LessonDescription.find_by_schoolday_and_lesson
    * DataMapper::Property::SchoolDay implemented to map SchoolDay objects
      to strings in the database.
    * Command::EnterLesson -> DescribeLesson (and implemented)
    * At commandline, can run "sr 10 ..." instead of "sr enter 10 ..."
    * At commandline, dates can be specified: "sr 10 yesterday ..."
    * (Note: commandline code not tested yet, even interactively.)
    * Database.current (to support LessonDescription; general use not
    * Database#schoolday!(str) -- raises error if not a schoolday.
Commits on Feb 22, 2012
  1. Database#timetabled_lessons tested and working

    gsinclair committed Feb 22, 2012
    * Couple of changes to the code of the method itself.
    * Lesson and Obstacle got to_s(:brief).
    * Error raised if obstacle config contains non-school day.
    * TimetabledLesson got to_s, enabling easier testing.
    * test/database.rb contains the tests for timetabled_lessons.
    * Obstacle config got a new entry with lessons "12(3), 10(2)"
Commits on Feb 21, 2012
  1. Implemented (but not tested) Database#timetabled_lessons()

    gsinclair committed Feb 21, 2012
    This is the culmination of a lot of work. Changes include:
    * Timetable#lessons() takes an integer (day of cycle) rather than a
      schoolday -- a timetable doesn't care for the date.
    * Lesson no longer has the "schoolday" property: it wasn't being
      used and would have uglified the timetabled_lessons() code.
      Consequent method signature changes:
      *, lesson, obstacle)
      * Obstacle#match?(schoolday, lesson)
    * Obstacles are loaded into the Database class on initialisation.
      * test/db/Config/obstacles.yaml refreshed
    * Implemented Database#timetabled_lessons()
    Completing this milestone inspires me to quote the starring method
    in full.
        def timetabled_lessons(schoolday)
          timetable.lessons(schoolday).map { |lesson|
            obstacle = @obstacles.find { |o| o.match?(schoolday, lesson) }
  , lesson, obstacle)
    Now I just have to test it ... and use it.
Commits on Feb 20, 2012
  1. Obstacles are loaded into database

    gsinclair committed Feb 20, 2012
    * Not doing anything with them yet
    * obstacles.yaml replaced with spec from test file
    * Database test that uses deleted method 'classes' disabled
  2. Small change in Timetable API

    gsinclair committed Feb 20, 2012
    * Timetable#lessons(day_of_cycle), not Timetable#lessons(schoolday). A
      Timetable has no need to know about a particular date.
    * Removed cruft methods like class_labels_only.
  3. Timetable now uses Lesson objects

    gsinclair committed Feb 20, 2012
    Timetable was a bit of a hack before, storing nested arrays like
    [ ['7',1], ['10',4], ['11',5] ] and returning such things. The Lesson
    class was created mainly to improve this and implement periods properly.
    This is now done. The timetable test is nicer, too.
    Test database .db file now ignored by git. May be added later.
  4. Introduced lightweight Lesson class; completed Obstacle

    gsinclair committed Feb 20, 2012
    * Lesson is a value object, essentially for passing parameters
      (schoolday, class_label, period).
    * Obstacle now uses Lesson objects and is implemented and tested
      properly, paving the way to...
    * TimetabledLesson (implemented but not used or tested) is a slightly
      mode robust class which encapsulates a lesson that is timetabled,
      but knows about any obstacles. (It's not a smart object; it needs
      to be told of the obstacles.) This paves the way for...
    * Database#timetabled_lessons, coming soon.
Commits on Feb 19, 2012
  1. Lesson -> LessonDescription; better sqlite initialisation

    gsinclair committed Feb 19, 2012
    * Old Lesson class is gone, replaced with LessonDescription. All code now
      refers to the latter.
    * Database.{dev,test,prd} all defer to Database.init(label), which ensures
      label is one of {dev,test,prd}, ensures no other database has been loaded,
      and caches the Database object for future calls. So calling
      followed by Database.test will generate an error.
    * LessonDescription is defined in lib/school\_record/lesson\_description.rb.
      I moved it back out of DomainObjects. It is required by the Datamapper
      initialization code (i.e. just-in-time). I thought about another module
      DatabaseObjects but decided against it. LessonDescription is as core as
      Calendar or Timetable, which are both in the SchoolRecord namespace.
    * Database initialisation code is fresher; ensures only one of
      {dev,test,prd} is loaded.
    * Removed test database to force clean regeneration.
    * All tests pass except for the Obstacle one involving period 4, which all
      this refactoring is aiming to fix.
  2. TimetabledLesson implementation in progress

    gsinclair committed Feb 19, 2012
    * Much added to doc/devel-log/2012-02-16-getting-sqlite-going.markdown
      that has gone well beyond getting SQLite working. It contains thoughts
      on Obstacles, Lessons, LessonDescriptions, TimetabledLessons, and more.
      It is to provide a clear space for these implementations that this
      commit is happening.
    * Since Database#classes now returns period information as well (in an
      ad-hoc nested array), I implemented Database#class_labels_only to keep
      the Database unit tests working. These two methods will be strongly
      reconsidered when Database#timetabled_lessons is implemented.
    * SchoolDay now has == and <=> (and includes Comparable). Tests
    * DateString implemented and tested. This helps to make sense of strings
      like "13 Feb" and "13A Mon". It can be put to more use inside Calendar
      sometime later.
    * Obstacle implementation started, with tests. Works except for when a
      period is specified for an obstacle. That sparked the plan to improve
      the handling of "lessons" (classes and periods) throughout the code.
Commits on Feb 17, 2012
  1. Added period information to Lesson class

    gsinclair committed Feb 17, 2012
    Very minor code change in this class. The devel log thrashes out how the
    period information is to be used, resulting in plans for a TimetabledLesson
    class which includes obstacle information. The Lesson class will almost
    certainly be changed to LessonDescription.
Commits on Feb 16, 2012
  1. Added period information to timetable

    gsinclair committed Feb 16, 2012
    This will be necessary for the SQLite data to cope with doubles.
    Additionally, the file test/db/lessons_and_notes.db is included
    in this commit. No test cases use it yet; it was created automatically
    upon instantiating the test Database object. It will surely play a
    role soon though.
  2. SQLite now the backend for lessons (and in future, notes)

    gsinclair committed Feb 16, 2012
    Lessons are now stored in the database file lessons_and_notes.db instead
    of the filesystem hierarchy Sem1/02/Thu.yaml etc. This is discussed at
    length in the development logs. It feels more natural for reports, but
    less natural (at the moment) for data entry.
    "sr enter 10 'Lesson comment...'" works, but only allows one entry per
    class per day (therefore doesn't suit double periods) and doesn't check
    the timetable.
    Hopefully the SQLite approach will work well with Dropbox.
Commits on Feb 11, 2012
  1. Implementation of lesson entry begun

    gsinclair committed Feb 11, 2012
    * Command 'enter' handled, as in "sr enter 10 'blah blah blah'"
    * Lesson and Lessons objects started but not finished and certainly
      not tested.
    * Database code to load required lesson files started and probably
    * No testing of any of this at this stage.
    * Reconsidering storage option. Database would probably be easier
      to code.
Commits on Feb 5, 2012
  1. Implemented Database#classes('Fri 13A')

    gsinclair committed Feb 5, 2012
    * Timetable#lessons renamed to Timetable#classes because it returns an
      array of class labels. A "lesson" will, in the future, be an object
      that contains the lesson notes as well.
    * SchoolOrNaturalDateParser had some logic added such that '3 Dec' won't
      give a date from last year (but of course '3 Dec 2011' will).
Commits on Feb 4, 2012
  1. Implemented Calendar#schoolday

    gsinclair committed Feb 4, 2012
    * SchoolDay now has no interest in the term; you give it the semester
      instead ->, 2, 15)
    * There are lots of tests for Calendar#schoolday, but perhaps there
      should be some more.
    * Error in calendar.yaml fixed.
Commits on Jan 31, 2012
Commits on Jan 30, 2012
  1. Started work on Calendar class

    gsinclair committed Jan 30, 2012
    * Calendar::Term implemented and tested.
    * Calendar begun; will be easier now with good Term class.
    * Util.{weekday?,weekend?,date}
Commits on Jan 29, 2012
  1. Implemented and tested Timetable and SchoolDay

    gsinclair committed Jan 29, 2012
    Both are dumb objects: they just recite the information given to them.
    Calendar will be the smarts that uses them. (It will generate SchoolDay
    objects and call on Timetable for information.)
    * lib/school_record/domain_objects.rb: SchoolDay
    * lib/school_record/timetable.rb: Timetable
    * Database#timetable to load timetable from config file.
    * Changed some of the classes data (and consequent tests) to match the
      timetable data.
  2. Added more configuration files: timetable, calendar, obstacles

    gsinclair committed Jan 29, 2012
    These go in the new Config directory, and class-lists.yaml has been moved
    there, and this has been reflected in the code.
  3. Implemented report notes

    gsinclair committed Jan 29, 2012
    * SR::Report::Notes class
    * Report is subclass of Command
    * Command gets 'emit' method for writing to output stream
    * test/report_notes.rb
    * Name and Student get proper hash and eql? implementation
    * Added notes to test/db/notes.yaml for more detailed testing
Commits on Jan 28, 2012
  1. Fixed bug in last commit

    gsinclair committed Jan 28, 2012
  2. Implemented 'note' command

    gsinclair committed Jan 28, 2012
    Can now do (run is an alias): run note 9 MAch "Equipment"
    and have the note added to the "development" database etc/dev-db.
    Components of commit:
     * lib/school_record/database.rb implements the filesystem database
       with the capability to load class lists and load and save notes.
     * lib/school_record/domain_objects.rb implements the classes
       Name, Student, Note and SchoolClass.
     * SchoolClass is capable of resolving name fragments against a
       class list that Database has loaded from class-lists.yaml
     * Unit tests of the SchoolClass and Database classes.
  3. Implemented skeleton for a few commands (note, edit, report, config)

    gsinclair committed Jan 28, 2012
     * Also basics of error reporting (SR::Err)
     * Described in doc/devel-log/2012-01-27-app-skeleton.markdown
Commits on Jan 26, 2012
Commits on Jan 25, 2012
  1. Attempt to improve Markdown...

    gsinclair committed Jan 25, 2012
  2. Version 0.0.1.pre opened

    gsinclair committed Jan 25, 2012
     * Initial commit: bundler-generated files,, etc.
     * doc/ is well developed.
     * Skeleton app bin/school_record implemented; prints version and exits.