imap_notifier 0.2.1 → 0.2.2
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 +8 -8
- data/Gemfile.lock +1 -1
- data/bin/imap_notifier +1 -10
- data/lib/imap_notifier/base.rb +11 -0
- data/lib/imap_notifier/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2E4MTk5Nzc3YTU1MjFjNmUyYzdlZjBjOTU4ZTgwOWIwZTBlMTBhYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmEwYTMyNjE4ZGY5YzljYzM2OWY3M2ZmZTBjZWY0MTY5Y2E0YzhlNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjFmMzgwZTZjZWY5ZTNmNjI0ZDdiOTVlYjhhNmM1ZjUxN2FjYmZhYTY2MzU5
|
10
|
+
OTBmMTM5MDgwZmVmNTNhZGIwMTZjMDA0MDc5MGZmYzc4MGRiZjk1YTMxMmU5
|
11
|
+
NmFiOWQwNzllMTBlMWU2MWQ0NTAxNWNhZGNlMTg2ZmU2NTFiNDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmJiMTRjODRjMzgwOTBmZTA5ZmFhM2MzMTYwODY3ZWU1NTA1Yjk2ZDA4Yzdk
|
14
|
+
ZGJkMmE1NjQwZTFkZDdjMmM2NjJkODg4YTk1NDU3ZDE0NjI3MmQ3YzRkMjNl
|
15
|
+
MWZlZGEwNTU1YzhhNTc2NmQ5YzhhZWEyN2M3ZTNlZGI4NzJhNzA=
|
data/Gemfile.lock
CHANGED
data/bin/imap_notifier
CHANGED
@@ -46,16 +46,7 @@ opt_parser = OptionParser.new do |opt|
|
|
46
46
|
end
|
47
47
|
|
48
48
|
opt.on('-k', '--kill', "Kill currently running #{opt.program_name} process with SIGINT") do
|
49
|
-
|
50
|
-
pid = IO.readlines(PIDFILE).first.to_i
|
51
|
-
puts "Killing PID: #{pid}"
|
52
|
-
Process.kill("SIGINT", pid)
|
53
|
-
rescue Errno::ESRCH, Errno::ENOENT => e
|
54
|
-
puts "#{e.message} - Exiting..."
|
55
|
-
ensure
|
56
|
-
File.delete(PIDFILE) if File.exists?(PIDFILE)
|
57
|
-
end
|
58
|
-
exit
|
49
|
+
IMAP_Notifier.kill_process
|
59
50
|
end
|
60
51
|
end
|
61
52
|
|
data/lib/imap_notifier/base.rb
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
class IMAP_Notifier
|
2
|
+
def self.kill_process
|
3
|
+
pid = IO.readlines(PIDFILE).first.to_i
|
4
|
+
puts "Killing PID: #{pid}"
|
5
|
+
Process.kill("SIGINT", pid)
|
6
|
+
rescue Errno::ESRCH, Errno::ENOENT => e
|
7
|
+
puts "#{e.message} - Exiting..."
|
8
|
+
ensure
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
2
12
|
def initialize(opts={})
|
3
13
|
config opts
|
4
14
|
@notifier = IMAP_Notifier::Alert.new
|
@@ -9,6 +19,7 @@ class IMAP_Notifier
|
|
9
19
|
$stdout.reopen(DEBUGFILE, 'w')
|
10
20
|
@notifier.alert("DEBUG MODE ENABLED", "DEBUG LOGFILE: #{DEBUGFILE}")
|
11
21
|
end
|
22
|
+
at_exit { File.delete(PIDFILE) if File.exists?(PIDFILE) }
|
12
23
|
run
|
13
24
|
end
|
14
25
|
File.open(PIDFILE, 'w') { |f| f.write pid }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imap_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.0.
|
124
|
+
rubygems_version: 2.0.7
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Notification of new, unread email via IMAP using Ruby, Highline, Net/IMAP,
|