aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/rexmlparser.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-16 04:51:15 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-16 04:51:15 +0000
commit891ad83098840851fb16f7ec4a664fc664792df0 (patch)
treee1d33d49cca9875ec515d3ee4ed0dc2686432941 /lib/rss/rexmlparser.rb
parent0ebac90b0ebb07ad2aa99080c8509559a7ddc74d (diff)
downloadruby-891ad83098840851fb16f7ec4a664fc664792df0.tar.gz
* lib/rss/: untabified.
* test/rss/: untabified. * lib/rss/0.9.rb (RSS::Rss#to_s): inent -> indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/rexmlparser.rb')
-rw-r--r--lib/rss/rexmlparser.rb74
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/rss/rexmlparser.rb b/lib/rss/rexmlparser.rb
index 13ab0e277b..375b7794fb 100644
--- a/lib/rss/rexmlparser.rb
+++ b/lib/rss/rexmlparser.rb
@@ -3,45 +3,45 @@ require "rexml/streamlistener"
/\A(\d+)\.(\d+)(?:\.\d+)+\z/ =~ REXML::Version
if ([$1.to_i, $2.to_i] <=> [2, 5]) < 0
- raise LoadError, "needs REXML 2.5 or later (#{REXML::Version})"
+ raise LoadError, "needs REXML 2.5 or later (#{REXML::Version})"
end
module RSS
-
- class REXMLParser < BaseParser
-
- private
-
- def listener
- REXMLListener
- end
-
- def _parse
- begin
- REXML::Document.parse_stream(@rss, @listener)
- rescue RuntimeError => e
- raise NotWellFormedError.new{e.message}
- rescue REXML::ParseException => e
- context = e.context
- line = context[0] if context
- raise NotWellFormedError.new(line){e.message}
- end
- end
-
- end
-
- class REXMLListener < BaseListener
-
- include REXML::StreamListener
- include ListenerMixin
-
- def xmldecl(version, encoding, standalone)
- super
- # Encoding is converted to UTF-8 when REXML parse XML.
- @encoding = 'UTF-8'
- end
-
- alias_method(:cdata, :text)
- end
+
+ class REXMLParser < BaseParser
+
+ private
+
+ def listener
+ REXMLListener
+ end
+
+ def _parse
+ begin
+ REXML::Document.parse_stream(@rss, @listener)
+ rescue RuntimeError => e
+ raise NotWellFormedError.new{e.message}
+ rescue REXML::ParseException => e
+ context = e.context
+ line = context[0] if context
+ raise NotWellFormedError.new(line){e.message}
+ end
+ end
+
+ end
+
+ class REXMLListener < BaseListener
+
+ include REXML::StreamListener
+ include ListenerMixin
+
+ def xmldecl(version, encoding, standalone)
+ super
+ # Encoding is converted to UTF-8 when REXML parse XML.
+ @encoding = 'UTF-8'
+ end
+
+ alias_method(:cdata, :text)
+ end
end