tmail 1.2.1 → 1.2.2

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.
Files changed (126) hide show
  1. data/CHANGES +50 -5
  2. data/MANIFEST +188 -0
  3. data/NOTES +1 -1
  4. data/README +10 -4
  5. data/Rakefile +1 -10
  6. data/lib/tmail.rb +1 -0
  7. data/lib/tmail/Makefile +0 -1
  8. data/lib/tmail/address.rb +190 -17
  9. data/lib/tmail/attachments.rb +1 -1
  10. data/lib/tmail/base64.rb +4 -10
  11. data/lib/tmail/compat.rb +8 -6
  12. data/lib/tmail/config.rb +2 -6
  13. data/lib/tmail/core_extensions.rb +14 -18
  14. data/lib/tmail/encode.rb +47 -12
  15. data/lib/tmail/header.rb +7 -10
  16. data/lib/tmail/index.rb +2 -1
  17. data/lib/tmail/interface.rb +14 -12
  18. data/lib/tmail/loader.rb +2 -0
  19. data/lib/tmail/mail.rb +83 -24
  20. data/lib/tmail/mailbox.rb +70 -10
  21. data/lib/tmail/main.rb +2 -0
  22. data/lib/tmail/mbox.rb +2 -0
  23. data/lib/tmail/net.rb +16 -15
  24. data/lib/tmail/obsolete.rb +7 -12
  25. data/lib/tmail/parser.rb +1 -0
  26. data/lib/tmail/require_arch.rb +2 -0
  27. data/lib/tmail/scanner.rb +2 -1
  28. data/lib/tmail/scanner_r.rb +11 -10
  29. data/lib/tmail/utils.rb +83 -26
  30. data/lib/tmail/version.rb +3 -2
  31. data/log/BugTrackingLog.txt +1208 -0
  32. data/log/{ChangeLog.txt → Changelog-0.txt} +36 -0
  33. data/log/Changelog.txt +534 -0
  34. data/log/Testlog.txt +114 -0
  35. data/log/Todo.txt +0 -2
  36. data/meta/VERSION +1 -0
  37. data/meta/project.yaml +8 -5
  38. data/meta/unixname +1 -0
  39. data/setup.rb +1481 -0
  40. data/site/contributing/index.html +183 -0
  41. data/site/css/clean.css +27 -0
  42. data/site/css/layout.css +31 -0
  43. data/site/css/style.css +60 -0
  44. data/site/download/index.html +61 -0
  45. data/site/img/envelope.jpg +0 -0
  46. data/site/img/mailman.gif +0 -0
  47. data/site/img/stamp-sm.jpg +0 -0
  48. data/site/img/stamp.jpg +0 -0
  49. data/site/img/stampborder.jpg +0 -0
  50. data/site/img/tfire.jpg +0 -0
  51. data/site/img/tmail.png +0 -0
  52. data/site/index.html +270 -0
  53. data/site/js/jquery.js +31 -0
  54. data/site/log/Changelog.xsl +33 -0
  55. data/site/log/changelog.xml +1677 -0
  56. data/site/outdated/BUGS +3 -0
  57. data/site/outdated/DEPENDS +1 -0
  58. data/site/outdated/Incompatibilities +89 -0
  59. data/site/outdated/Incompatibilities.ja +102 -0
  60. data/site/outdated/NEWS +9 -0
  61. data/site/outdated/README.ja +73 -0
  62. data/site/outdated/doc.ja/address.html +275 -0
  63. data/site/outdated/doc.ja/basics.html +405 -0
  64. data/site/outdated/doc.ja/config.html +49 -0
  65. data/site/outdated/doc.ja/details.html +146 -0
  66. data/site/outdated/doc.ja/index.html +39 -0
  67. data/site/outdated/doc.ja/mail.html +793 -0
  68. data/site/outdated/doc.ja/mailbox.html +265 -0
  69. data/site/outdated/doc.ja/port.html +95 -0
  70. data/site/outdated/doc.ja/tmail.html +58 -0
  71. data/site/outdated/doc.ja/usage.html +202 -0
  72. data/site/outdated/rdd/address.rrd.m +229 -0
  73. data/site/outdated/rdd/basics.rd.m +275 -0
  74. data/site/outdated/rdd/config.rrd.m +26 -0
  75. data/site/outdated/rdd/details.rd.m +117 -0
  76. data/site/outdated/rdd/index.rhtml.m +54 -0
  77. data/site/outdated/rdd/mail.rrd.m +701 -0
  78. data/site/outdated/rdd/mailbox.rrd.m +228 -0
  79. data/site/outdated/rdd/port.rrd.m +69 -0
  80. data/site/outdated/rdd/tmail.rrd.m +33 -0
  81. data/site/outdated/rdd/usage.rd.m +247 -0
  82. data/site/quickstart/index.html +69 -0
  83. data/site/quickstart/quickstart.html +52 -0
  84. data/site/quickstart/usage.html +193 -0
  85. data/site/reference/address.html +247 -0
  86. data/site/reference/config.html +30 -0
  87. data/site/reference/index.html +101 -0
  88. data/site/reference/mail.html +726 -0
  89. data/site/reference/mailbox.html +245 -0
  90. data/site/reference/port.html +75 -0
  91. data/site/reference/tmail.html +35 -0
  92. data/test/fixtures/mailbox +405 -4
  93. data/test/fixtures/raw_email_multiple_from +30 -0
  94. data/test/kcode.rb +2 -2
  95. data/test/temp_test_one.rb +46 -0
  96. data/test/test_address.rb +77 -38
  97. data/test/test_encode.rb +0 -2
  98. data/test/test_header.rb +47 -24
  99. data/test/test_mail.rb +52 -9
  100. data/test/test_mbox.rb +28 -0
  101. data/test/test_port.rb +33 -27
  102. data/test/test_quote.rb +35 -8
  103. data/work/script/make +26 -0
  104. data/work/script/rdoc +39 -0
  105. data/{script → work/script}/setup +0 -0
  106. data/work/script/test +30 -0
  107. metadata +249 -184
  108. data/log/History.txt +0 -40
  109. data/meta/config.yaml +0 -8
  110. data/meta/icli.yaml +0 -16
  111. data/meta/tmail.roll +0 -3
  112. data/script/changelog +0 -19
  113. data/script/clobber/distclean +0 -8
  114. data/script/clobber/package +0 -10
  115. data/script/compile +0 -32
  116. data/script/pack/gem +0 -93
  117. data/script/pack/tgz +0 -41
  118. data/script/pack/zip +0 -41
  119. data/script/prepare +0 -15
  120. data/script/publish +0 -51
  121. data/script/rdoc +0 -42
  122. data/script/release +0 -10
  123. data/script/stamp +0 -33
  124. data/script/stats +0 -138
  125. data/script/tag +0 -25
  126. data/script/test +0 -36
