From 469dba8c6378fb62ebf12c4a2f32b6be433bb16e Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Mon, 11 Mar 2013 02:23:22 +0100 Subject: added Sass scanner (work in progress) --- lib/coderay/helpers/file_type.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 637001b..b06b9bc 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -116,6 +116,7 @@ module CodeRay 'rpdf' => :ruby, 'ru' => :ruby, 'rxml' => :ruby, + 'sass' => :sass, # 'sch' => :scheme, 'sql' => :sql, # 'ss' => :scheme, -- cgit v1.2.1 From 68d9a901b27eb2b648488f9b147d6d3eedefde04 Mon Sep 17 00:00:00 2001 From: Alexandre Vezina Date: Sat, 23 Mar 2013 13:46:01 -0400 Subject: Support for phtml files --- lib/coderay/helpers/file_type.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 637001b..b137448 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -99,6 +99,7 @@ module CodeRay 'mab' => :ruby, 'pas' => :delphi, 'patch' => :diff, + 'phtml' => :html, 'php' => :php, 'php3' => :php, 'php4' => :php, -- cgit v1.2.1 From 2f285f3d2803ef9742af240a1e5935a2dfc915fc Mon Sep 17 00:00:00 2001 From: Alexandre Vezina Date: Wed, 17 Apr 2013 14:45:16 -0400 Subject: PHP is a better highlight for phtml files --- lib/coderay/helpers/file_type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index b137448..f52f17e 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -99,7 +99,7 @@ module CodeRay 'mab' => :ruby, 'pas' => :delphi, 'patch' => :diff, - 'phtml' => :html, + 'phtml' => :php, 'php' => :php, 'php3' => :php, 'php4' => :php, -- cgit v1.2.1 From 737fb3608c92506a573a79f611b94ff5d5da18e6 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 9 Jun 2013 07:25:15 +0200 Subject: do not warn about plugin fallback --- lib/coderay/helpers/plugin.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 137c1ab..dd4e830 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -180,7 +180,6 @@ module CodeRay rescue LoadError => boom if @plugin_map_loaded if h.has_key?(:default) - warn '%p could not load plugin %p; falling back to %p' % [self, id, h[:default]] h[:default] else raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom] -- cgit v1.2.1 From 60d03a22df232528d7cc1b6a11e0ecc68171873a Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 9 Jun 2013 21:17:31 +0200 Subject: add .xaml file type (use XML scanner) --- lib/coderay/helpers/file_type.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 12556d0..a5d83ff 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -118,10 +118,9 @@ module CodeRay 'ru' => :ruby, 'rxml' => :ruby, 'sass' => :sass, - # 'sch' => :scheme, 'sql' => :sql, - # 'ss' => :scheme, 'tmproj' => :xml, + 'xaml' => :xml, 'xhtml' => :html, 'xml' => :xml, 'yaml' => :yaml, -- cgit v1.2.1 From 5a833b265c5cb918f906fb1047c0dc65e539260f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Mon, 10 Jun 2013 06:09:59 +0200 Subject: always load the plugin map --- lib/coderay/helpers/plugin.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lib/coderay/helpers') diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index dd4e830..d14c5a9 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -131,7 +131,7 @@ module CodeRay # A Hash of plugion_id => Plugin pairs. def plugin_hash - @plugin_hash ||= make_plugin_hash + @plugin_hash ||= (@plugin_hash = make_plugin_hash).tap { load_plugin_map } end # Returns an array of all .rb files in the plugin path. @@ -158,7 +158,6 @@ module CodeRay # This is done automatically when plugin_path is called. def load_plugin_map mapfile = path_to '_map' - @plugin_map_loaded = true if File.exist? mapfile require mapfile true @@ -171,22 +170,16 @@ module CodeRay # Return a plugin hash that automatically loads plugins. def make_plugin_hash - @plugin_map_loaded ||= false Hash.new do |h, plugin_id| id = validate_id(plugin_id) path = path_to id begin require path rescue LoadError => boom - if @plugin_map_loaded - if h.has_key?(:default) - h[:default] - else - raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom] - end + if h.has_key?(:default) + h[:default] else - load_plugin_map - h[plugin_id] + raise PluginNotFound, '%p could not load plugin %p: %s' % [self, id, boom] end else # Plugin should have registered by now @@ -270,7 +263,6 @@ module CodeRay end def aliases - plugin_host.load_plugin_map plugin_host.plugin_hash.inject [] do |aliases, (key, _)| aliases << key if plugin_host[key] == self aliases -- cgit v1.2.1