Nntp sample code

I’m trying to do this sample (third one): http://nntp.rubyforge.org/ as
follows:

[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ ruby nntp.rb
/home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/nntp.rb:400:in
do_start': private methodopen’ called for
Net::InternetMessageIO:Class
(NoMethodError)
from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/
nntp.rb:380:in start' from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/nntp-1.0.0/lib/ nntp.rb:321:instart’
from nntp.rb:6:in `’
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ cat nntp.rb
require ‘rubygems’
require ‘nntp’

newsgroup = ‘gmane.comp.lang.ruby.general’

Net::NNTP.start(‘news.gmane.org’, 119) do |nntp|
message_ids = nntp.listgroup(newsgroup)
nntp.group(newsgroup)
message_ids[1].each do |id|
nntp.head(id).each do |header|
header.each { |line| puts(line) if line.index(‘Subject:’) }
end
end
end
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ type rvm | head -1
rvm is a function
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ rvm --version

rvm 1.10.3 by Wayne E. Seguin [email protected], Michal P.
[email protected] [https://rvm.beginrescueend.com/]

[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ gem --version
1.8.19
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ ruby --version
ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$
[email protected]:~/ruby/nntp$ gem list --local | grep nntp
nntp (1.0.0)
ruby-net-nntp (1.0.0)
[email protected]:~/ruby/nntp$

now when I look at http://rubydoc.info/stdlib/net/1.9.2/Net/
InternetMessageIO I don’t even see method “open,” so was that method
removed from the class? Or, is there a problem with the sample code?
Or
my ruby install? Odd that sample code gives an error, like the library
is the problem.

thanks,

Thufir

On Thu, 22 Mar 2012 23:55:09 +0900, thufir wrote:

I’m trying to do this sample (third one): http://nntp.rubyforge.org/ as
follows:

Aha, it is, or appears to be, a bug:

http://rubyforge.org/tracker/index.php?
func=detail&aid=28116&group_id=706&atid=2803

So, in the interim, how do you use nntp? I’m not proficient enough to
troubleshoot the API, unfortunately.

-Thufir

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs