require 'coderay' def highlight_file( file, options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan_file(file, :ruby).div(:line_numbers => :table, :css => :class) end end def highlight_me( options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan_file(__FILE__, :ruby).div(:line_numbers => :table, :css => :class) end end def highlight_data( data, options = {} ) id = options[:id] || "source" display = options[:display] || "" div( :id => id, :style => "display:#{display};" ) do CodeRay.scan(data, :ruby).div(:line_numbers => :table, :css => :class) end end