Sha256: b3db4e888834210dbb422395760c2bfeddb96b8c92e8417cb551303a3c411a2c

Contents?: true

Size: 630 Bytes

Versions: 7

Compression:

Stored size: 630 Bytes

Contents

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 }

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
coderay-0.7.2.168 ./demo/demo_load_encoder.rb
coderay-0.5.0.115 ./demo/demo_load_encoder.rb
coderay-0.7.2.165 ./demo/demo_load_encoder.rb
coderay-0.5.0.121 ./demo/demo_load_encoder.rb
coderay-0.7.2.176 ./demo/demo_load_encoder.rb
coderay-0.5.0.100 ./demo/demo_load_encoder.rb
coderay-0.7.1.147 ./demo/demo_load_encoder.rb