Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* lib/facebooker/parser.rb: only requiring rexml if we really need it

  • Loading branch information...
commit 73fa2694a7b47746577ef132e1f84f2becb6edbd 1 parent bc3b2a4
@tenderlove tenderlove authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/facebooker/parser.rb
View
10 lib/facebooker/parser.rb
@@ -1,9 +1,9 @@
-require 'rexml/document'
require 'facebooker/session'
begin
- require 'nokogiri'
+ require 'nokogiri'
rescue Exception
+ require 'rexml/document'
end
module Facebooker
@@ -29,8 +29,10 @@ def text?
end
end
- ::REXML::Element.__send__(:include, REXMLElementExtensions)
- ::REXML::Text.__send__(:include, REXMLTextExtensions)
+ if Object.const_defined?(:REXML) && REXML.const_defined?(:Element)
+ ::REXML::Element.__send__(:include, REXMLElementExtensions)
+ ::REXML::Text.__send__(:include, REXMLTextExtensions)
+ end
def self.parse(method, data)
Errors.process(data)
Please sign in to comment.
Something went wrong with that request. Please try again.