lib/html/pipeline.rb in html-pipeline-2.7.0 vs lib/html/pipeline.rb in html-pipeline-2.7.1
- old
+ new
@@ -42,9 +42,15 @@
autoload :TextileFilter, 'html/pipeline/textile_filter'
autoload :TableOfContentsFilter, 'html/pipeline/toc_filter'
autoload :TextFilter, 'html/pipeline/text_filter'
class MissingDependencyError < LoadError; end
+ def self.require_dependency(name, requirer)
+ require name
+ rescue LoadError => e
+ raise MissingDependencyError,
+ "Missing dependency '#{name}' for #{requirer}. See README.md for details.\n#{e.class.name}: #{e}"
+ end
# Our DOM implementation.
DocumentFragment = Nokogiri::HTML::DocumentFragment
# Parse a String into a DocumentFragment object. When a DocumentFragment is