cardmagic / simple-rss

A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.
https://github.com/cardmagic/simple-rss
Other
225 stars 68 forks source link

private method `link' called for #<SimpleRSS:0x9aaf59c> in ruby 1.9.2 #6

Open murugaraj opened 14 years ago

murugaraj commented 14 years ago

In ruby 1.9.2 Calling rss.channel.link or rss.channel.title throwing the below error.

Please Fix.

ruby-1.9.2-p0 > rss.channel.link NoMethodError: private method link' called for #<SimpleRSS:0x9aaf59c> from (irb):29 from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:44:instart' from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:8:in start' from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands.rb:23:in<top (required)>' from script/rails:6:in require' from script/rails:6:in

' ruby-1.9.2-p0 > rss.channel.title NoMethodError: private method title' called for #<SimpleRSS:0x9aaf59c> from (irb):30 from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:44:instart' from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:8:in start' from /home/dckap/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands.rb:23:in<top (required)>' from script/rails:6:in require' from script/rails:6:in
'

eeewxj commented 12 years ago

hi,I have found the point.You need to change file "simple-rss.rb" In ruby 1.9.2 ,when you add method to class in the scope of "private", the method will be private. So if you shift line 72,ie 'private' to line 137 after method 'parse',it works well.