ruby-net-nntp 0.2.2 → 1.0.0
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 +145 -128
- data/CHANGELOG.debian +5 -0
- data/Manifest.txt +37 -0
- data/README.txt +69 -0
- data/Rakefile +28 -0
- data/build-stamp +0 -0
- data/lib/net/nntp.rb +261 -327
- data/lib/net/nntp/request.rb +840 -0
- data/lib/net/nntp/response.rb +731 -0
- data/lib/net/nntp/version.rb +2 -1
- data/script/console +12 -0
- data/spec/net/nntp/request_spec.rb +771 -0
- data/spec/net/nntp/response_spec.rb +994 -0
- data/spec/net/nntp_spec.rb +634 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +28 -0
- data/spec/stories/all.rb +2 -0
- data/spec/stories/helper.rb +17 -0
- data/spec/stories/net/nntp.rb +7 -0
- data/spec/stories/net/nntp.story +12 -0
- data/spec/stories/steps/nntp.rb +18 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +126 -0
- data/tasks/git.rake +41 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/mercurial.rake +6 -0
- data/tasks/notes.rake +28 -0
- data/tasks/pallet.rake +17 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +268 -0
- data/tasks/spec.rake +55 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- metadata +57 -33
- data/README +0 -46
- data/lib/net/nntp/article.rb +0 -188
- data/lib/net/nntp/group.rb +0 -83
- data/test/functional/test_nntp.rb +0 -288
- data/test/mock/mock_socket.rb +0 -359
- data/test/unit/test_nntp_article.rb +0 -98
- data/test/unit/test_nntp_group.rb +0 -60
data/CHANGELOG
CHANGED
@@ -1,177 +1,194 @@
|
|
1
|
-
2008-
|
1
|
+
2008-06-04 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
2
2
|
|
3
|
-
*
|
4
|
-
test/functional/test_nntp.rb, test/mock/mock_socket.rb:
|
5
|
-
doc fix, connected? method, code coverage
|
3
|
+
* fixed packaging tasks
|
6
4
|
|
7
|
-
|
8
|
-
response
|
9
|
-
* added acknowledgments to documentation
|
10
|
-
* added connected? method
|
11
|
-
* added more tests for better coverage
|
5
|
+
2008-06-02 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
12
6
|
|
13
|
-
|
7
|
+
* branch merges
|
14
8
|
|
15
|
-
*
|
16
|
-
|
17
|
-
Bugfix release
|
9
|
+
* streamlined process request - asks responses more, no more case
|
10
|
+
based on classes
|
18
11
|
|
19
|
-
|
20
|
-
- fixed body parsing bug, closing #4
|
12
|
+
* merged stuff in
|
21
13
|
|
22
|
-
|
14
|
+
2008-06-02 Jürgen Strobel <strobel@inqnet.at>
|
23
15
|
|
24
|
-
*
|
25
|
-
test/functional/test_nntp.rb:
|
26
|
-
added newnews command, response_timeout (used only in xover at the
|
27
|
-
moment)
|
16
|
+
* Ensure close after block given to ctor.
|
28
17
|
|
29
|
-
|
30
|
-
* added response_timeout variable
|
31
|
-
* patched xover to use response_timeout variable instead of static
|
32
|
-
value
|
18
|
+
2008-06-02 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
33
19
|
|
34
|
-
|
20
|
+
* streamlinging processing requests: Authinfo, Post, Ihave
|
35
21
|
|
36
|
-
*
|
37
|
-
fixed encoding and header parsing bugs
|
38
|
-
* lib/net/nntp.rb: fixed encoding ('..') of lines on
|
39
|
-
fetching
|
40
|
-
* lib/net/nntp/article.rb: fixed header parsing regexp
|
22
|
+
* removed gtk and notify stuff from .autotest
|
41
23
|
|
42
|
-
|
24
|
+
* added connection closing, Quit and reconnect behaviour
|
43
25
|
|
44
|
-
*
|
45
|
-
lib/net/nntp/group.rb, lib/net/nntp/version.rb,
|
46
|
-
test/mock/mock_socket.rb, test/unit/test_nntp_article.rb,
|
47
|
-
test/unit/test_nntp_group.rb:
|
48
|
-
NNTP can QUIT, Article redesign: parse HEAD, BODY and ARTICLE,
|
49
|
-
renamed 'id' to 'number', headers and body along with proxies added
|
50
|
-
- added QUIT to Net::NNTP
|
51
|
-
- added parse from HEAD, BODY and ARTICLE to Net::NNTP::Article
|
52
|
-
(factory)
|
53
|
-
- redesigned Net::NNTP::Article: + separate headers
|
54
|
-
and body attributes + including proxies to mimick
|
55
|
-
old attributes, deprecated + renamed the conflicting
|
56
|
-
'id' attribute to 'number'
|
57
|
-
- improved documentation
|
26
|
+
* small bug fixes, posting processing redone
|
58
27
|
|
59
|
-
|
28
|
+
2008-05-31 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
60
29
|
|
61
|
-
*
|
62
|
-
lib/net/nntp/version.rb, lib/net/nntp_article.rb,
|
63
|
-
lib/net/nntp_group.rb, test/functional/test_nntp.rb,
|
64
|
-
test/mock/mock_socket.rb:
|
65
|
-
fixed overview.fmt, fixed logging
|
66
|
-
- fixed overview.fmt bug
|
67
|
-
- fixed logging for autotest/test
|
30
|
+
* fixed major bug (CRLF instead of LF (system-dependant)
|
68
31
|
|
69
|
-
|
32
|
+
2008-05-28 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
70
33
|
|
71
|
-
*
|
72
|
-
new release;version fix
|
34
|
+
* removed unused code
|
73
35
|
|
74
|
-
|
36
|
+
* added post and ihave specs and proxies
|
75
37
|
|
76
|
-
|
77
|
-
bugfix read_response multiline read - introduced with last release
|
38
|
+
2008-05-27 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
78
39
|
|
79
|
-
|
40
|
+
* more documentation
|
80
41
|
|
81
|
-
*
|
82
|
-
|
42
|
+
* added more proxies for old functionality - will still break old
|
43
|
+
code.
|
83
44
|
|
84
|
-
|
45
|
+
2008-05-24 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
85
46
|
|
86
|
-
*
|
87
|
-
|
88
|
-
test/unit/test_nntp_group.rb:
|
89
|
-
fixed tests, fixed tabs, fixed xhdr bug and api, fixed chomping of
|
90
|
-
results
|
47
|
+
* added command proxies for list, next, last, group; fixed
|
48
|
+
documentation; fixed ListInformationFollows and GroupListResponse
|
91
49
|
|
92
|
-
|
50
|
+
2008-05-21 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
93
51
|
|
94
|
-
*
|
95
|
-
new version; new release
|
52
|
+
* more documentation added
|
96
53
|
|
97
|
-
|
54
|
+
* fixed more documentation, fixed DateResponse
|
98
55
|
|
99
|
-
*
|
100
|
-
bugfixes: read_response response detection only on first line,
|
101
|
-
listgroup accepting no group (error if none selected)
|
56
|
+
* fixed some documentation, got rid of body_proc, using body now.
|
102
57
|
|
103
|
-
|
58
|
+
2008-05-20 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
104
59
|
|
105
|
-
*
|
106
|
-
xover and log bugfix
|
60
|
+
* code and doc cleanup, new NNTP#help method
|
107
61
|
|
108
|
-
|
62
|
+
* changelog changes
|
109
63
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
64
|
+
2008-05-19 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
65
|
+
|
66
|
+
* handling changes
|
67
|
+
|
68
|
+
2008-05-18 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
69
|
+
|
70
|
+
* all responses implemented, removed deprecated requests
|
71
|
+
|
72
|
+
2008-05-17 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
73
|
+
|
74
|
+
* some more responses added
|
75
|
+
|
76
|
+
2008-05-15 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
77
|
+
|
78
|
+
* added code 224
|
79
|
+
|
80
|
+
* added codes 220-223 (article responses)
|
81
|
+
|
82
|
+
2008-05-13 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
83
|
+
|
84
|
+
* changed spec directory layout for autotest
|
85
|
+
|
86
|
+
* more options, added libnotify stuff to .autotest
|
87
|
+
|
88
|
+
* renamed NNTP::Request class, added first responses, bumped version
|
89
|
+
up
|
90
|
+
|
91
|
+
* changed specs, fleshed out specs, changed behaviour of request
|
92
|
+
classes
|
93
|
+
|
94
|
+
2008-05-12 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
95
|
+
|
96
|
+
* added changelog for rake satisfaction
|
97
|
+
|
98
|
+
2008-05-11 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
99
|
+
|
100
|
+
* added documentation and completed requests
|
101
|
+
|
102
|
+
* first steps towards oop interface
|
103
|
+
|
104
|
+
2008-05-10 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
105
|
+
|
106
|
+
* more small changes
|
107
|
+
|
108
|
+
* small changes for specs
|
109
|
+
|
110
|
+
2008-05-05 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
121
111
|
|
122
|
-
|
112
|
+
* introducing rspec and bones layout
|
123
113
|
|
124
|
-
*
|
125
|
-
moved version to separate file
|
114
|
+
* Added tag release-0.2.2 for changeset e2a61a62dc59
|
126
115
|
|
127
|
-
|
116
|
+
* Added tag release-0.2.1 for changeset 75b6c0f1fefa
|
128
117
|
|
129
|
-
*
|
130
|
-
fixed bug in article overview parser
|
118
|
+
* Added tag release-0.2.0 for changeset 1eb71d8b00b4
|
131
119
|
|
132
|
-
|
120
|
+
* Added tag release-0.1.1 for changeset e54f52f53711
|
133
121
|
|
134
|
-
* .
|
135
|
-
|
122
|
+
* Added tag release-0.1.0 for changeset 5de9968582e9
|
123
|
+
|
124
|
+
2008-01-17 Anton 'tony' Bangratz <tony@twincode.net>
|
125
|
+
|
126
|
+
* doc fix, connected? method, code coverage
|
127
|
+
|
128
|
+
2007-11-19 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
129
|
+
|
130
|
+
* Bugfix release
|
131
|
+
|
132
|
+
2007-08-22 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
133
|
+
|
134
|
+
* added newnews command, response_timeout (used only in xover at the
|
135
|
+
moment)
|
136
|
+
|
137
|
+
2007-08-03 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
138
|
+
|
139
|
+
* fixed encoding and header parsing bugs
|
140
|
+
|
141
|
+
2007-07-14 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
142
|
+
|
143
|
+
* NNTP can QUIT, Article redesign: parse HEAD, BODY and ARTICLE,
|
144
|
+
renamed 'id' to 'number', headers and body along with
|
145
|
+
|
146
|
+
2007-07-09 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
147
|
+
|
148
|
+
* fixed overview.fmt, fixed logging
|
149
|
+
|
150
|
+
2007-07-02 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
151
|
+
|
152
|
+
* new release;version fix
|
153
|
+
|
154
|
+
* bugfix read_response multiline read - introduced with last release
|
155
|
+
|
156
|
+
* Release 0.0.8, fixed version
|
157
|
+
|
158
|
+
* fixed tests, fixed tabs, fixed xhdr bug and api, fixed chomping of
|
159
|
+
results
|
160
|
+
|
161
|
+
* new version; new release
|
162
|
+
|
163
|
+
* bugfixes: read_response response detection only on first line,
|
164
|
+
listgroup accepting no group (error if none selected)
|
165
|
+
|
166
|
+
* xover and log bugfix
|
167
|
+
|
168
|
+
* added logging (log4r), fixed article, refactored read_response and
|
169
|
+
depending methods
|
136
170
|
|
137
|
-
2007-06-28
|
171
|
+
2007-06-28 Anton 'tony' Bangratz <anton.bangratz@gmail.com>
|
138
172
|
|
139
|
-
*
|
140
|
-
fixed version usage for Pallet task
|
173
|
+
* moved version to separate file
|
141
174
|
|
142
|
-
|
175
|
+
* fixed bug in article overview parser
|
143
176
|
|
144
|
-
*
|
145
|
-
branch merge from tests, added documentation, added nntp.close
|
177
|
+
* Added tag release-0.0.3 for changeset 215be61f9524
|
146
178
|
|
147
|
-
|
179
|
+
* fixed version usage for Pallet task
|
148
180
|
|
149
|
-
*
|
150
|
-
bugfix for last, next, xover, grouplist
|
151
|
-
- last and next commands don't hang anymore
|
152
|
-
- xover doesn't hang and can be called without parameters, or with
|
153
|
-
groupname only
|
154
|
-
- grouplist actually returns data
|
181
|
+
* branch merge from tests, added documentation, added nntp.close
|
155
182
|
|
156
|
-
|
183
|
+
* bugfix for last, next, xover, grouplist
|
157
184
|
|
158
|
-
|
159
|
-
test/mock/mock_socket.rb:
|
160
|
-
- added more tests for over/xover
|
161
|
-
- completed help (mock)
|
162
|
-
- added dummy functions for over/xover selections
|
185
|
+
2007-05-21 Anton 'tony' Bangratz <tony@twincode.net>
|
163
186
|
|
164
|
-
|
187
|
+
* - added more tests for over/xover
|
165
188
|
|
166
|
-
|
167
|
-
tags fix
|
189
|
+
2007-05-17 Anton 'tony' Bangratz <tony@twincode.net>
|
168
190
|
|
169
|
-
|
191
|
+
* tags fix
|
170
192
|
|
171
|
-
*
|
172
|
-
Rakefile, lib/net/nntp.rb, lib/net/nntp_article.rb,
|
173
|
-
lib/net/nntp_group.rb, tags, test/functional/test_nntp.rb,
|
174
|
-
test/mock/mock_socket.rb, test/unit/test_nntp_article.rb,
|
175
|
-
test/unit/test_nntp_group.rb:
|
176
|
-
Safe commit
|
193
|
+
* Safe commit
|
177
194
|
|
data/CHANGELOG.debian
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
CHANGELOG
|
2
|
+
CHANGELOG.debian
|
3
|
+
MIT-LICENSE
|
4
|
+
Manifest.txt
|
5
|
+
README.txt
|
6
|
+
Rakefile
|
7
|
+
build-stamp
|
8
|
+
lib/net/nntp.rb
|
9
|
+
lib/net/nntp/request.rb
|
10
|
+
lib/net/nntp/response.rb
|
11
|
+
lib/net/nntp/version.rb
|
12
|
+
script/console
|
13
|
+
spec/net/nntp/request_spec.rb
|
14
|
+
spec/net/nntp/response_spec.rb
|
15
|
+
spec/net/nntp_spec.rb
|
16
|
+
spec/spec.opts
|
17
|
+
spec/spec_helper.rb
|
18
|
+
spec/stories/all.rb
|
19
|
+
spec/stories/helper.rb
|
20
|
+
spec/stories/net/nntp.rb
|
21
|
+
spec/stories/net/nntp.story
|
22
|
+
spec/stories/steps/nntp.rb
|
23
|
+
tasks/ann.rake
|
24
|
+
tasks/bones.rake
|
25
|
+
tasks/gem.rake
|
26
|
+
tasks/git.rake
|
27
|
+
tasks/manifest.rake
|
28
|
+
tasks/mercurial.rake
|
29
|
+
tasks/notes.rake
|
30
|
+
tasks/pallet.rake
|
31
|
+
tasks/post_load.rake
|
32
|
+
tasks/rdoc.rake
|
33
|
+
tasks/rubyforge.rake
|
34
|
+
tasks/setup.rb
|
35
|
+
tasks/spec.rake
|
36
|
+
tasks/svn.rake
|
37
|
+
tasks/test.rake
|
data/README.txt
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
ruby-net-nntp
|
2
|
+
by Anton Bangratz <anton.bangratz@gmail.com>
|
3
|
+
|
4
|
+
== DESCRIPTION
|
5
|
+
|
6
|
+
The Net::NNTP library provides a simple communication layer for the NNTP (Network News Transfer Protocol).
|
7
|
+
|
8
|
+
== FEATURES
|
9
|
+
|
10
|
+
The Net::NNTP library provides a communication layer in Net::HTTP style for NNTP.
|
11
|
+
|
12
|
+
|
13
|
+
== SYNOPSIS
|
14
|
+
|
15
|
+
Net::NNTP uses a simple interface to wrap commands to communicate with an NNTP server.
|
16
|
+
|
17
|
+
=== Example
|
18
|
+
|
19
|
+
nntp = Net::NNTP.new
|
20
|
+
nntp.server = 'localhost' # also default
|
21
|
+
nntp.port = 119 # default port
|
22
|
+
welcome = nntp.connect
|
23
|
+
if OKResponse === welcome
|
24
|
+
# set mode reader
|
25
|
+
request = Net::NNTP::Modereader
|
26
|
+
response = nntp.process(request)
|
27
|
+
if PostingAllowed === response
|
28
|
+
File.open('message', r) {|f|
|
29
|
+
request = Net::NNTP::Post
|
30
|
+
request.body = f
|
31
|
+
response = nntp.process(request)
|
32
|
+
case response
|
33
|
+
when ArticleReceived
|
34
|
+
#everything ok, go on ..
|
35
|
+
when PostingNotPermitted
|
36
|
+
# inform user
|
37
|
+
when PostingFailed
|
38
|
+
# delay and retry?
|
39
|
+
...
|
40
|
+
response = nntp.process(nntp.last_response.request)
|
41
|
+
end
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
== INSTALL
|
49
|
+
|
50
|
+
* sudo gem install ruby-net-nntp or
|
51
|
+
* sudo dpkg -r libruby-nntp_1.0.0_all.deb
|
52
|
+
|
53
|
+
= CHANGES
|
54
|
+
|
55
|
+
|
56
|
+
Version 0.2.x introduces a more complete API and bugfixes.
|
57
|
+
|
58
|
+
Version 0.1.0 introduces the Net::NNTP::Article#headers and #body attributes.
|
59
|
+
Due to this, the attribute Net::NNTP::Article#id has been changed to Net::NNTP::Article#number
|
60
|
+
to avoid conflicts with Object#id.
|
61
|
+
|
62
|
+
Additionally, on request, Net::NNTP::Article has been changed from being a mere proxy for Net::NNTP#xover
|
63
|
+
result lines to being able to parse HEAD, BODY and ARTICLE results and return a corresponding instance.
|
64
|
+
|
65
|
+
== Acknowledgments
|
66
|
+
|
67
|
+
Thanks to Ward Bekker and Geff Hanoian for finding and fixing bugs and providing me with useful hints and enhancements.
|
68
|
+
Thanks to Jürgen Strobel for providing support and hosting of the code libraries and bug tracking system. Thanks to Tom
|
69
|
+
Copeland and Rich Kilmer for rubyforge, and big thanks to Matz and everyone of the core team for Ruby.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Look in the tasks/setup.rb file for the various options that can be
|
2
|
+
# configured in this Rakefile. The .rake files in the tasks directory
|
3
|
+
# are where the options are used.
|
4
|
+
|
5
|
+
load 'tasks/setup.rb'
|
6
|
+
|
7
|
+
ensure_in_path 'lib'
|
8
|
+
require 'net/nntp'
|
9
|
+
|
10
|
+
task :default => 'spec:run'
|
11
|
+
|
12
|
+
PROJ.name = 'ruby-net-nntp'
|
13
|
+
PROJ.authors = "Anton 'tony' Bangratz"
|
14
|
+
PROJ.email = 'anton.bangratz@gmail.com'
|
15
|
+
PROJ.url = 'http://rubyforge.org/projects/ruby-net-nntp'
|
16
|
+
PROJ.rubyforge.name = 'ruby-net-nntp'
|
17
|
+
PROJ.history_file = 'CHANGELOG'
|
18
|
+
PROJ.readme_file = 'README.txt'
|
19
|
+
PROJ.version = Net::NNTP::VERSION
|
20
|
+
PROJ.exclude += %w(^\. ^tags ^debian/ ^logs/ ^coverage.info )
|
21
|
+
PROJ.gem.dependencies = %w(tmail log4r)
|
22
|
+
|
23
|
+
PROJ.spec.opts << '--color'
|
24
|
+
PROJ.rdoc.include = %w(^lib/ ^bin/ ^ext/ .txt$ ^CHANGELOG$)
|
25
|
+
PROJ.rdoc.opts = %w(-S -M -N)
|
26
|
+
PROJ.ruby_opts = []
|
27
|
+
|
28
|
+
# EOF
|