blob: 39d310d53e1a95adf993b1534aaa6c8beb446691 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
require 'coderay'
begin
CodeRay::Encoders::YAML
rescue
puts 'CodeRay::Encoders::YAML is not defined; you must load it first.'
end
yaml_encoder = CodeRay::Encoders[:yaml]
print 'Now it is loaded: '
p yaml_encoder
puts 'See?'
tokens_encoder = require_plugin 'CodeRay::Encoders/tokens'
print 'Require is also possible: '
p tokens_encoder
puts 'See?'
puts 'Now load some mapped encoders: stats and plain.'
require_plugin 'CodeRay::Encoders/stats'
require_plugin 'CodeRay::Encoders/plain'
puts 'Require all Encoders:'
CodeRay::Encoders.load_all
p CodeRay::Encoders.plugin_hash.sort_by { |k,v| k.to_s }
|