summaryrefslogtreecommitdiff
path: root/lib/coderay/helpers
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2008-09-21 16:25:44 +0000
committermurphy <murphy@rubychan.de>2008-09-21 16:25:44 +0000
commit9a5f5e6217db0b7689b64ca0892feacf32be3d66 (patch)
tree98a25e39c452f0d7d1268810b014d929ab9930cc /lib/coderay/helpers
parent41acfacb91970c8fa4e8b34f35c718eb329a3733 (diff)
downloadcoderay-9a5f5e6217db0b7689b64ca0892feacf32be3d66.tar.gz
New: *Java Scanner* (closes #42).
* Based on JavaScript, does a good job, but may need more polish. * Java::BuiltinTypes::List is a helper constant that contains 2389 Java types. ** The list was generated from TextMate's Java bundle with the help of SimpleRegexpScanner. * I added the JRuby core classes as example code for testing (1.8 MB) JavaScript Scanner: * Fixed recognition of floats and algebraic signs. ** Still needs work - we need to distinguish i-1 from i+-1. More changes: * New: "SimpleRegexpScanner":http://murfy.de/simple-regexp-scanner * Added new token class :annotation along with CSS styles. ** Should be useful for Python, too. * coderay_suite warns if no scanner was found for this language. * PluginHost#default can be called without parameter (will return default id)
Diffstat (limited to 'lib/coderay/helpers')
-rw-r--r--lib/coderay/helpers/file_type.rb2
-rw-r--r--lib/coderay/helpers/plugin.rb10
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb
index f7c5f7d..e955b9d 100644
--- a/lib/coderay/helpers/file_type.rb
+++ b/lib/coderay/helpers/file_type.rb
@@ -115,7 +115,7 @@ end
if $0 == __FILE__
$VERBOSE = true
- eval DATA.read, nil, $0, __LINE__+4
+ eval DATA.read, nil, $0, __LINE__ + 4
end
__END__
diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb
index e1a945f..d03dcfb 100644
--- a/lib/coderay/helpers/plugin.rb
+++ b/lib/coderay/helpers/plugin.rb
@@ -135,9 +135,13 @@ module PluginHost
# map :navy => :dark_blue
# default :gray
# end
- def default id
- id = validate_id id
- plugin_hash[nil] = id
+ def default id = nil
+ if id
+ id = validate_id id
+ plugin_hash[nil] = id
+ else
+ plugin_hash[nil]
+ end
end
# Every plugin must register itself for one or more