redimap 0.4.0 → 0.5.0
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.
- checksums.yaml +4 -4
- data/README.md +21 -1
- data/bin/redimap +27 -16
- data/lib/redimap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ff106fa18b156a8c236ea26e3ba03644d023bf8
|
4
|
+
data.tar.gz: dc152c2d823229d6096defd661002cdb960c32f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8f18cc18df4e57895a8cec72c54531e6f248603c684f6e914a38eab81bb5b362df3ae4f95014b9a776797444310ff2afa6ac0e41ea451898a87e33d674de8c7
|
7
|
+
data.tar.gz: 83e38fac9519fbfd59a914a332d5ef8ca23fb73a680f8148d78c591747608ef13e6a660a6f8a82eb22b9643503847e7b5e327cc3b1334c188c0dc5a00f393d19
|
data/README.md
CHANGED
@@ -28,7 +28,27 @@ Check and queue new messages and quit:
|
|
28
28
|
|
29
29
|
$ bundle exec redimap --host mail.example.com --user a@example.com --password helpimacarrot
|
30
30
|
|
31
|
-
|
31
|
+
It is also possible to set config using environment variables. Command-line
|
32
|
+
options override environment variables. Note that environment variables are in
|
33
|
+
lowercase, and are named differently to command-line parameters.
|
34
|
+
|
35
|
+
$ imap_host=mail.example.com imap_user=a@example.com imap_password=helpimacarrot bundle exec redimap
|
36
|
+
|
37
|
+
The complete list of available environment variables is:
|
38
|
+
|
39
|
+
eternal
|
40
|
+
log_level
|
41
|
+
imap_host
|
42
|
+
imap_port
|
43
|
+
imap_username
|
44
|
+
imap_password
|
45
|
+
imap_mailboxes
|
46
|
+
redis_url
|
47
|
+
redis_ns_redimap
|
48
|
+
redis_ns_queue
|
49
|
+
polling_interval
|
50
|
+
|
51
|
+
Use `--eternal` or `eternal=1` to run eternally.
|
32
52
|
|
33
53
|
|
34
54
|
## Contributions
|
data/bin/redimap
CHANGED
@@ -67,7 +67,7 @@ OptionParser.new do |opts|
|
|
67
67
|
opts.separator "Other:"
|
68
68
|
|
69
69
|
opts.on("-v", "--[no-]verbose", "Be somewhat verbose") do |o|
|
70
|
-
options[:
|
70
|
+
options[:log_level] = 'DEBUG'
|
71
71
|
end
|
72
72
|
|
73
73
|
opts.on_tail("--help", "Show this message") do
|
@@ -85,20 +85,31 @@ end.parse!
|
|
85
85
|
# = Configure
|
86
86
|
|
87
87
|
Redimap.configure do |c|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
88
|
+
%w[
|
89
|
+
log_level
|
90
|
+
imap_host
|
91
|
+
imap_port
|
92
|
+
imap_username
|
93
|
+
imap_password
|
94
|
+
imap_mailboxes
|
95
|
+
redis_url
|
96
|
+
redis_ns_redimap
|
97
|
+
redis_ns_queue
|
98
|
+
polling_interval
|
99
|
+
].each do |e_k|
|
100
|
+
e_v = case e_k
|
101
|
+
when 'imap_port'
|
102
|
+
ENV[e_k].to_i
|
103
|
+
when 'imap_mailboxes'
|
104
|
+
ENV[e_k].split(',')
|
105
|
+
else
|
106
|
+
ENV[e_k]
|
107
|
+
end if ENV[e_k] # Read env var if set, parsing as for params.
|
108
|
+
|
109
|
+
e_v = options[e_k.to_sym] if options[e_k.to_sym] # Override from params.
|
110
|
+
|
111
|
+
c.instance_variable_set("@#{e_k}", e_v) if e_v # Only set extant settings.
|
112
|
+
end
|
102
113
|
end
|
103
114
|
|
104
115
|
@logger = Redimap.logger
|
@@ -109,7 +120,7 @@ end
|
|
109
120
|
loop do
|
110
121
|
Redimap.queue_new_mailboxes_uids
|
111
122
|
|
112
|
-
break unless options[:eternal]
|
123
|
+
break unless (options[:eternal] || ENV['eternal'].to_i == 1)
|
113
124
|
|
114
125
|
@logger.debug { "Snoring for #{Redimap.config.polling_interval} s" }
|
115
126
|
|
data/lib/redimap/version.rb
CHANGED