summaryrefslogtreecommitdiff
path: root/lib/rss
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-02 14:53:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-02 14:53:02 +0000
commitf42208b70cea09612f741523bb84ca0103934352 (patch)
tree6d1723d76ff18cb42093f13789963dbac3214a16 /lib/rss
parentb6a9db500539dba460d91540f22c8e9ea602c280 (diff)
* lib: do not use __send__ to access private methods. [ruby-dev:26935]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss')
-rw-r--r--lib/rss/maker/content.rb4
-rw-r--r--lib/rss/maker/dublincore.rb4
-rw-r--r--lib/rss/maker/image.rb8
-rw-r--r--lib/rss/maker/syndication.rb4
-rw-r--r--lib/rss/maker/trackback.rb8
-rw-r--r--lib/rss/parser.rb2
-rw-r--r--lib/rss/rss.rb2
-rw-r--r--lib/rss/trackback.rb2
8 files changed, 17 insertions, 17 deletions
diff --git a/lib/rss/maker/content.rb b/lib/rss/maker/content.rb
index 96f3ccb6d9a..18590d0cf8b 100644
--- a/lib/rss/maker/content.rb
+++ b/lib/rss/maker/content.rb
@@ -10,8 +10,8 @@ module RSS
::RSS::ContentModel::ELEMENTS.each do |element|
klass.add_need_initialize_variable(element)
klass.add_other_element(element)
- klass.__send__(:attr_accessor, element)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_accessor :#{element}
def setup_#{element}(rss, current)
if #{element} and current.respond_to?(:#{element}=)
current.#{element} = @#{element} if @#{element}
diff --git a/lib/rss/maker/dublincore.rb b/lib/rss/maker/dublincore.rb
index 29da1c39d9d..e038378329e 100644
--- a/lib/rss/maker/dublincore.rb
+++ b/lib/rss/maker/dublincore.rb
@@ -18,8 +18,8 @@ module RSS
klass.add_need_initialize_variable(full_plural_name,
"make_#{full_plural_name}")
klass.add_other_element(full_plural_name)
- klass.__send__(:attr_accessor, full_plural_name)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_accessor :#{full_plural_name}
def make_#{full_plural_name}
#{full_plural_klass_name}.new(@maker)
end
diff --git a/lib/rss/maker/image.rb b/lib/rss/maker/image.rb
index 9e3772f09cf..85d9d9c95ee 100644
--- a/lib/rss/maker/image.rb
+++ b/lib/rss/maker/image.rb
@@ -11,8 +11,8 @@ module RSS
name = "#{RSS::IMAGE_PREFIX}_item"
klass.add_need_initialize_variable(name, "make_#{name}")
klass.add_other_element(name)
- klass.__send__(:attr_reader, name)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_reader :#{name}
def setup_#{name}(rss, current)
if @#{name}
@#{name}.to_rss(rss, current)
@@ -52,8 +52,8 @@ EOC
name = "#{RSS::IMAGE_PREFIX}_favicon"
klass.add_need_initialize_variable(name, "make_#{name}")
klass.add_other_element(name)
- klass.__send__(:attr_reader, name)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_reader :#{name}
def setup_#{name}(rss, current)
if @#{name}
@#{name}.to_rss(rss, current)
diff --git a/lib/rss/maker/syndication.rb b/lib/rss/maker/syndication.rb
index 72d00c63ead..3717086257a 100644
--- a/lib/rss/maker/syndication.rb
+++ b/lib/rss/maker/syndication.rb
@@ -10,8 +10,8 @@ module RSS
::RSS::SyndicationModel::ELEMENTS.each do |element|
klass.add_need_initialize_variable(element)
klass.add_other_element(element)
- klass.__send__(:attr_accessor, element)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_accessor :#{element}
def setup_#{element}(rss, current)
if #{element} and current.respond_to?(:#{element}=)
current.#{element} = @#{element} if @#{element}
diff --git a/lib/rss/maker/trackback.rb b/lib/rss/maker/trackback.rb
index 3df21924ddb..b334079582d 100644
--- a/lib/rss/maker/trackback.rb
+++ b/lib/rss/maker/trackback.rb
@@ -11,8 +11,8 @@ module RSS
name = "#{RSS::TRACKBACK_PREFIX}_ping"
klass.add_need_initialize_variable(name)
klass.add_other_element(name)
- klass.__send__(:attr_accessor, name)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_accessor :#{name}
def setup_#{name}(rss, current)
if #{name} and current.respond_to?(:#{name}=)
current.#{name} = #{name}
@@ -23,8 +23,8 @@ module RSS
name = "#{RSS::TRACKBACK_PREFIX}_abouts"
klass.add_need_initialize_variable(name, "make_#{name}")
klass.add_other_element(name)
- klass.__send__(:attr_accessor, name)
- klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
+ attr_accessor :#{name}
def make_#{name}
self.class::TrackBackAbouts.new(self)
end
diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb
index df268da1e75..6b3fe064193 100644
--- a/lib/rss/parser.rb
+++ b/lib/rss/parser.rb
@@ -409,7 +409,7 @@ module RSS
next_element.do_validate = @do_validate
prefix = ""
prefix << "#{klass.required_prefix}_" if klass.required_prefix
- previous.__send__(:set_next_element, prefix, tag_name, next_element)
+ previous.instance_eval {set_next_element(prefix, tag_name, next_element)}
@last_element = next_element
@proc_stack.push Proc.new { |text, tags|
p(@last_element.class) if DEBUG
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index c200f8956a3..0d3da8b51a1 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -659,7 +659,7 @@ EOC
if parent.respond_to?(plural_name)
target = parent.__send__(plural_name)
__send__(plural_name).each do |elem|
- elem.__send__("setup_maker", target)
+ elem.setup_maker(target)
end
end
end
diff --git a/lib/rss/trackback.rb b/lib/rss/trackback.rb
index 973a1035d17..6c083504ae8 100644
--- a/lib/rss/trackback.rb
+++ b/lib/rss/trackback.rb
@@ -38,7 +38,7 @@ module RSS
super
unless klass.class == Module
- klass.__send__(:include, TrackBackUtils)
+ klass.module_eval {include TrackBackUtils}
%w(ping).each do |name|
var_name = "#{TRACKBACK_PREFIX}_#{name}"