summaryrefslogtreecommitdiff
path: root/sample/simple.rb
blob: a3129b01ac97a86ae33d82f6b8855d321ef112d9 (plain)
1
2
3
4
5
6
7
8
9
10

# Load CodeRay
# If this doesn't work, try ruby -rubygems.
require 'coderay'

# Generate HTML page for Ruby code.
page = CodeRay.scan("puts 'Hello, world!'", :ruby).span

# Print it
puts page