summaryrefslogtreecommitdiff
path: root/lib/rss/parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rss/parser.rb')
-rw-r--r--lib/rss/parser.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb
index 5308211b9d8..e63e06e20dd 100644
--- a/lib/rss/parser.rb
+++ b/lib/rss/parser.rb
@@ -1,5 +1,17 @@
require "forwardable"
-require "open-uri"
+begin
+ require "open-uri"
+rescue LoadError
+ require "uri"
+end
+unless Kernel.methods.include?("URI")
+ module Kernel
+ def URI(uri_str) # :doc:
+ URI.parse(uri_str)
+ end
+ module_function :URI
+ end
+end
require "rss/rss"
@@ -414,7 +426,7 @@ module RSS
end
previous = @last_element
- next_element = klass.__send__(:new, *args)
+ next_element = klass.new(*args)
next_element.do_validate = @do_validate
previous.funcall(:set_next_element, tag_name, next_element)
@last_element = next_element