mailcvt 0.1.27 → 0.1.28

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mail_cleaner.rb CHANGED
@@ -10,11 +10,11 @@ class MailCleaner
10
10
  def clean
11
11
  removeok
12
12
  move 'tocc'
13
- move 'others', @fh.getdir("daily-leftovers", true)
13
+ move 'others'
14
14
  end
15
15
 
16
16
  def cleantocc
17
- move 'tocc2', @fh.getdir("daily-leftovers", true)
17
+ move 'tocc2'
18
18
 
19
19
  d = @fh.getdir("dtocc")
20
20
  FileUtils.rm_r(d) if Dir.exists?(d)
@@ -28,21 +28,18 @@ class MailCleaner
28
28
  begin
29
29
  File.delete fn
30
30
  rescue Exception => e
31
- puts "Can't remove file #{fn}. \n#{e.message}\n#{e.backtrace.inspect}"
31
+ puts "Can't remove file #{fn}. \n#{e.message}"
32
32
  end
33
33
  end
34
34
  end
35
35
 
36
- def move(suffix, d = nil)
36
+ def move(suffix)
37
37
  f = @fh.getmout(".f#{suffix}")
38
38
  return unless File.exist?(f)
39
+ d = @fh.getdir("d#{suffix}")
40
+ raise "#{d} exits." if Dir.exist?(d)
39
41
 
40
- unless d
41
- d = @fh.getdir("d#{suffix}")
42
- raise "#{d} exits." if Dir.exist?(d)
43
- end
44
-
45
- Dir.mkdir d unless Dir.exist?(d)
42
+ Dir.mkdir
46
43
  hasfile = false
47
44
  File.foreach(f) do |fn|
48
45
  begin
@@ -50,7 +47,7 @@ class MailCleaner
50
47
  File.rename fn, File.join(d, filename)
51
48
  hasfile = true
52
49
  rescue Exception => e
53
- puts "Can't move file #{fn} to #{d}. \n#{e.messge}\n#{e.backtrace.inspect}"
50
+ puts "Can't move file #{fn} to #{d}. \n#{e.messge}"
54
51
  end
55
52
  end
56
53
 
@@ -1,3 +1,3 @@
1
1
  module Mailcvt
2
- VERSION = '0.1.27'
2
+ VERSION = '0.1.28'
3
3
  end
data/lib/output_helper.rb CHANGED
@@ -16,12 +16,8 @@ class OutputHelper
16
16
  File.join(@output, "mout#{@timestamp}#{ext}")
17
17
  end
18
18
 
19
- def getdir(prefix, notimestamp = false)
20
- if notimestamp
21
- dirname = prefix
22
- else
23
- dirname = "#{prefix}#{@timestamp}"
24
- end
19
+ def getdir(prefix)
20
+ dirname = "#{prefix}#{@timestamp}"
25
21
  File.join(@output, dirname)
26
22
  end
27
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailcvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.28
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -27608697763713352
123
+ hash: -154359963677568307
124
124
  required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  none: false
126
126
  requirements:
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  segments:
131
131
  - 0
132
- hash: -27608697763713352
132
+ hash: -154359963677568307
133
133
  requirements: []
134
134
  rubyforge_project:
135
135
  rubygems_version: 1.8.25