Updated site to typo 2.5
Apparently sqlite does not yet support rails migrations. Sqlite3 does, but not sqlite2, this led to some difficulty in updating my site to typo 2.5, since the database schema for typo has been quite fluid of late.
Unfortuneatly dreamhost makes setting up mysql databases kind of annoying, they only allow one database per virtual host, and no resuse of usernames. Hence why I had been using sqlite, but I determined that in order to stay ontop of typo’s development, providing enhancements and the like it would be necessary to support migrations, so I manually moved my sqlite database over to mysql. Anyways typo is all updated and works quite nicely. Most of the enhancements are on the admin interface, so not so visible to the reader, but suffice to say it’s quite an update.
Calendar was broken 2
I still need to upgrade to the super fancy version of the calender that was posted as a patch on typo.leetsoft.com, but it was loosely based on the calender system running on my version of typo. Unfortuneatly somewhere in my modification I had forgotten to include the critical piece of code that read:
[""] * (self.class.civil(year,month,1).wday)Which needed to be prepended to the array of dates in the month to ensure the calender started on the right day of the week for each month. Perhaps sometime next week I will dissassemble the patch that followed mine since it doesn’t seem to work as a patch set anymore. It would be nice to have a calender with AJAXy goodness and all that nonsense.
If anyone is interested I based all of my calendar code from a snipet that appeared on comp.lang.ruby:
calendar.rbrequire 'date' require 'enumerator'require ‘date’
require ‘enumerator’class Date
def weekdays (1..dim).to_a end def cal_print banner = ABBR_DAYNAMES.map{|d| d[0..1]}.join(‘ ’) puts "#{MONTHNAMES[month]} #{year}".center(banner.size) puts banner wd = [‘ ’] * wday + weekdays wd.each_slice(7) do |slice| puts slice.map{|d| d.to_s.rjust(2)}.join(‘ ’) end end
def days_in_month
self.class.civil(year, month, -1).day
end
alias dim days_in_monthend
month = (ARGV[0] || Date.today.mon).to_i
year = (ARGV[1] || Date.today.year).to_iDate.civil(year, month).cal_print
Perhaps the above comment about the missing line makes more sense in that context. Also hopefully someone determines a way to use syntax to auto-hilight code in typo.
Page cache is broken 2
I have another article that was not displayed. Perhaps if I add a new article it will invalidate the page cache.
Updated 3:44pm:
Well apparently it was merely broken because the editor I used to submit the post neglected to set the published attribute to 1. Or perhaps it’s just that that doesn’t work in general yet. Hopefully the updated admin interface will have checkboxes for published articles.
