geshi | Dmytro Shteflyuk's Home https://kpumuk.info In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Tue, 08 Sep 2015 00:10:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 CodeColorer updated to version 0.5.1 https://kpumuk.info/wordpress/codecolorer-update-to-version-051/ Sun, 01 Apr 2007 14:29:37 +0000 http://kpumuk.info/wordpress/codecolorer-update-to-version-051/ 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 […]

The post CodeColorer updated to version 0.5.1 first appeared on Dmytro Shteflyuk's Home.]]>
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!

The post CodeColorer updated to version 0.5.1 first appeared on Dmytro Shteflyuk's Home.]]>