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:
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
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
Русский
English