@@ -21,17 +21,25 @@ class TestMail < Test::Unit::TestCase
21
21
 
22
22
  def test_MIME
23
23
  # FIXME: test more.
24
-
24
+
25
25
  kcode('EUC') {
26
26
  mail = TMail::Mail.parse('From: hoge@example.jp (=?iso-2022-jp?B?GyRCJUYlOSVIGyhC?=)')
27
27
  assert_not_nil mail['From']
28
- assert_equal ["\245\306\245\271\245\310"], mail['From'].comments
29
- assert_equal "From: hoge@example.jp (\245\306\245\271\245\310)\n\n",
30
- mail.to_s
31
- assert_equal "From: hoge@example.jp (\245\306\245\271\245\310)\n\n",
32
- mail.decoded
33
- assert_equal "From: hoge@example.jp (=?iso-2022-jp?B?GyRCJUYlOSVIGyhC?=)\r\n\r\n",
34
- mail.encoded
28
+
29
+ expected = "\245\306\245\271\245\310"
30
+ if expected.respond_to? :force_encoding
31
+ expected.force_encoding(mail['From'].comments.first.encoding)
32
+ end
33
+ assert_equal [expected], mail['From'].comments
34
+
35
+ expected = "From: hoge@example.jp (\245\306\245\271\245\310)\n\n"
36
+ expected.force_encoding 'EUC-JP' if expected.respond_to? :force_encoding
37
+ assert_equal expected, mail.to_s
38
+ assert_equal expected, mail.decoded
39
+
40
+ expected = "From: hoge@example.jp (=?iso-2022-jp?B?GyRCJUYlOSVIGyhC?=)\r\n\r\n"
41
+ expected.force_encoding 'EUC-JP' if expected.respond_to? :force_encoding
42
+ assert_equal expected, mail.encoded
35
43
  }
36
44
  end
37
45
 
@@ -247,6 +255,11 @@ EOS
247
255
  a = @mail.from
248
256
  assert_equal nil, @mail.from
249
257
  assert_equal 'DEFAULT VALUE', @mail.from('DEFAULT VALUE')
258
+
259
+ @mail.from = "raasdnil@gmail.com, mikel@me.com"
260
+ assert_equal 2, @mail['from'].addrs.size
261
+ assert_equal 'raasdnil@gmail.com', @mail['from'].addrs[0].spec
262
+ assert_equal 'mikel@me.com', @mail['from'].addrs[1].spec
250
263
  end
251
264
 
252
265
  def test_reply_to
@@ -479,7 +492,11 @@ EOF
479
492
  output = <<EOF
480
493
  From: mikel@example.com
481
494
  Subject: Hello
482
- Content-Type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-42-587703407; micalg=sha1
495
+ #{if RUBY_VERSION < '1.9'
496
+ 'Content-Type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-42-587703407; micalg=sha1'
497
+ else
498
+ 'Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-42-587703407; protocol="application/pkcs7-signature"'
499
+ end}
483
500
 
484
501
  The body
485
502
  EOF
@@ -697,4 +714,30 @@ EOF
697
714
  assert_equal "application/pkcs7-signature", mail.attachments.last.content_type
698
715
  end
699
716
 
717
+ def test_preamble_read
718
+ fixture = File.read("#{File.dirname(__FILE__)}/fixtures/raw_email4")
719
+ mail = TMail::Mail.parse(fixture)
720
+ assert_equal 'This is a multi-part message in MIME format.', mail.preamble.strip
721
+ end
722
+
723
+ def test_preamble_write
724
+ mail = TMail::Mail.new
725
+ part = TMail::Mail.parse("Content-Type: text/plain\n\nBlah")
726
+ mail.parts << part
727
+ mail.preamble = 'This is the preamble'
728
+ # normalize the boundary to something non-random to assert against
729
+ str = mail.encoded
730
+ result = str.gsub(str[/boundary="(.*?)"/, 1], 'boundary')
731
+ expected =<<EOF
732
+ Content-Type: multipart/mixed; boundary="boundary"
733
+
734
+ This is the preamble
735
+ --boundary
736
+ Content-Type: text/plain
737
+
738
+ Blah
739
+ --boundary--
740
+ EOF
741
+ assert_equal(crlf(expected), result)
742
+ end
700
743
  end
@@ -144,4 +144,32 @@ class MailboxTester < Test::Unit::TestCase
144
144
  assert_equal(TMail::UNIXMbox.fromaddr(p), "nobody")
145
145
  end
146
146
 
147
+ def test_opening_mailbox_to_read_does_not_raise_IO_error
148
+ mailbox = TMail::UNIXMbox.new("#{File.dirname(__FILE__)}/fixtures/mailbox", nil, true)
149
+ assert_nothing_raised do
150
+ mailbox.each_port do |port|
151
+ TMail::Mail.new(port)
152
+ end
153
+ end
154
+ end
155
+
156
+ def test_reading_correct_number_of_emails_from_a_mailbox
157
+ mailbox = TMail::UNIXMbox.new("#{File.dirname(__FILE__)}/fixtures/mailbox", nil, true)
158
+ @emails = []
159
+ mailbox.each_port { |m| @emails << TMail::Mail.new(m) }
160
+ assert_equal(4, @emails.length)
161
+ end
162
+
163
+ def test_truncating_a_mailbox_to_zero_if_it_is_opened_with_readonly_false
164
+ filename = "#{File.dirname(__FILE__)}/fixtures/mailbox"
165
+ FileUtils.copy(filename, "#{filename}_test")
166
+ filename = "#{filename}_test"
167
+ mailbox = TMail::UNIXMbox.new(filename, nil, false)
168
+ @emails = []
169
+ mailbox.each_port { |m| @emails << TMail::Mail.new(m) }
170
+ assert_equal(4, @emails.length)
171
+ assert_equal('', File.read(filename))
172
+ File.delete(filename)
173
+ end
174
+
147
175
  end
@@ -93,10 +93,11 @@ class FilePortTester < Test::Unit::TestCase
93
93
  f.close
94
94
 
95
95
  f = nil
96
- port.ropen {|f|
97
- assert_instance_of File, f
98
- assert_equal false, f.closed?
99
- assert_equal 'f', f.read(1)
96
+ port.ropen {|ff|
97
+ assert_instance_of File, ff
98
+ assert_equal false, ff.closed?
99
+ assert_equal 'f', ff.read(1)
100
+ f = ff
100
101
  }
101
102
  assert_equal true, f.closed?
102
103
 
@@ -114,14 +115,15 @@ class FilePortTester < Test::Unit::TestCase
114
115
  f.close
115
116
 
116
117
  f = nil
117
- port.wopen {|f|
118
- assert_instance_of File, f
119
- assert_equal false, f.closed?
120
- f.puts 'ok'
118
+ port.wopen {|ff|
119
+ assert_instance_of File, ff
120
+ assert_equal false, ff.closed?
121
+ ff.puts 'ok'
122
+ f = ff
121
123
  }
122
124
  assert_equal true, f.closed?
123
125
 
124
- TMail::FilePort.new('tmp/100').wopen {|f| }
126
+ TMail::FilePort.new('tmp/100').wopen {|ff| }
125
127
  end
126
128
 
127
129
  def test_aopen
@@ -133,23 +135,24 @@ class FilePortTester < Test::Unit::TestCase
133
135
  f.print 'N'
134
136
  f.close
135
137
  assert_equal size + 1, port.size
136
- port.ropen {|f|
137
- assert_equal 'f', f.read(1)
138
+ port.ropen {|ff|
139
+ assert_equal 'f', ff.read(1)
138
140
  }
139
141
 
140
142
  f = nil
141
- port.aopen {|f|
142
- assert_instance_of File, f
143
- assert_equal false, f.closed?
144
- f.print 'N'
143
+ port.aopen {|ff|
144
+ assert_instance_of File, ff
145
+ assert_equal false, ff.closed?
146
+ ff.print 'N'
147
+ f = ff
145
148
  }
146
149
  assert_equal true, f.closed?
147
150
  assert_equal size + 1 + 1, port.size
148
- port.ropen {|f|
149
- assert_equal 'f', f.read(1)
151
+ port.ropen {|ff|
152
+ assert_equal 'f', ff.read(1)
150
153
  }
151
154
 
152
- TMail::FilePort.new('tmp/100').aopen {|f| }
155
+ TMail::FilePort.new('tmp/100').aopen {|ff| }
153
156
  end
154
157
 
155
158
  def test_read_all
@@ -258,9 +261,10 @@ class StringPortTester < Test::Unit::TestCase
258
261
  assert_equal 'a', f.read(1)
259
262
  f.close
260
263
 
261
- port.ropen {|f|
262
- assert_equal false, f.closed?
263
- assert_equal 'a', f.read(1)
264
+ port.ropen {|ff|
265
+ assert_equal false, ff.closed?
266
+ assert_equal 'a', ff.read(1)
267
+ f = ff
264
268
  }
265
269
  assert_equal true, f.closed?
266
270
  end
@@ -273,9 +277,10 @@ class StringPortTester < Test::Unit::TestCase
273
277
  f.close
274
278
  assert_equal 'N', port.read_all
275
279
 
276
- port.wopen {|f|
277
- assert_equal false, f.closed?
278
- f.print 'NN'
280
+ port.wopen {|ff|
281
+ assert_equal false, ff.closed?
282
+ ff.print 'NN'
283
+ f = ff
279
284
  }
280
285
  assert_equal true, f.closed?
281
286
  assert_equal 'NN', port.read_all
@@ -289,9 +294,10 @@ class StringPortTester < Test::Unit::TestCase
289
294
  f.close
290
295
  assert_equal 'abcN', port.read_all
291
296
 
292
- port.aopen {|f|
293
- assert_equal false, f.closed?
294
- f.print 'F'
297
+ port.aopen {|ff|
298
+ assert_equal false, ff.closed?
299
+ ff.print 'F'
300
+ f = ff
295
301
  }
296
302
  assert_equal true, f.closed?
297
303
  assert_equal 'abcNF', port.read_all
@@ -5,31 +5,41 @@ class TestQuote < Test::Unit::TestCase
5
5
  def test_unquote_quoted_printable
6
6
  a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?="
7
7
  b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
8
- assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b
8
+ expected = "[166417] Bekr\303\246ftelse fra Rejsefeber"
9
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
10
+ assert_equal expected, b
9
11
  end
10
12
 
11
13
  def test_unquote_base64
12
14
  a ="=?ISO-8859-1?B?WzE2NjQxN10gQmVrcuZmdGVsc2UgZnJhIFJlanNlZmViZXI=?="
13
15
  b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
14
- assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b
16
+ expected = "[166417] Bekr\303\246ftelse fra Rejsefeber"
17
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
18
+ assert_equal expected, b
15
19
  end
16
20
 
17
21
  def test_unquote_without_charset
18
22
  a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber"
19
23
  b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
20
- assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b
24
+ expected = "[166417]_Bekr=E6ftelse_fra_Rejsefeber"
25
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
26
+ assert_equal expected, b
21
27
  end
22
28
 
23
29
  def test_unqoute_multiple
24
30
  a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?="
25
31
  b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
26
- assert_equal "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\"", b
32
+ expected = "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\""
33
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
34
+ assert_equal expected, b
27
35
  end
28
36
 
29
37
  def test_unqoute_in_the_middle
30
38
  a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?="
31
39
  b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8')
32
- assert_equal "Re: Photos Brosch\303\274re Rand", b
40
+ expected = "Re: Photos Brosch\303\274re Rand"
41
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
42
+ assert_equal expected, b
33
43
  end
34
44
 
35
45
  def test_unqoute_iso
@@ -39,6 +49,14 @@ class TestQuote < Test::Unit::TestCase
39
49
  expected.force_encoding 'iso-8859-1' if expected.respond_to? :force_encoding
40
50
  assert_equal expected, b
41
51
  end
52
+
53
+ def test_quote_multibyte_chars
54
+ original = "\303\246 \303\270 and \303\245"
55
+ unquoted = TMail::Unquoter.unquote_and_convert_to(original, nil)
56
+ original.force_encoding 'utf-8' if original.respond_to? :force_encoding
57
+ unquoted.force_encoding 'utf-8' if unquoted.respond_to? :force_encoding
58
+ assert_equal unquoted, original
59
+ end
42
60
 
43
61
  # test an email that has been created using \r\n newlines, instead of
44
62
  # \n newlines.
@@ -49,7 +67,9 @@ class TestQuote < Test::Unit::TestCase
49
67
 
50
68
  def test_email_with_partially_quoted_subject
51
69
  mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject"))
52
- assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
70
+ expected = "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail"
71
+ expected.force_encoding 'utf-8' if expected.respond_to? :force_encoding
72
+ assert_equal expected, mail.subject
53
73
  end
54
74
 
55
75
  def test_decode
@@ -59,13 +79,20 @@ class TestQuote < Test::Unit::TestCase
59
79
 
60
80
  def test_encode
61
81
  encoded, decoded = expected_base64_strings
62
- assert_equal encoded.length, TMail::Base64.encode(decoded).length
82
+ assert_equal encoded, TMail::Base64.encode(decoded)
63
83
  end
64
84
 
65
85
  private
66
86
 
67
87
  def expected_base64_strings
68
- [ File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_encoded_string"), File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_decoded_string") ]
88
+ if RUBY_VERSION < '1.9'
89
+ options = "r"
90
+ else
91
+ options = "r:ASCII-8BIT"
92
+ end
93
+ encoded = File.open("#{File.dirname(__FILE__)}/fixtures/raw_base64_encoded_string", options) {|f| f.read }
94
+ decoded = File.open("#{File.dirname(__FILE__)}/fixtures/raw_base64_decoded_string", options) {|f| f.read }
95
+ [encoded, decoded]
69
96
  end
70
97
 
71
98
  end
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ Dir.chdir("ext/tmailscanner/tmail") do
4
+ unless File.exist?('Makefile')
5
+ system "ruby extconf.rb"
6
+ end
7
+
8
+ unless ARGV[0] == 'setup'
9
+ system "make #{ARGV.join(' ')}"
10
+ end
11
+ end
12
+
13
+
14
+ # Eric Hodel said NOT do this.
15
+ #
16
+ #cp "ext/xml/*.#{dlext}", "lib/xml/#{arch}/"
17
+ #
18
+ #
19
+ #def dlext
20
+ # Config::CONFIG['DLEXT']
21
+ #end
22
+ #
23
+ #def arch
24
+ # Config::CONFIG['arch']
25
+ #end
26
+
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ # generate rdocs
6
+
7
+ def rdoc
8
+ template = 'html'
9
+ output = 'doc/rdoc'
10
+ FileUtils.rm_r(output) if File.exist?(output)
11
+ system "rdoc --op #{output} --template #{template} --main README --merge --inline-source [A-Z]* lib/**/*.rb ext/**/*.c"
12
+ #insert_ads(output)
13
+ end
14
+
15
+ # Insert an ad if available.
16
+
17
+ def insert_ads(site)
18
+ adfile = 'doc/ads/rdoc.html'
19
+ return unless File.file?(adfile)
20
+ adtext = File.read(adfile)
21
+ #puts
22
+ dirs = Dir.glob(File.join(site,'*/'))
23
+ dirs.each do |dir|
24
+ files = Dir.glob(File.join(dir, '**/*.html'))
25
+ files.each do |file|
26
+ html = file_read(file)
27
+ bodi = html.index('<body>')
28
+ html[bodi + 7] = "\n" + adtext
29
+ #print "Augmenting #{file}..."
30
+ file_write(file, html) unless dryrun?
31
+ #puts "[done]"
32
+ end
33
+ end
34
+ end
35
+
36
+ if $0 == __FILE__
37
+ rdoc
38
+ end
39
+
File without changes
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # TODO: Ensure compile first (but only if needed)
4
+ # system "task/make"
5
+
6
+ # Run unit tests
7
+
8
+ live = ARGV.include?('--live')
9
+ pure = ARGV.include?('--pure') # pure won't work if live.
10
+
11
+ unless live
12
+ $LOAD_PATH.unshift(File.expand_path('lib'))
13
+ $LOAD_PATH.unshift(File.expand_path('ext/tmailscanner')) unless pure
14
+ end
15
+ $LOAD_PATH.unshift('test') # NEEDED?
16
+
17
+ unless glob = ARGV.select{ |a| a !~ /^[-]/ }[0]
18
+ glob = 'test/test_*.rb'
19
+ end
20
+
21
+ Dir[glob].each do |file|
22
+ next if File.directory?(file)
23
+ begin
24
+ puts "Loading: #{file}" if $DEBUG
25
+ load(file)
26
+ rescue LoadError
27
+ puts "Error loading: #{file}"
28
+ end
29
+ end
30
+
metadata CHANGED
@@ -1,231 +1,296 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4.6
3
- specification_version: 2
4
2
  name: tmail
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.2.1
7
- date: 2008-01-11 00:00:00 -05:00
8
- summary: Ruby Mail Handler
9
- require_paths:
10
- - lib
11
- - ext/tmail
12
- email: tmail-talk@rubyforge.org
13
- homepage:
14
- rubyforge_project:
15
- description: TMail is a Ruby-based mail handler. It allows you to compose stadards compliant emails in a very Ruby-way.
4
+ version: 1.2.2
5
+ platform: ruby
6
+ authors:
7
+ - Mikel Lindsaar <raasdnil AT gmail.com>
16
8
  autorequire:
17
- default_executable:
18
9
  bindir: bin
19
- has_rdoc:
20
- required_ruby_version: !ruby/object:Gem::Requirement
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
25
- version:
26
- required_rubygems_version: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: "0"
31
- version:
32
- platform: ruby
33
- signing_key:
34
10
  cert_chain: []
35
11
 
36
- post_install_message:
37
- extensions_fallback:
38
- authors:
39
- - -
12
+ date: 2008-03-08 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: TMail is a Ruby-based mail handler. It allows you to compose stadards compliant emails in a very Ruby-way.
17
+ email: raasdnil AT gmail.com
18
+ executables: []
19
+
20
+ extensions:
21
+ - ext/tmailscanner/tmail/extconf.rb
22
+ extra_rdoc_files:
23
+ - README
24
+ - Rakefile
25
+ - MANIFEST
26
+ - NOTES
27
+ - CHANGES
28
+ - LICENSE
40
29
  files:
30
+ - Rakefile
31
+ - doc
41
32
  - test
33
+ - test/temp_test_one.rb
34
+ - test/kcode.rb
35
+ - test/test_utils.rb
36
+ - test/test_attachments.rb
37
+ - test/test_encode.rb
38
+ - test/test_mbox.rb
39
+ - test/test_helper.rb
40
+ - test/test_header.rb
41
+ - test/test_base64.rb
42
+ - test/test_address.rb
42
43
  - test/fixtures
43
- - test/fixtures/raw_email_quoted_with_0d0a
44
- - test/fixtures/raw_email2
45
- - test/fixtures/raw_email3
46
- - test/fixtures/raw_email4
47
- - test/fixtures/raw_email5
48
- - test/fixtures/raw_email6
49
- - test/fixtures/raw_email7
50
- - test/fixtures/raw_email_with_illegal_boundary
51
44
  - test/fixtures/raw_email8
52
- - test/fixtures/raw_email9
53
- - test/fixtures/raw_base64_decoded_string
54
- - test/fixtures/raw_email
55
- - test/fixtures/raw_email10
56
- - test/fixtures/raw_email11
57
- - test/fixtures/raw_email12
45
+ - test/fixtures/raw_email_simple
58
46
  - test/fixtures/raw_email13
59
- - test/fixtures/raw_base64_encoded_string
47
+ - test/fixtures/raw_email5
48
+ - test/fixtures/mailbox_without_any_from_or_sender
49
+ - test/fixtures/raw_email4
50
+ - test/fixtures/mailbox
60
51
  - test/fixtures/raw_email_with_nested_attachment
61
- - test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
62
- - test/fixtures/raw_email_with_quoted_illegal_boundary
63
- - test/fixtures/raw_email_with_partially_quoted_subject
64
- - test/fixtures/raw_email_simple
65
- - test/fixtures/raw_base64_email
66
- - test/fixtures/raw_email_with_bad_date
67
- - test/fixtures/raw_email_reply
52
+ - test/fixtures/raw_email
53
+ - test/fixtures/raw_email_quoted_with_0d0a
54
+ - test/fixtures/raw_base64_decoded_string
68
55
  - test/fixtures/mailbox_without_return_path
69
- - test/fixtures/mailbox
56
+ - test/fixtures/raw_email3
57
+ - test/fixtures/raw_email_reply
58
+ - test/fixtures/raw_email_with_bad_date
70
59
  - test/fixtures/mailbox_without_from
71
- - test/fixtures/mailbox_without_any_from_or_sender
72
- - test/test_helper.rb
73
- - test/test_utils.rb
60
+ - test/fixtures/raw_email_multiple_from
61
+ - test/fixtures/raw_email10
62
+ - test/fixtures/raw_email_with_quoted_illegal_boundary
63
+ - test/fixtures/raw_base64_email
64
+ - test/fixtures/raw_email_with_partially_quoted_subject
65
+ - test/fixtures/raw_email9
66
+ - test/fixtures/raw_email2
67
+ - test/fixtures/raw_email11
68
+ - test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
69
+ - test/fixtures/raw_email_with_illegal_boundary
70
+ - test/fixtures/raw_email6
71
+ - test/fixtures/raw_email7
72
+ - test/fixtures/raw_base64_encoded_string
73
+ - test/fixtures/raw_email12
74
74
  - test/test_mail.rb
75
- - test/extctrl.rb
76
- - test/kcode.rb
77
- - test/test_base64.rb
78
- - test/test_port.rb
79
- - test/test_address.rb
80
- - test/test_mbox.rb
81
- - test/test_header.rb
82
75
  - test/test_scanner.rb
83
- - test/test_encode.rb
84
- - test/test_attachments.rb
76
+ - test/test_port.rb
77
+ - test/extctrl.rb
85
78
  - test/test_quote.rb
86
- - sample
87
- - sample/data
88
- - sample/data/test
89
- - sample/data/multipart
90
- - sample/data/normal
91
- - sample/data/sendtest
92
- - sample/data/simple
93
- - sample/from-check.rb
94
- - sample/multipart.rb
95
- - sample/parse-bench.rb
96
- - sample/parse-test.rb
97
- - sample/extract-attachements.rb
98
- - sample/sendmail.rb
99
- - sample/bench_base64.rb
79
+ - NOTES
80
+ - CHANGES
81
+ - LICENSE
100
82
  - README
101
83
  - ext
102
- - ext/Makefile
103
84
  - ext/tmailscanner
104
85
  - ext/tmailscanner/tmail
105
86
  - ext/tmailscanner/tmail/depend
106
- - ext/tmailscanner/tmail/tmailscanner.c
107
87
  - ext/tmailscanner/tmail/MANIFEST
108
88
  - ext/tmailscanner/tmail/extconf.rb
109
- - pkg
110
- - Rakefile
89
+ - ext/tmailscanner/tmail/tmailscanner.c
90
+ - ext/Makefile
91
+ - setup.rb
92
+ - meta
93
+ - meta/MANIFEST
94
+ - meta/project.yaml
95
+ - meta/unixname
96
+ - meta/VERSION
97
+ - site
98
+ - site/img
99
+ - site/img/tfire.jpg
100
+ - site/img/stamp.jpg
101
+ - site/img/tmail.png
102
+ - site/img/mailman.gif
103
+ - site/img/envelope.jpg
104
+ - site/img/stamp-sm.jpg
105
+ - site/img/stampborder.jpg
106
+ - site/quickstart
107
+ - site/quickstart/usage.html
108
+ - site/quickstart/index.html
109
+ - site/quickstart/quickstart.html
110
+ - site/js
111
+ - site/js/jquery.js
112
+ - site/outdated
113
+ - site/outdated/DEPENDS
114
+ - site/outdated/Incompatibilities
115
+ - site/outdated/Incompatibilities.ja
116
+ - site/outdated/README.ja
117
+ - site/outdated/NEWS
118
+ - site/outdated/doc.ja
119
+ - site/outdated/doc.ja/config.html
120
+ - site/outdated/doc.ja/usage.html
121
+ - site/outdated/doc.ja/mailbox.html
122
+ - site/outdated/doc.ja/mail.html
123
+ - site/outdated/doc.ja/index.html
124
+ - site/outdated/doc.ja/basics.html
125
+ - site/outdated/doc.ja/tmail.html
126
+ - site/outdated/doc.ja/address.html
127
+ - site/outdated/doc.ja/details.html
128
+ - site/outdated/doc.ja/port.html
129
+ - site/outdated/rdd
130
+ - site/outdated/rdd/mail.rrd.m
131
+ - site/outdated/rdd/port.rrd.m
132
+ - site/outdated/rdd/config.rrd.m
133
+ - site/outdated/rdd/index.rhtml.m
134
+ - site/outdated/rdd/mailbox.rrd.m
135
+ - site/outdated/rdd/usage.rd.m
136
+ - site/outdated/rdd/basics.rd.m
137
+ - site/outdated/rdd/details.rd.m
138
+ - site/outdated/rdd/tmail.rrd.m
139
+ - site/outdated/rdd/address.rrd.m
140
+ - site/outdated/BUGS
141
+ - site/index.html
142
+ - site/contributing
143
+ - site/contributing/index.html
144
+ - site/reference
145
+ - site/reference/config.html
146
+ - site/reference/mailbox.html
147
+ - site/reference/mail.html
148
+ - site/reference/index.html
149
+ - site/reference/tmail.html
150
+ - site/reference/address.html
151
+ - site/reference/port.html
152
+ - site/css
153
+ - site/css/layout.css
154
+ - site/css/style.css
155
+ - site/css/clean.css
156
+ - site/download
157
+ - site/download/index.html
158
+ - site/log
159
+ - site/log/changelog.xml
160
+ - site/log/Changelog.xsl
111
161
  - lib
162
+ - lib/tmail.rb
112
163
  - lib/tmail
113
- - lib/tmail/mail.rb
114
- - lib/tmail/compat.rb
115
164
  - lib/tmail/base64.rb
116
- - lib/tmail/port.rb
117
- - lib/tmail/address.rb
118
- - lib/tmail/net.rb
119
- - lib/tmail/header.rb
165
+ - lib/tmail/loader.rb
166
+ - lib/tmail/main.rb
120
167
  - lib/tmail/scanner.rb
121
- - lib/tmail/mailbox.rb
122
- - lib/tmail/index.rb
123
- - lib/tmail/parser.rb
168
+ - lib/tmail/require_arch.rb
169
+ - lib/tmail/config.rb
170
+ - lib/tmail/port.rb
124
171
  - lib/tmail/encode.rb
125
- - lib/tmail/stringio.rb
126
- - lib/tmail/utils.rb
172
+ - lib/tmail/scanner_r.rb
173
+ - lib/tmail/parser.rb
174
+ - lib/tmail/version.rb
175
+ - lib/tmail/obsolete.rb
127
176
  - lib/tmail/parser.y
128
- - lib/tmail/mbox.rb
129
- - lib/tmail/config.rb
130
177
  - lib/tmail/quoting.rb
131
- - lib/tmail/loader.rb
132
- - lib/tmail/scanner_r.rb
178
+ - lib/tmail/mbox.rb
133
179
  - lib/tmail/Makefile
134
- - lib/tmail/obsolete.rb
180
+ - lib/tmail/stringio.rb
181
+ - lib/tmail/utils.rb
135
182
  - lib/tmail/interface.rb
136
- - lib/tmail/core_extensions.rb
137
183
  - lib/tmail/attachments.rb
138
- - lib/tmail/version.rb
139
- - lib/tmail/main.rb
140
- - lib/tmail/require_arch.rb
141
- - lib/tmail.rb
142
- - LICENSE
184
+ - lib/tmail/index.rb
185
+ - lib/tmail/mail.rb
186
+ - lib/tmail/net.rb
187
+ - lib/tmail/address.rb
188
+ - lib/tmail/header.rb
189
+ - lib/tmail/compat.rb
190
+ - lib/tmail/mailbox.rb
191
+ - lib/tmail/core_extensions.rb
192
+ - sample
193
+ - sample/extract-attachements.rb
194
+ - sample/parse-test.rb
195
+ - sample/bench_base64.rb
196
+ - sample/multipart.rb
197
+ - sample/parse-bench.rb
198
+ - sample/data
199
+ - sample/data/test
200
+ - sample/data/normal
201
+ - sample/data/simple
202
+ - sample/data/multipart
203
+ - sample/data/sendtest
204
+ - sample/from-check.rb
205
+ - sample/sendmail.rb
206
+ - work
207
+ - work/script
208
+ - work/script/test
209
+ - work/script/rdoc
210
+ - work/script/setup
211
+ - work/script/make
143
212
  - log
144
- - log/History.txt
145
- - log/ChangeLog.txt
213
+ - log/BugTrackingLog.txt
214
+ - log/Changelog.txt
215
+ - log/Changelog-0.txt
146
216
  - log/Todo.txt
147
- - meta
148
- - meta/icli.yaml
149
- - meta/config.yaml
150
- - meta/MANIFEST
151
- - meta/project.yaml
152
- - meta/tmail.roll
153
- - doc
154
- - script
155
- - script/clobber
156
- - script/clobber/package
157
- - script/clobber/distclean
158
- - script/publish
159
- - script/rdoc
160
- - script/setup
161
- - script/stats
162
- - script/pack
163
- - script/pack/gem
164
- - script/pack/tgz
165
- - script/pack/zip
166
- - script/stamp
167
- - script/prepare
168
- - script/compile
169
- - script/tag
170
- - script/test
171
- - script/release
172
- - script/changelog
173
- - CHANGES
174
- - NOTES
217
+ - log/Testlog.txt
218
+ - MANIFEST
219
+ has_rdoc: true
220
+ homepage: http://tmail.rubyforge.org
221
+ post_install_message:
222
+ rdoc_options:
223
+ - --inline-source
224
+ - --title
225
+ - TMail
226
+ - --main
227
+ - README
228
+ require_paths:
229
+ - lib
230
+ - ext/tmailscanner
231
+ required_ruby_version: !ruby/object:Gem::Requirement
232
+ requirements:
233
+ - - ">="
234
+ - !ruby/object:Gem::Version
235
+ version: "0"
236
+ version:
237
+ required_rubygems_version: !ruby/object:Gem::Requirement
238
+ requirements:
239
+ - - ">="
240
+ - !ruby/object:Gem::Version
241
+ version: "0"
242
+ version:
243
+ requirements: []
244
+
245
+ rubyforge_project: tmail
246
+ rubygems_version: 1.0.1
247
+ signing_key:
248
+ specification_version: 2
249
+ summary: Ruby Mail Handler
175
250
  test_files:
251
+ - test/temp_test_one.rb
252
+ - test/kcode.rb
253
+ - test/test_utils.rb
254
+ - test/test_attachments.rb
255
+ - test/test_encode.rb
256
+ - test/test_mbox.rb
257
+ - test/test_helper.rb
258
+ - test/test_header.rb
259
+ - test/test_base64.rb
260
+ - test/test_address.rb
176
261
  - test/fixtures
177
- - test/fixtures/raw_email_quoted_with_0d0a
178
- - test/fixtures/raw_email2
179
- - test/fixtures/raw_email3
180
- - test/fixtures/raw_email4
181
- - test/fixtures/raw_email5
182
- - test/fixtures/raw_email6
183
- - test/fixtures/raw_email7
184
- - test/fixtures/raw_email_with_illegal_boundary
185
262
  - test/fixtures/raw_email8
186
- - test/fixtures/raw_email9
187
- - test/fixtures/raw_base64_decoded_string
188
- - test/fixtures/raw_email
189
- - test/fixtures/raw_email10
190
- - test/fixtures/raw_email11
191
- - test/fixtures/raw_email12
263
+ - test/fixtures/raw_email_simple
192
264
  - test/fixtures/raw_email13
193
- - test/fixtures/raw_base64_encoded_string
265
+ - test/fixtures/raw_email5
266
+ - test/fixtures/mailbox_without_any_from_or_sender
267
+ - test/fixtures/raw_email4
268
+ - test/fixtures/mailbox
194
269
  - test/fixtures/raw_email_with_nested_attachment
195
- - test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
196
- - test/fixtures/raw_email_with_quoted_illegal_boundary
197
- - test/fixtures/raw_email_with_partially_quoted_subject
198
- - test/fixtures/raw_email_simple
199
- - test/fixtures/raw_base64_email
200
- - test/fixtures/raw_email_with_bad_date
201
- - test/fixtures/raw_email_reply
270
+ - test/fixtures/raw_email
271
+ - test/fixtures/raw_email_quoted_with_0d0a
272
+ - test/fixtures/raw_base64_decoded_string
202
273
  - test/fixtures/mailbox_without_return_path
203
- - test/fixtures/mailbox
274
+ - test/fixtures/raw_email3
275
+ - test/fixtures/raw_email_reply
276
+ - test/fixtures/raw_email_with_bad_date
204
277
  - test/fixtures/mailbox_without_from
205
- - test/fixtures/mailbox_without_any_from_or_sender
206
- - test/test_helper.rb
207
- - test/test_utils.rb
278
+ - test/fixtures/raw_email_multiple_from
279
+ - test/fixtures/raw_email10
280
+ - test/fixtures/raw_email_with_quoted_illegal_boundary
281
+ - test/fixtures/raw_base64_email
282
+ - test/fixtures/raw_email_with_partially_quoted_subject
283
+ - test/fixtures/raw_email9
284
+ - test/fixtures/raw_email2
285
+ - test/fixtures/raw_email11
286
+ - test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
287
+ - test/fixtures/raw_email_with_illegal_boundary
288
+ - test/fixtures/raw_email6
289
+ - test/fixtures/raw_email7
290
+ - test/fixtures/raw_base64_encoded_string
291
+ - test/fixtures/raw_email12
208
292
  - test/test_mail.rb
209
- - test/extctrl.rb
210
- - test/kcode.rb
211
- - test/test_base64.rb
212
- - test/test_port.rb
213
- - test/test_address.rb
214
- - test/test_mbox.rb
215
- - test/test_header.rb
216
293
  - test/test_scanner.rb
217
- - test/test_encode.rb
218
- - test/test_attachments.rb
294
+ - test/test_port.rb
295
+ - test/extctrl.rb
219
296
  - test/test_quote.rb
220
- rdoc_options: []
221
-
222
- extra_rdoc_files: []
223
-
224
- executables: []
225
-
226
- extensions: []
227
-
228
- requirements: []
229
-
230
- dependencies: []
231
-