1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rss: rss/parser.rb is always required.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2004-01-28 15:19:56 +00:00
parent 202bf6618f
commit 46f6b20268
8 changed files with 47 additions and 59 deletions

View file

@ -1,3 +1,7 @@
Thu Jan 29 00:00:46 2004 Kouhei Sutou <kou@cozmixng.org>
* lib/rss: rss/parser.rb is always required.
Wed Jan 28 15:09:14 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/rss/*.rb: remove "test/" prefix.

View file

@ -1,4 +1,4 @@
require "rss/rss"
require "rss/parser"
module RSS
@ -413,26 +413,22 @@ EOT
end
if const_defined?(:BaseListener)
RSS09::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, nil, "#{x}=")
end
RSS09::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, nil, "#{x}=")
end
if const_defined?(:ListenerMixin)
module ListenerMixin
private
def start_rss(tag_name, prefix, attrs, ns)
check_ns(tag_name, prefix, ns, nil)
@rss = Rss.new(attrs['version'], @version, @encoding, @standalone)
@last_element = @rss
@proc_stack.push Proc.new { |text, tags|
@rss.validate_for_stream(tags) if @do_validate
}
end
module ListenerMixin
private
def start_rss(tag_name, prefix, attrs, ns)
check_ns(tag_name, prefix, ns, nil)
@rss = Rss.new(attrs['version'], @version, @encoding, @standalone)
@last_element = @rss
@proc_stack.push Proc.new { |text, tags|
@rss.validate_for_stream(tags) if @do_validate
}
end
end
end

View file

@ -1,4 +1,4 @@
require "rss/rss"
require "rss/parser"
module RSS
@ -643,10 +643,8 @@ EOT
end
if const_defined?(:BaseListener)
RSS10::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, URI, "#{x}=")
end
RSS10::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, URI, "#{x}=")
end
end

View file

@ -123,26 +123,22 @@ EOT
end
if const_defined?(:BaseListener)
RSS09::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, Rss::URI, "#{x}=")
end
RSS09::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x, Rss::URI, "#{x}=")
end
if const_defined?(:ListenerMixin)
module ListenerMixin
private
def start_rss(tag_name, prefix, attrs, ns)
check_ns(tag_name, prefix, ns, Rss::URI)
@rss = Rss.new(attrs['version'], @version, @encoding, @standalone)
@last_element = @rss
@proc_stack.push Proc.new { |text, tags|
@rss.validate_for_stream(tags) if @do_validate
}
end
module ListenerMixin
private
def start_rss(tag_name, prefix, attrs, ns)
check_ns(tag_name, prefix, ns, Rss::URI)
@rss = Rss.new(attrs['version'], @version, @encoding, @standalone)
@last_element = @rss
@proc_stack.push Proc.new { |text, tags|
@rss.validate_for_stream(tags) if @do_validate
}
end
end
end

View file

@ -37,11 +37,9 @@ module RSS
class Item; include ContentModel; end
end
if const_defined? :BaseListener
prefix_size = CONTENT_PREFIX.size + 1
ContentModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], CONTENT_URI, "#{x}=")
end
prefix_size = CONTENT_PREFIX.size + 1
ContentModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], CONTENT_URI, "#{x}=")
end
end

View file

@ -46,11 +46,9 @@ module RSS
class Textinput; include DublincoreModel; end
end
if const_defined? :BaseListener
prefix_size = DC_PREFIX.size + 1
DublincoreModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], DC_URI, "#{x}=")
end
prefix_size = DC_PREFIX.size + 1
DublincoreModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], DC_URI, "#{x}=")
end
end

View file

@ -71,11 +71,9 @@ module RSS
class Channel; include SyndicationModel; end
end
if const_defined? :BaseListener
prefix_size = SY_PREFIX.size + 1
SyndicationModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], SY_URI, "#{x}=")
end
prefix_size = SY_PREFIX.size + 1
SyndicationModel::ELEMENTS.each do |x|
BaseListener.install_get_text_element(x[prefix_size..-1], SY_URI, "#{x}=")
end
end

View file

@ -9,10 +9,10 @@ module RSS
[file, line]
end
def html_escape(s)
s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
end
alias h html_escape
def html_escape(s)
s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
end
alias h html_escape
end