mailcvt 0.1.25 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mail_cleaner.rb CHANGED
@@ -42,14 +42,18 @@ class MailCleaner
42
42
  raise "#{d} exits." if Dir.exist?(d)
43
43
  end
44
44
 
45
- Dir.mkdir d
45
+ Dir.mkdir d unless Dir.exist?(d)
46
+ hasfile = false
46
47
  File.foreach(f) do |fn|
47
48
  begin
48
49
  filename = File.basename(fn)
49
50
  File.rename fn, File.join(d, filename)
51
+ hasfile = true
50
52
  rescue Exception
51
53
  puts "Can't move file #{fn} to #{d}. \n#{e.messge}\n#{e.backtrace.inspect}"
52
54
  end
53
55
  end
56
+
57
+ Dir.rmdir d unless hasfile
54
58
  end
55
59
  end
@@ -1,3 +1,3 @@
1
1
  module Mailcvt
2
- VERSION = '0.1.25'
2
+ VERSION = '0.1.26'
3
3
  end
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.25
4
+ version: 0.1.26
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: 2539150276851404024
123
+ hash: -3533885019531506818
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: 2539150276851404024
132
+ hash: -3533885019531506818
133
133
  requirements: []
134
134
  rubyforge_project:
135
135
  rubygems_version: 1.8.25