summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2007-11-22 15:27:01 +0000
committermurphy <murphy@rubychan.de>2007-11-22 15:27:01 +0000
commit5122b3d9eb3d9abfaf68b89442ce514c85f4d143 (patch)
tree788bbd7928479561544de7c8c26997a351c3029e
parentfce733bc0566b191932663dcb9e70b6bf7de2590 (diff)
downloadcoderay-5122b3d9eb3d9abfaf68b89442ce514c85f4d143.tar.gz
- Ruby 1.9 fixes
- rake commands for jruby and rubinius - absolutized CodeRay::Tokens::ClassOfKind
-rw-r--r--Rakefile8
-rw-r--r--lib/coderay/encoder.rb3
-rw-r--r--lib/coderay/encoders/html.rb2
3 files changed, 11 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index 13de5d7..9ba14ea 100644
--- a/Rakefile
+++ b/Rakefile
@@ -31,6 +31,14 @@ task 'yarv' do
RUBY.replace 'ruby-yarv'
end
+task 'jruby' do
+ RUBY.replace 'jruby'
+end
+
+task 'rubinius' do
+ RUBY.replace 'rbx'
+end
+
if ruby = ENV['ruby']
RUBY.replace ruby
end \ No newline at end of file
diff --git a/lib/coderay/encoder.rb b/lib/coderay/encoder.rb
index 8e67172..e543c8c 100644
--- a/lib/coderay/encoder.rb
+++ b/lib/coderay/encoder.rb
@@ -168,7 +168,8 @@ module CodeRay
# The already created +tokens+ object must be used; it can be a
# TokenStream or a Tokens object.
def compile tokens, options
- tokens.each(&self)
+ tokens.each { |text, kind| token text, kind } # FIXME for Ruby 1.9?
+ #tokens.each(&self)
end
end
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 0c66f68..4981585 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -158,7 +158,7 @@ module Encoders
when :class
@css_style = Hash.new do |h, k|
- c = Tokens::ClassOfKind[k.first]
+ c = CodeRay::Tokens::ClassOfKind[k.first]
if c == :NO_HIGHLIGHT and not hint
h[k.dup] = false
else