From a1330de9438827abcdc331c85dbd7e358b0e118a Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 29 Jun 2010 07:11:21 +0000 Subject: Use autoload instead of require (speeds up CodeRay startup) for CodeRay, Scanner, Tokens, and Encoders::HTML. --- lib/coderay/scanner.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/coderay/scanner.rb') diff --git a/lib/coderay/scanner.rb b/lib/coderay/scanner.rb index cc1f665..beff642 100644 --- a/lib/coderay/scanner.rb +++ b/lib/coderay/scanner.rb @@ -1,7 +1,9 @@ module CodeRay - require 'coderay/helpers/plugin' - + autoload :WordList, 'coderay/helpers/word_list' + # FIXME: Rename CaseIgnoringWordList to WordList::CaseIgnoring. + autoload :CaseIgnoringWordList, 'coderay/helpers/word_list' + # = Scanners # # This module holds the Scanner class and its subclasses. @@ -50,8 +52,6 @@ module CodeRay # Raised if a Scanner fails while scanning ScanError = Class.new(Exception) - require 'coderay/helpers/word_list' - # The default options for all scanner classes. # # Define @default_options for subclasses. -- cgit v1.2.1