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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDNjNzY3MjU5YjZhMDcyMzY5OWQ5YmQxZTc3ODViNzJmZmM3NzU1MQ==
4
+ M2E4MTk5Nzc3YTU1MjFjNmUyYzdlZjBjOTU4ZTgwOWIwZTBlMTBhYQ==
5
5
  data.tar.gz: !binary |-
6
- NWE5YmNiYTdhNzk1Y2I1YjI0YzdlMGQxZmQyYmEzZjEwNDY3ZDdiMw==
6
+ ZmEwYTMyNjE4ZGY5YzljYzM2OWY3M2ZmZTBjZWY0MTY5Y2E0YzhlNw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTNhY2ZlYTdjMTVmNTFiNWI5NjA4NWY0N2E4ZTIzNzgxMGZmYzNiYzE5YmI3
10
- ZDhkMTA4ZTA4YmMxZTJmOWQyNDhjMDc1OWE2YTA4MDU4ZTA4Zjc1NWIzYzMw
11
- YTcyMTAwNDQ4Y2JmYTgzZWUwMjFhMDJmNzE4MjZlZDgwNWZiMjg=
9
+ YjFmMzgwZTZjZWY5ZTNmNjI0ZDdiOTVlYjhhNmM1ZjUxN2FjYmZhYTY2MzU5
10
+ OTBmMTM5MDgwZmVmNTNhZGIwMTZjMDA0MDc5MGZmYzc4MGRiZjk1YTMxMmU5
11
+ NmFiOWQwNzllMTBlMWU2MWQ0NTAxNWNhZGNlMTg2ZmU2NTFiNDU=
12
12
  data.tar.gz: !binary |-
13
- NmYzN2ZkZDE3MDY4OTUwYTkxYTIzZGRlM2YwYzRjZGM3Y2M3ZjJkNjgwMGNi
14
- YjgxNTU5OTFiY2FkMDM3NTQzOTkzZDM0OGZlM2ZmODU0MzBiNjNkYTUzZjE3
15
- NWNkMWJiYmYxMjE5YjBkNjlmZDFjOTk1NDVjMzFjY2VjNDA1OTc=
13
+ ZmJiMTRjODRjMzgwOTBmZTA5ZmFhM2MzMTYwODY3ZWU1NTA1Yjk2ZDA4Yzdk
14
+ ZGJkMmE1NjQwZTFkZDdjMmM2NjJkODg4YTk1NDU3ZDE0NjI3MmQ3YzRkMjNl
15
+ MWZlZGEwNTU1YzhhNTc2NmQ5YzhhZWEyN2M3ZTNlZGI4NzJhNzA=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- imap_notifier (0.2.1)
4
+ imap_notifier (0.2.2)
5
5
  highline
6
6
  ruby-growl
7
7
  terminal-notifier
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
- begin
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
 
@@ -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 }
@@ -1,3 +1,3 @@
1
1
  class IMAP_Notifier
2
- VERSION='0.2.1'
2
+ VERSION='0.2.2'
3
3
  end
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.1
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-08-21 00:00:00.000000000 Z
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.6
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,