CodeColorer updated to version 0.5.1

Posted by Dmytro Shteflyuk on under WordPress

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

Let’s update!

No Responses to this entry

Subscribe to comments with RSS

Comments are closed

Comments for this entry are closed for a while. If you have anything to say – use a contact form. Thank you for your patience.