ident 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ 2009/10/14
2
+ version 0.0.2
3
+ * fixed a bug in parsing the charset
4
+ * added tests
5
+
6
+ version 0.0.1
7
+ * initial release
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake/gempackagetask'
2
2
  require 'yard'
3
3
 
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
 
6
6
  spec = Gem::Specification.new do |s|
7
7
  s.name = "ident"
@@ -179,13 +179,13 @@ Returns the value of attribute <tt>timeout</tt>.
179
179
  <pre class="lines">
180
180
 
181
181
 
182
- 86
183
- 87
184
182
  88
185
- 89</pre>
183
+ 89
184
+ 90
185
+ 91</pre>
186
186
  </td>
187
187
  <td>
188
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 86</span>
188
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 88</span>
189
189
 
190
190
  <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id ip'>ip</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id outbound'>outbound</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id inbound'>inbound</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id timeout'>timeout</span> <span class='op'>=</span> <span class='int'>10</span><span class='rparen'>)</span>
191
191
  <span class='ivar'>@ip</span><span class='comma'>,</span> <span class='ivar'>@outbound</span><span class='comma'>,</span> <span class='ivar'>@inbound</span><span class='comma'>,</span> <span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='id ip'>ip</span><span class='comma'>,</span> <span class='id outbound'>outbound</span><span class='comma'>,</span> <span class='id inbound'>inbound</span><span class='comma'>,</span> <span class='id timeout'>timeout</span>
@@ -437,8 +437,6 @@ If no identd was running at the destination host
437
437
  <pre class="lines">
438
438
 
439
439
 
440
- 116
441
- 117
442
440
  118
443
441
  119
444
442
  120
@@ -451,10 +449,12 @@ If no identd was running at the destination host
451
449
  127
452
450
  128
453
451
  129
454
- 130</pre>
452
+ 130
453
+ 131
454
+ 132</pre>
455
455
  </td>
456
456
  <td>
457
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 116</span>
457
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 118</span>
458
458
 
459
459
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id request'>request</span><span class='lparen'>(</span><span class='id ip'>ip</span><span class='comma'>,</span> <span class='id outbound'>outbound</span><span class='comma'>,</span> <span class='id inbound'>inbound</span><span class='comma'>,</span> <span class='id timeout_after'>timeout_after</span> <span class='op'>=</span> <span class='int'>10</span><span class='rparen'>)</span>
460
460
  <span class='id r'>r</span> <span class='op'>=</span> <span class='kw'>nil</span>
@@ -519,12 +519,12 @@ If no identd was running at the destination host
519
519
  <pre class="lines">
520
520
 
521
521
 
522
- 92
523
- 93
524
- 94</pre>
522
+ 94
523
+ 95
524
+ 96</pre>
525
525
  </td>
526
526
  <td>
527
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 92</span>
527
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 94</span>
528
528
 
529
529
  <span class='kw'>def</span> <span class='id request'>request</span>
530
530
  <span class='ivar'>@response</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id class'>class</span><span class='period'>.</span><span class='id request'>request</span><span class='lparen'>(</span><span class='ivar'>@ip</span><span class='comma'>,</span> <span class='ivar'>@outbound</span><span class='comma'>,</span> <span class='ivar'>@inbound</span><span class='comma'>,</span> <span class='ivar'>@timeout</span><span class='rparen'>)</span>
@@ -543,7 +543,7 @@ If no identd was running at the destination host
543
543
  </div>
544
544
  </div>
545
545
  <div id="yard_info">
546
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
546
+ Generated on Thursday, October 15 2009 at 12:40:53 AM by
547
547
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
548
548
  0.2.3.3 (ruby-1.9.1).
549
549
  </div>
@@ -76,14 +76,14 @@ Returns an instance of <tt><a href="Response/USERID.html" title="USERID">USERID<
76
76
  <pre class="lines">
77
77
 
78
78
 
79
- 73
80
- 74
81
79
  75
82
80
  76
83
- 77</pre>
81
+ 77
82
+ 78
83
+ 79</pre>
84
84
  </td>
85
85
  <td>
86
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 73</span>
86
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 75</span>
87
87
 
