From 476bc1bfe2f2000acc665f034e7da19bd3f0cc6b Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 30 Mar 2010 01:10:25 +0000 Subject: Renamed token_classes to token_kinds (closes #122). * *RENAMED* from ClassOfKind. The term "token class" is no longer used in CodeRay. Instead, tokens have _kinds_. * *RENAMED* TokenKindFilter to TokenClassFilter. * *ADDED* documentation on encoders affected by the term change. * *REMOVED* token kinds :attribute_name_fat, :attribute_value_fat, :operator_fat, :tag_fat, and :xml_text. * *ADDED* token kind :filename. --- lib/coderay.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'lib/coderay.rb') diff --git a/lib/coderay.rb b/lib/coderay.rb index df29a5a..3636714 100644 --- a/lib/coderay.rb +++ b/lib/coderay.rb @@ -126,22 +126,23 @@ # If you want to re-use scanners and encoders (because that is faster), see # CodeRay::Duo for the most convenient (and recommended) interface. module CodeRay - + + $CODERAY_DEBUG ||= false + # Version: Major.Minor.Teeny[.Revision] # Major: 0 for pre-stable, 1 for stable # Minor: feature milestone # Teeny: development state, 0 for pre-release # Revision: Subversion Revision number (generated on rake gem:make) - VERSION = '0.9.1' + VERSION = '1.0.0' require 'coderay/tokens' - require 'coderay/token_classes' + require 'coderay/token_kinds' require 'coderay/scanner' require 'coderay/encoder' require 'coderay/duo' require 'coderay/style' - class << self # Scans the given +code+ (a String) with the Scanner for +lang+. @@ -295,16 +296,20 @@ module CodeRay # This Exception is raised when you try to stream with something that is not # capable of streaming. class NotStreamableError < Exception + + # +obj+ is the object that is not streamable. def initialize obj @obj = obj end - - def to_s + + def to_s # :nodoc: '%s is not Streamable!' % @obj.class end + end - # A dummy module that is included by subclasses of CodeRay::Scanner an CodeRay::Encoder + # A dummy module that is included by subclasses of + # CodeRay::Scanners::Scanner and CodeRay::Encoders::Encoder # to show that they are able to handle streams. module Streamable end -- cgit v1.2.1