Right after publishing my previous post about WordPress plugins updates, I found that GeSHi library has been updated, therefor I have updated CodeColorer too.
From GeSHi news:
This release adds a couple of new languages, X++ and Rails, and fixes a few bugs in other languages. Ruby support is improved also.
Here is the example of Rails syntax highlighting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | class User < ActiveRecord::Base include AccessManager attr_accessible :email, :first_name, :last_name, :country, :birthday, :home_page, :preferred_name has_many :videos validates_presence_of :login, :role, :email validates_format_of :email, :with => /^[^@]+@.+\..+$/ validates_presence_of :password :if => :validate_password? validates_length_of :password, :in => 5..100, :if => :validate_password? def initialize(attributes = nil) super @new_password = false end def self.authorize(login, password) User.find :first, :conditions => ['(login = ? OR email = ?) AND password = ? AND is_active = 1', login, login, password] end protected def validate_password? @new_password end end |