Skip to content

Commit

Permalink
AS gem doesn't depend on nokogiri so shows a nicer error if users hav…
Browse files Browse the repository at this point in the history
…en't installed
  • Loading branch information
spastorino committed Jul 30, 2010
1 parent 95e9ced commit 5132081
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion activesupport/lib/active_support/xml_mini/nokogiri.rb
@@ -1,4 +1,9 @@
require 'nokogiri'
begin
require 'nokogiri'
rescue LoadError => e
$stderr.puts "You don't have nokogiri installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end
require 'active_support/core_ext/object/blank'

# = XmlMini Nokogiri implementation
Expand Down
9 changes: 7 additions & 2 deletions activesupport/lib/active_support/xml_mini/nokogirisax.rb
@@ -1,4 +1,9 @@
require 'nokogiri'
begin
require 'nokogiri'
rescue LoadError => e
$stderr.puts "You don't have nokogiri installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end
require 'active_support/core_ext/object/blank'

# = XmlMini Nokogiri implementation using a SAX-based parser
Expand Down Expand Up @@ -80,4 +85,4 @@ def parse(data)
end
end
end
end
end

0 comments on commit 5132081

Please sign in to comment.