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