From b09e97b08c3c073e79159ff09f6a7e0779fcfd2e Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Tue, 22 Oct 2013 01:11:31 +0200 Subject: use autoload again --- lib/coderay/scanners.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/coderay/scanners.rb (limited to 'lib/coderay/scanners.rb') diff --git a/lib/coderay/scanners.rb b/lib/coderay/scanners.rb new file mode 100644 index 0000000..f824f50 --- /dev/null +++ b/lib/coderay/scanners.rb @@ -0,0 +1,23 @@ +require 'strscan' + +module CodeRay + + autoload :WordList, coderay_path('helpers', 'word_list') + + # = Scanners + # + # This module holds the Scanner class and its subclasses. + # For example, the Ruby scanner is named CodeRay::Scanners::Ruby + # can be found in coderay/scanners/ruby. + # + # Scanner also provides methods and constants for the register + # mechanism and the [] method that returns the Scanner class + # belonging to the given lang. + # + # See PluginHost. + module Scanners + extend PluginHost + plugin_path File.dirname(__FILE__), 'scanners' + end + +end -- cgit v1.2.1 From d21348f85036273fd8f370a6a850e1c0440c6b02 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Tue, 22 Oct 2013 03:00:46 +0200 Subject: tweaks --- lib/coderay/scanners.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/coderay/scanners.rb') diff --git a/lib/coderay/scanners.rb b/lib/coderay/scanners.rb index f824f50..8d8156f 100644 --- a/lib/coderay/scanners.rb +++ b/lib/coderay/scanners.rb @@ -16,8 +16,12 @@ module CodeRay # # See PluginHost. module Scanners + extend PluginHost plugin_path File.dirname(__FILE__), 'scanners' + + autoload :Encoder, CodeRay.coderay_path('scanners', 'scanner') + end end -- cgit v1.2.1 From d91c9c6bd5cad4f57e2229638a23a8ecb8ce12af Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Tue, 22 Oct 2013 03:15:44 +0200 Subject: fix --- lib/coderay/scanners.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/coderay/scanners.rb') diff --git a/lib/coderay/scanners.rb b/lib/coderay/scanners.rb index 8d8156f..3c7e594 100644 --- a/lib/coderay/scanners.rb +++ b/lib/coderay/scanners.rb @@ -20,7 +20,7 @@ module CodeRay extend PluginHost plugin_path File.dirname(__FILE__), 'scanners' - autoload :Encoder, CodeRay.coderay_path('scanners', 'scanner') + autoload :Scanner, CodeRay.coderay_path('scanners', 'scanner') end -- cgit v1.2.1