Skip to content

Commit

Permalink
Added a NotCompiledError to give a friendlier message when people jus…
Browse files Browse the repository at this point in the history
…t unpack RedCloth into their projects. [#131 state:resolved]
  • Loading branch information
jgarber committed Mar 17, 2009
1 parent 762bf40 commit d363184
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,5 +1,7 @@
=== Edge

* Added a NotCompiledError to give a friendlier message when people just unpack RedCloth into their projects. [Jason Garber]

* Added a pure-ruby version of the parser for times when you can't compile the C or Java extensions. You should avoid using it if at all possible because it is 32 times slower (and has some other problems, too)! [Jason Garber]

* Ignore spaces and tabs on blank lines between blocks. #120 [Jason Garber]
Expand Down
10 changes: 9 additions & 1 deletion lib/redcloth.rb
Expand Up @@ -7,7 +7,15 @@
# appears to be fixed in Edge Rails [51e4106].
Object.send(:remove_const, :RedCloth) if Object.const_defined?(:RedCloth) && RedCloth.is_a?(Class)

require 'redcloth_scan'
module RedCloth
class NotCompiledError < LoadError; end
end

begin
require 'redcloth_scan'
rescue LoadError
raise RedCloth::NotCompiledError, "RedCloth is extremely fast but must be compiled first. Installing the RedCloth gem is the easiest method."
end
require 'redcloth/version'
require 'redcloth/textile_doc'
require 'redcloth/formatters/base'
Expand Down

0 comments on commit d363184

Please sign in to comment.