88
88
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id from'>from</span><span class='lparen'>(</span><span class='id s'>s</span><span class='rparen'>)</span>
89
89
  <span class='id ports'>ports</span><span class='comma'>,</span> <span class='id type'>type</span><span class='comma'>,</span> <span class='op'>*</span><span class='id addinfo'>addinfo</span> <span class='op'>=</span> <span class='id s'>s</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>:</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
@@ -104,7 +104,7 @@ Returns an instance of <tt><a href="Response/USERID.html" title="USERID">USERID<
104
104
  </div>
105
105
  </div>
106
106
  <div id="yard_info">
107
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
107
+ Generated on Thursday, October 15 2009 at 12:40:53 AM by
108
108
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
109
109
  0.2.3.3 (ruby-1.9.1).
110
110
  </div>
@@ -262,7 +262,7 @@ Is the response the result of an error?
262
262
  </div>
263
263
  </div>
264
264
  <div id="yard_info">
265
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
265
+ Generated on Thursday, October 15 2009 at 12:40:53 AM by
266
266
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
267
267
  0.2.3.3 (ruby-1.9.1).
268
268
  </div>
@@ -83,12 +83,12 @@ Returns the value of attribute <tt>type</tt>.
83
83
  <pre class="lines">
84
84
 
85
85
 
86
- 55
87
- 56
88
- 57</pre>
86
+ 57
87
+ 58
88
+ 59</pre>
89
89
  </td>
90
90
  <td>
91
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 55</span>
91
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 57</span>
92
92
 
93
93
  <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id type'>type</span><span class='rparen'>)</span>
94
94
  <span class='ivar'>@type</span> <span class='op'>=</span> <span class='id type'>type</span>
@@ -248,10 +248,10 @@ Did an unknown error occur?.
248
248
  <pre class="lines">
249
249
 
250
250
 
251
- 60</pre>
251
+ 62</pre>
252
252
  </td>
253
253
  <td>
254
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 60</span>
254
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 62</span>
255
255
 
256
256
  <span class='kw'>def</span> <span class='id error?'>error?</span><span class='semicolon'>;</span> <span class='kw'>true</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
257
257
  </td>
@@ -290,10 +290,10 @@ Does the identd hide information from us?
290
290
  <pre class="lines">
291
291
 
292
292
 
293
- 66</pre>
293
+ 68</pre>
294
294
  </td>
295
295
  <td>
296
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 66</span>
296
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 68</span>
297
297
 
298
298
  <span class='kw'>def</span> <span class='id hidden_user?'>hidden_user?</span><span class='semicolon'>;</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>HIDDEN-USER</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
299
299
  </td>
@@ -332,10 +332,10 @@ Did we specify an invalid port?
332
332
  <pre class="lines">
333
333
 
334
334
 
335
- 62</pre>
335
+ 64</pre>
336
336
  </td>
337
337
  <td>
338
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 62</span>
338
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 64</span>
339
339
 
340
340
  <span class='kw'>def</span> <span class='id invalid_port?'>invalid_port?</span><span class='semicolon'>;</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>INVALID-PORT</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
341
341
  </td>
@@ -374,10 +374,10 @@ Is no user known for the given connection specification?
374
374
  <pre class="lines">
375
375
 
376
376
 
377
- 64</pre>
377
+ 66</pre>
378
378
  </td>
379
379
  <td>
380
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 64</span>
380
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 66</span>
381
381
 
382
382
  <span class='kw'>def</span> <span class='id no_user?'>no_user?</span><span class='semicolon'>;</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>NO-USER</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
383
383
  </td>
@@ -416,10 +416,10 @@ Did an unknown error occur?
416
416
  <pre class="lines">
417
417
 
418
418
 
419
- 68</pre>
419
+ 70</pre>
420
420
  </td>
421
421
  <td>
422
- <pre class="code"><span class="info file"># File 'lib/ident.rb', line 68</span>
422
+ <pre class="code"><span class="info file"># File 'lib/ident.rb', line 70</span>
423
423
 
424
424
  <span class='kw'>def</span> <span class='id unknown_error?'>unknown_error?</span><span class='semicolon'>;</span> <span class='ivar'>@type</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>UNKNOWN-ERROR</span><span class='tstring_end'>&quot;</span></span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
