imap_notifier 0.2.5 → 0.2.6

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTIwZTIyMzkyMzNhMjk0NWMzZGI0MDhhMzk4NDBlODk0NzdjOWJiNw==
5
+ data.tar.gz: !binary |-
6
+ MzlmNmU5N2I0M2M1MTAxZjdjM2YxZDY4MzRlZTc1OWRhZmYwODAwZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YmQ1NDVlNjBlOTRmMzI1NzMwNDQ4NTVhYmI5M2ZmYzQ4Nzk3YmEwOWYwMzcw
10
+ MzdhYTVlNjk2ZmE3ZWE1YzZlNzI5NTNjYjQ1MmM2NGM1MGQ3NDEyNDZlYTUw
11
+ MWU2M2IzZTk2ZTk5ZDczNzJmOTViODA0ZjgyNjU3NDUwOGEwMmI=
12
+ data.tar.gz: !binary |-
13
+ YjgxYzhlMjhkNDU5ZTBhNTk5ZDAzYzMwZjRkMGJhNzA0MGFkNmRhMzk1MDJl
14
+ NWQ1MmYzZDgxM2MzNDIwMjM3N2JhM2E4Mzk1ZmY5ZGRhM2RkOTgzNTViMGQz
15
+ NWE4NWU4YWE1Nzg3M2I3OWNhMTEyZTY5OWRmNjAzMmYzYzlkYTc=
data/Gemfile CHANGED
@@ -3,11 +3,20 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in imap_notifier.gemspec
4
4
  gemspec
5
5
 
6
- def is_mnt_lion?
7
- @lion ||= (RUBY_PLATFORM.match /(\d+)\.\d+\.\d+$/)[0].to_i >= 12
6
+ def is_macosx_new?
7
+ @macosx_new ||= RUBY_PLATFORM.match(/darwin-?([1][2-9]|[2-9]\d)\./)
8
8
  end
9
9
 
10
- gem 'terminal-notifier', :require => is_mnt_lion?
11
- gem 'ruby-growl', :require => is_mnt_lion?
10
+ def is_macosx?
11
+ @macosx ||= RUBY_PLATFORM.match(/darwin-?(\d|[1][01])\./)
12
+ end
13
+
14
+ def is_linux?
15
+ @linux ||= RUBY_PLATFORM.include? 'linux'
16
+ end
17
+
18
+ gem 'terminal-notifier', :require => is_macosx_new?
19
+ gem 'ruby-growl', :require => is_macosx?
20
+ gem 'libnotify', :require => is_linux?
12
21
 
13
- gem 'highline'
22
+ gem 'highline'
data/lib/imap_notifier.rb CHANGED
@@ -9,17 +9,20 @@ require 'imap_notifier/base'
9
9
  MAX_MAIL = 5 # Max new mails mentioned before they
10
10
  # are grouped together
11
11
  SLEEP = 30
12
- ERRFILE = File.expand_path('~/Desktop/imap_notifier.log')
12
+ ERRFILE = File.expand_path('/tmp/imap_notifier.log')
13
13
  DEBUGFILE = '/tmp/imap_notifier.debug'
14
14
  PIDFILE = '/tmp/imap_notifier.pid'
15
15
  IMAP_SERVER = "imap.gmail.com" # could be anything with tweaks
16
16
 
17
- if `uname`.strip == 'Darwin'
18
- if (OSX_VERSION = `sw_vers -productVersion`.strip) >= '10.8'
19
- require 'imap_notifier/notifier'
20
- else
21
- require 'imap_notifier/growler'
22
- end
17
+ case RUBY_PLATFORM
18
+ when /darwin-?([1][2-9]|[2-9]\d)\./
19
+ # darwin >= 12
20
+ require 'imap_notifier/notifier'
21
+ when /darwin-?(\d|[1][01])\./
22
+ # darwin < 12
23
+ require 'imap_notifier/growler'
24
+ when /linux/
25
+ require 'imap_notifier/libnotify'
23
26
  else
24
27
  raise "You must be running Mac OS X for imap_notifier to work!"
25
28
  end
@@ -62,7 +62,7 @@ class IMAP_Notifier
62
62
 
63
63
  def stop
64
64
  IMAP_Notifier::Alert.remove
65
- self.class.delete_file
65
+ self.class.delete_pid
66
66
  exit
67
67
  end
68
68
 
@@ -0,0 +1,11 @@
1
+ require 'libnotify'
2
+
3
+ class IMAP_Notifier::Alert
4
+ def self.remove
5
+ end
6
+
7
+ def alert(body, opts={})
8
+ opts[:title] ||= self.class.name
9
+ Libnotify.show(:body => body, :summary => opts[:title].to_s, :timeout => 5)
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  class IMAP_Notifier
2
- VERSION='0.2.5'
2
+ VERSION='0.2.6'
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
5
- prerelease:
4
+ version: 0.2.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Campbell
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-02-08 00:00:00.000000000 Z
11
+ date: 2014-04-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: highline
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: ruby-growl
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: terminal-notifier
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -110,35 +99,32 @@ files:
110
99
  - lib/imap_notifier/base.rb
111
100
  - lib/imap_notifier/config.rb
112
101
  - lib/imap_notifier/growler.rb
102
+ - lib/imap_notifier/libnotify.rb
113
103
  - lib/imap_notifier/notifier.rb
114
104
  - lib/imap_notifier/version.rb
115
105
  homepage: https://github.com/dacamp/imap_notifier
116
106
  licenses:
117
107
  - MIT
108
+ metadata: {}
118
109
  post_install_message:
119
110
  rdoc_options: []
120
111
  require_paths:
121
112
  - lib
122
113
  required_ruby_version: !ruby/object:Gem::Requirement
123
- none: false
124
114
  requirements:
125
115
  - - ! '>='
126
116
  - !ruby/object:Gem::Version
127
117
  version: 1.9.2
128
118
  required_rubygems_version: !ruby/object:Gem::Requirement
129
- none: false
130
119
  requirements:
131
120
  - - ! '>='
132
121
  - !ruby/object:Gem::Version
133
122
  version: '0'
134
- segments:
135
- - 0
136
- hash: 726022834722288523
137
123
  requirements: []
138
124
  rubyforge_project:
139
- rubygems_version: 1.8.23
125
+ rubygems_version: 2.2.2
140
126
  signing_key:
141
- specification_version: 3
127
+ specification_version: 4
142
128
  summary: Notification of new, unread email via IMAP using Ruby, Highline, Net/IMAP,
143
129
  and terminal-notifier/ruby-growl. If you're running Max OSX > 10.8, terminal-notifier
144
130
  is required, otherwise ruby-growl and Growl is required.