astropanic
7/23/2011 - 4:24 PM

Extend bb-ruby to understand the [ruby]...[/ruby] tag

Extend bb-ruby to understand the [ruby]...[/ruby] tag

#config/initializers/bb-code.rb
module BBRuby
  @@tags["Ruby"] = [
    /\[ruby\](.*?)\[\/ruby\]/mi,
    '<pre class="syntax ruby">\1</pre>',
    'Ruby code',
    '[ruby]User.last.inspect[/ruby]',
    :ruby]
end