425
425
  </td>
@@ -436,7 +436,7 @@ Did an unknown error occur?
436
436
  </div>
437
437
  </div>
438
438
  <div id="yard_info">
439
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
439
+ Generated on Thursday, October 15 2009 at 12:40:54 AM by
440
440
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
441
441
  0.2.3.3 (ruby-1.9.1).
442
442
  </div>
@@ -122,14 +122,18 @@ the userid.
122
122
  38
123
123
  39
124
124
  40
125
- 41</pre>
125
+ 41
126
+ 42
127
+ 43</pre>
126
128
  </td>
127
129
  <td>
128
130
  <pre class="code"><span class="info file"># File 'lib/ident.rb', line 37</span>
129
131
 
130
132
  <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id os'>os</span><span class='comma'>,</span> <span class='id userid'>userid</span><span class='rparen'>)</span>
131
- <span class='ivar'>@os</span><span class='comma'>,</span> <span class='ivar'>@charset</span> <span class='op'>=</span> <span class='id os'>os</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
132
- <span class='ivar'>@charset</span> <span class='op'>||=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>US-ASCII</span><span class='tstring_end'>'</span></span>
133
+ <span class='id parts'>parts</span> <span class='op'>=</span> <span class='id os'>os</span><span class='period'>.</span><span class='id split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
134
+ <span class='ivar'>@os</span> <span class='op'>=</span> <span class='id parts'>parts</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
135
+ <span class='ivar'>@charset</span> <span class='op'>=</span> <span class='id parts'>parts</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
136
+ <span class='ivar'>@charset</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>US-ASCII</span><span class='tstring_end'>'</span></span> <span class='kw'>if</span> <span class='ivar'>@charset</span><span class='period'>.</span><span class='id empty?'>empty?</span>
133
137
  <span class='ivar'>@userid</span> <span class='op'>=</span> <span class='id userid'>userid</span>
134
138
  <span class='kw'>end</span></pre>
135
139
  </td>
@@ -157,7 +161,7 @@ the userid.
157
161
  </div>
158
162
  </div>
159
163
  <div id="yard_info">
160
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
164
+ Generated on Thursday, October 15 2009 at 12:40:54 AM by
161
165
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
162
166
  0.2.3.3 (ruby-1.9.1).
163
167
  </div>
@@ -20,7 +20,7 @@ usage see the documentation and and the examples.
20
20
  </div>
21
21
  </div>
22
22
  <div id="yard_info">
23
- Generated on Wednesday, October 14 2009 at 04:55:46 PM by
23
+ Generated on Thursday, October 15 2009 at 12:40:53 AM by
24
24
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
25
25
  0.2.3.3 (ruby-1.9.1).
26
26
  </div>
@@ -16,7 +16,7 @@
16
16
 
17
17
  </div>
18
18
  <div id="yard_info">
19
- Generated on Wednesday, October 14 2009 at 04:55:47 PM by
19
+ Generated on Thursday, October 15 2009 at 12:40:54 AM by
20
20
  <abbr class="yard" title="Yay! A Ruby Documentation Tool"><a href="http://yard.soen.ca">YARD</a></abbr>
21
21
  0.2.3.3 (ruby-1.9.1).
22
22
  </div>
@@ -35,8 +35,10 @@ class Ident
35
35
  # the userid
36
36
  attr_reader :userid
37
37
  def initialize(os, userid)
38
- @os, @charset = os.split('-')
39
- @charset ||= 'US-ASCII'
38
+ parts = os.split('-')
39
+ @os = parts[0]
40
+ @charset = parts[1..-1].join('-')
41
+ @charset = 'US-ASCII' if @charset.empty?
40
42
  @userid = userid
41
43
  end
42
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ident
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Honnef
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-14 00:00:00 +02:00
12
+ date: 2009-10-15 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -24,6 +24,7 @@ extra_rdoc_files: []
24
24
  files:
25
25
  - lib/ident.rb
26
26
  - Rakefile
27
+ - CHANGELOG
27
28
  - COPYING
28
29
  - README
29
30
  - doc/syntax_highlight.css