mmailer 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/mmailer/commands.rb +0 -4
- data/lib/mmailer/server_helper.rb +2 -2
- data/lib/mmailer/version.rb +1 -1
- data/lib/mmailer/worker.rb +16 -4
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/mmailer/commands.rb
CHANGED
@@ -58,8 +58,8 @@ module Mmailer
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
def config(options
|
62
|
-
if options.
|
61
|
+
def config(options)
|
62
|
+
if options.empty?
|
63
63
|
puts "I will send emails every #{Mmailer.configuration.time_interval} seconds. After #{Mmailer.configuration.mail_interval} emails, I will sleep for #{Mmailer.configuration.sleep_time} seconds."
|
64
64
|
else
|
65
65
|
Mmailer.configuration.sleep_time = options.fetch("sleep_time", Mmailer.configuration.sleep_time)
|
data/lib/mmailer/version.rb
CHANGED
data/lib/mmailer/worker.rb
CHANGED
@@ -38,13 +38,19 @@ module Mmailer
|
|
38
38
|
break
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
42
|
-
DRb::stop_service
|
43
|
-
Thread.exit
|
41
|
+
stop
|
44
42
|
end
|
45
43
|
|
46
44
|
def load_collection
|
47
|
-
@collection =
|
45
|
+
@collection = case Mmailer.configuration.collection
|
46
|
+
when Array
|
47
|
+
Mmailer.configuration.collection
|
48
|
+
when Proc
|
49
|
+
Mmailer.configuration.collection.call
|
50
|
+
else
|
51
|
+
obj.puts "Collection needs to be an array or a proc object. It appears to be neither."
|
52
|
+
stop
|
53
|
+
end
|
48
54
|
collection.shift(from)
|
49
55
|
obj.puts "Loaded #{collection.count} entries"
|
50
56
|
end
|
@@ -54,5 +60,11 @@ module Mmailer
|
|
54
60
|
@mail_interval = Mmailer.configuration.mail_interval
|
55
61
|
@sleep_time = Mmailer.configuration.sleep_time
|
56
62
|
end
|
63
|
+
|
64
|
+
def stop
|
65
|
+
obj.puts "Exiting worker, stopping server"
|
66
|
+
DRb::stop_service
|
67
|
+
Thread.exit
|
68
|
+
end
|
57
69
|
end
|
58
70
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|