fall back to BlueCloth if rdiscount isn't available
This commit is contained in:
parent
5a544ca5de
commit
606087986e
@ -11,6 +11,11 @@ rescue LoadError
|
||||
warn "warn: #$!. trying again with rubygems"
|
||||
require 'rubygems'
|
||||
retry
|
||||
else
|
||||
require 'bluecloth'
|
||||
Markdown = BlueCloth
|
||||
$LOADED_FEATURES << 'rdiscount.rb'
|
||||
retry
|
||||
end
|
||||
when /rocco/
|
||||
if !$:.include?(libdir)
|
||||
|
14
lib/rocco.rb
14
lib/rocco.rb
@ -30,9 +30,17 @@
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
# The [rdiscount](http://github.com/rtomayko/rdiscount) library is
|
||||
# required for Markdown processing.
|
||||
require 'rdiscount'
|
||||
# We'll need a Markdown library. [RDiscount][rd], if we're lucky. Otherwise,
|
||||
# issue a warning and fall back on using BlueCloth.
|
||||
#
|
||||
# [rd]: http://github.com/rtomayko/rdiscount
|
||||
begin
|
||||
require 'rdiscount'
|
||||
rescue LoadError => boom
|
||||
warn "warn: #{boom}. trying bluecloth"
|
||||
require 'bluecloth'
|
||||
Markdown = BlueCloth
|
||||
end
|
||||
|
||||
# We use [{{ mustache }}](http://defunkt.github.com/mustache/) for
|
||||
# templating.
|
||||
|
Loading…
Reference in New Issue
Block a user