summaryrefslogtreecommitdiff
path: root/test/samples/cache.rb
blob: 0c0b8478a1fe6637076fa386e5d9ff6a2fe011ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require 'coderay'

html_encoder = CodeRay.encoder :html

scanner = Hash.new do |h, lang|
	h[lang] = CodeRay.scanner lang
end

for lang in [:ruby, :html]
	tokens = scanner[lang].tokenize 'test <test>'
	puts html_encoder.encode_tokens(tokens)
end