ruby-net-nntp 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
- 2007-07-02 15:57 +0200 Anton 'tony' Bangratz <anton.bangratz@gmail.com> (d6c2c8c99d26 [tip])
1
+ 2007-07-02 16:25 +0200 Anton 'tony' Bangratz <anton.bangratz@gmail.com> (a75e65c0e31c [tip])
2
+
3
+ * lib/net/nntp.rb, lib/net/nntp/version.rb:
4
+ xover and log bugfix
5
+
6
+ 2007-07-02 15:57 +0200 Anton 'tony' Bangratz <anton.bangratz@gmail.com> (d6c2c8c99d26)
2
7
 
3
8
  * .autotest, .hgignore, Rakefile, lib/net/nntp.rb,
4
9
  lib/net/nntp/version.rb, lib/net/nntp_article.rb, script/console,
data/lib/net/nntp.rb CHANGED
@@ -138,8 +138,12 @@ module Net
138
138
  #
139
139
  def xover(groupname=nil, rest=nil)
140
140
  raise CommandFailedError, 'No group selected' unless @group || groupname
141
+ if @group.nil?
142
+ group(groupname)
143
+ elsif @group.name != groupname
144
+ group(groupname)
145
+ end
141
146
  debug "Selected Group: #{@group.name}"
142
- group(groupname) unless (@group || @group.name == groupname)
143
147
  self.next unless rest
144
148
  prefix = "xover"
145
149
  suffix = numbers_or_id(rest)
@@ -155,8 +159,14 @@ module Net
155
159
  # Issues 'LISTGROUP' command to NNTP Server, and returns raw response. Checks if group has been selected, selects group
156
160
  # otherwise.
157
161
  #
158
- def listgroup(groupname)
159
- group(groupname) unless (@group && @group.name == groupname)
162
+ def listgroup(groupname=nil)
163
+ raise CommandFailedError, 'No group selected' unless @group || groupname
164
+ if @group.nil?
165
+ group(groupname)
166
+ elsif @group.name != groupname
167
+ group(groupname)
168
+ end
169
+ debug "Selected Group: #{@group.name}"
160
170
  send_cmd('listgroup')
161
171
  read_response()
162
172
  end
@@ -307,10 +317,12 @@ module Net
307
317
  response = ''
308
318
  str = ''
309
319
  ra = []
320
+ linecnt = 0
310
321
  loop do
311
322
  str = @socket.readline
312
323
  ra << str
313
- break if force_oneline || (str == ".\r\n" || !str || ONELINE_STATUSES.include?(str[0..2]) )
324
+ break if force_oneline || (str == ".\r\n" || !str || (linecnt == 0 && ONELINE_STATUSES.include?(str[0..2])) )
325
+ linecnt += 1
314
326
  end
315
327
  debug "Response: '#{ra}'"
316
328
  ra
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  class NNTP
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: ruby-net-nntp
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.6
6
+ version: 0.0.7
7
7
  date: 2007-07-02 00:00:00 +02:00
8
8
  summary: Net::XXX style NNTP Library for easy access.
9
9
  require_paths: