tmail 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # update version stamps
4
-
5
- # You can change these via the command line.
6
- version = commandline['version'] || release.version
7
- status = commandline['status'] || release.status
8
-
9
- # Update ROLLRC file.
10
-
11
- main :stamp do
12
- if version != release.version or status != release.status
13
- build release.file
14
- end
15
- end
16
-
17
- #
18
-
19
- file release.file do
20
- w = ''
21
- w << "#{release.name} #{version} #{status} #{Time.now.strftime('%Y-%m-%d')}"
22
- w << " #{release.default}" if release.default
23
- w << "\n"
24
- w << release.libpath.join("\n")
25
-
26
- if dryrun?
27
- puts release.file + ":"
28
- puts w
29
- else
30
- File.open(release.file, 'w'){|f| f << w}
31
- puts "#{release.file} updated."
32
- end
33
- end
@@ -1,138 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # Simple code count analysis.
4
- #
5
- # This ratchet scan source code counting files,
6
- # lines of code and comments and presents a
7
- # report of it's findings.
8
-
9
- main :stats do
10
- statistics
11
- end
12
-
13
- DEFAULT_STATS_FILES = [ 'lib/**/*', 'ext/**/*', 'bin/**/*' ]
14
-
15
- # Basic statics on line count.
16
- #
17
- # This task counts the file and lines of code in your
18
- # project and provided some statistical figures.
19
- #
20
- # files Files to include and/or exclude in
21
- # analysis. '+' and '-' files patterns
22
- # are accepted. The default includes all
23
- # files in the lib/ and ext/ directories.
24
- #
25
- # TODO Support - and + augmentations for configuration.
26
-
27
- def statistics
28
- config = configuration['stats'] || {}
29
- scripts = config['files'] || DEFAULT_STATS_FILES
30
- files = scripts.inject([]){ |memo, find| memo.concat(glob(find)); memo }
31
- #Dir.multiglob_with_default(DEFAULT_STATS_FILES)
32
-
33
- fc, l, c, r, t, s = *line_count(*files)
34
-
35
- fct, lt, ct, rt, tt, st = *([0]*6)
36
- if File.directory?('test')
37
- fct, lt, ct, rt, tt, st = *line_count('test/**/*')
38
- t = lt if lt > 0
39
- end
40
-
41
- rat = lambda do |d,n|
42
- if d > n and n != 0
43
- "%.1f" % [ d.to_f / n ]
44
- elsif n > d and d != 0
45
- "-" #"%.1f:1" % [ n.to_f / d ]
46
- elsif d == 0 or n == 0
47
- "-"
48
- else
49
- "1.0"
50
- end
51
- end
52
-
53
- per = lambda do |n,d|
54
- if d != 0
55
- (((n.to_f / d)*100).to_i).to_s + "%"
56
- else
57
- "-"
58
- end
59
- end
60
-
61
- max = l.to_s.size + 4
62
-
63
- puts
64
- #puts "FILES:"
65
- #puts " source: #{fc}"
66
- #puts " test : #{fct}"
67
- #puts " total : #{fc+fct}"
68
- #puts
69
- #puts "LINES:"
70
- #puts " code : %#{max}s %4s" % [ c.to_s, per[c,l] ]
71
- #puts " docs : %#{max}s %4s" % [ r.to_s, per[r,l] ]
72
- #puts " space : %#{max}s %4s" % [ s.to_s, per[s,l] ]
73
- #puts " test : %#{max}s %4s" % [ t.to_s, per[t,l] ]
74
- #puts " total : %#{max}s %4s" % [ l.to_s, per[l,l] ]
75
- #puts
76
- #puts "Ratio to 1 :"
77
- #puts " code to test : #{rat[c,t]} #{per[c,t]}"
78
-
79
- head = ["Total", "Code", "-%-", "Docs", "-%-", "Blank", "-%-", "Files"]
80
- prod = [l.to_s, c.to_s, per[c,l], r.to_s, per[r,l], s.to_s, per[s,l], fc]
81
- test = [lt.to_s, ct.to_s, per[ct,l], rt.to_s, per[rt,l], st.to_s, per[st,l], fct]
82
- totl = [(l+lt), (c+ct), per[c+ct,l+lt], (r+rt), per[r+rt,l+lt], (s+st), per[s+st,l+lt], (fc+fct)]
83
-
84
- puts "TYPE %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % head
85
- puts "Source %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % prod
86
- puts "Test %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % test
87
- puts "Total %#{max}s %#{max}s %4s %#{max}s %4s %#{max}s %4s %#{max}s" % totl
88
- puts
89
- puts "RATIO Code Docs Blank Test Total"
90
- puts "Code %7s %7s %7s %7s %7s" % [ rat[c,c], rat[c,r], rat[c,s], rat[c,t], rat[c,l] ]
91
- puts "Docs %7s %7s %7s %7s %7s" % [ rat[r,c], rat[r,r], rat[r,s], rat[r,t], rat[r,l] ]
92
- puts "Blank %7s %7s %7s %7s %7s" % [ rat[s,c], rat[s,r], rat[s,s], rat[s,t], rat[s,l] ]
93
- puts "Test %7s %7s %7s %7s %7s" % [ rat[t,c], rat[t,r], rat[t,s], rat[t,t], rat[t,l] ]
94
- puts "Total %7s %7s %7s %7s %7s" % [ rat[l,c], rat[l,r], rat[l,s], rat[l,t], rat[l,l] ]
95
- puts
96
- end
97
-
98
- private
99
-
100
- # Return line counts for files.
101
-
102
- def line_count( *files )
103
- files = files.inject([]) do |memo, find|
104
- memo.concat(Dir.glob(find)); memo
105
- end
106
-
107
- fc, l, c, t, r = 0, 0, 0, 0, 0
108
- bt, rb = false, false
109
-
110
- files.each do |fname|
111
- next unless fname =~ /.*rb/ # TODO should this be done?
112
- fc += 1
113
- File.open( fname ) do |f|
114
- while line = f.gets
115
- l += 1
116
- next if line =~ /^\s*$/
117
- case line
118
- when /^=begin\s+test/
119
- tb = true; t+=1
120
- when /^=begin/
121
- rb = true; r+=1
122
- when /^=end/
123
- t+=1 if tb
124
- r+=1 if rb
125
- rb, tb = false, false
126
- when /^\s*#/
127
- r += 1
128
- else
129
- c+=1 if !(rb or tb)
130
- r+=1 if rb
131
- t+=1 if tb
132
- end
133
- end
134
- end
135
- end
136
- s = l - c - r - t
137
- return fc, l, c, r, t, s
138
- end
data/script/tag DELETED
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # tag current version
4
-
5
- main :tag do
6
- rubyforge_username = ENV['RUBYFORGE_USERNAME']
7
-
8
- abort "Need RUBYFORGE_USERNAME evironment setting." unless rubyforge_username
9
-
10
- name, version = *File.basename(glob("meta/*.roll").first).chomp('.roll').split('-')
11
-
12
- changes = /^===\s*#{version}(.*?)\n===/m.match(File.read('History.txt'))[0]
13
- changes = changes.chomp('===').strip.sub(/^===\s+/, 'TAG ')
14
-
15
- #puts "#{name}-#{version}"
16
- puts changes
17
- puts
18
-
19
- case ask("Continue? [yN]").strip.downcase
20
- when 'y', 'yes'
21
- svn "copy", "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{name}/trunk",
22
- "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{name}/tags/REL-#{version}"
23
- end
24
-
25
- end
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ratch
2
-
3
- # Run unit tests
4
-
5
- main :test do
6
- $LOAD_PATH.unshift('test')
7
-
8
- find = commandline[0]
9
- live = commandline.flag?('--live')
10
- pure = commandline.flag?('--pure') # pure won't work if live.
11
-
12
- ARGV.replace([]) # ???
13
-
14
- unless live
15
- $LOAD_PATH.unshift(File.expand_path('lib'))
16
- $LOAD_PATH.unshift(File.expand_path('ext/tmailscanner')) unless pure
17
- end
18
-
19
- if find
20
- unless file?(find)
21
- find = File.join(find, '**', 'test_*.rb')
22
- end
23
- else
24
- find = 'test/**/test_*.rb'
25
- end
26
-
27
- files = Dir.glob(find) #.map{ |f| File.join('..', f) }
28
-
29
- #chdir('test') do
30
- files.each do |file|
31
- next unless file?(file)
32
- load file
33
- end
34
- #end
35
- end
36
-