imap_notifier 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 657284d3970cf3cf8a8f767e415b1c6537d2ecaf
4
- data.tar.gz: 7398a090da84ac35fd2365706d27b869a2be27e2
3
+ metadata.gz: 070c8430cdeedbb65f412669840be00759a8423c
4
+ data.tar.gz: c6cfb31a9864c96f626a45c3d166dd5913fc1a8a
5
5
  SHA512:
6
- metadata.gz: 97a9d4c951428efcad1c2d4fc303ab884ae2db5e1715f61c3adc760219dc8a4cd3dfa8a3e357b913d90c7b1f492bab73238599a2a262baf67b2c9f4e56019c73
7
- data.tar.gz: 0710af980c03386b28f3e979e9844dc510a5cb060e747e9fc5ef8fe1b08314420a847f8a985feee643baa105a06d4750b4b0e4a56c99f554b749525306e3cf07
6
+ metadata.gz: 34526617775c9a533ad70293f9fe230a04228708936c5003a05cff9706baa0dcde638acc2654abf3ff7291e248be148ff7e6c5905e630fcee21ac6905a63e812
7
+ data.tar.gz: c12eece42e6109ada6e6197e621da2c528c4a98e5b118b2d0babd40a6c71ba899249285f58a0cf0441ab29b858ca7253f8ca208ebfa736a1f1f223b324c909d1
data/README.md CHANGED
@@ -29,6 +29,16 @@ For Keychain Access support, specify the keychain item name and account in .imap
29
29
  key_name: 'keychain.name.com'
30
30
  key_account: 'han.solo@keychain-account.com'
31
31
 
32
+ For [pass](http://www.passwordstore.org/) support, specify the pass-name.
33
+
34
+ pass: 'han.solo'
35
+
36
+ For [1pass](https://github.com/georgebrock/1pass) support, specify the item and keychain path (if not ``~/Dropbox/1Password.agilekeychain``).
37
+
38
+ onepass: 'han.solo'
39
+ one_path: '/Volumes/passwords/1Password.agilekeychain'
40
+
41
+
32
42
  Usage
33
43
  ---------
34
44
 
@@ -6,11 +6,10 @@ class IMAP_Notifier
6
6
  @user = "#{opts[:user]}@#{@domain}"
7
7
  $key_name = opts[:key_name] || false
8
8
  $key_account = opts[:key_account] || false
9
- if $key_name && $key_account
10
- @password = keychain_access || get_password
11
- else
12
- @password = opts[:password] || get_password
13
- end
9
+ $pass = opts[:pass] || false
10
+ $one_path = opts[:one_path] || false
11
+ $onepass = opts[:onepass] || false
12
+ @password = opts[:password] || get_password
14
13
  @folders = mbox_conf opts[:folders] || ['INBOX']
15
14
  @debug = opts[:debug] || false
16
15
  @max_mail = opts[:max] || MAX_MAIL
@@ -22,26 +21,32 @@ class IMAP_Notifier
22
21
  end
23
22
 
24
23
  private
25
- def keychain_access
26
- key = get_keychain
27
- if key == ""
28
- return nil
24
+ def get_password
25
+ if $key_name && $key_account
26
+ key = %x{security find-internet-password -w -a #{$key_account} -s #{$key_name}}
27
+ elsif $pass
28
+ key = %x{pass #{$pass}}
29
+ elsif $onepass
30
+ if $one_path
31
+ key = %x{1pass --path "#{$one_path}" #{$onepass}}
32
+ else
33
+ key = %x{1pass #{$onepass}}
34
+ end
35
+ end
36
+ if key.nil? || key.empty?
37
+ key = pass_prompt
29
38
  end
30
39
  return key.chomp
31
40
  end
32
41
 
33
42
  private
34
- def get_keychain
35
- key = %x{security find-internet-password -w -a #{$key_account} -s #{$key_name}}
36
- end
37
-
38
- private
39
- def get_password(prompt="Enter Password: ")
43
+ def pass_prompt(prompt="Enter Password: ")
40
44
  ask(prompt) { |q| q.echo = false }
41
45
  end
42
46
 
43
47
  def read_conf opts
44
- file = File.expand_path("~/.imap_notifier")
48
+ config = opts[:config] || "~/.imap_notifier"
49
+ file = File.expand_path(config)
45
50
  return if ! File.exists? file
46
51
  ensure_perms file
47
52
  YAML.load(File.open(file)).each do |k,v|
@@ -57,4 +62,3 @@ class IMAP_Notifier
57
62
  exit 1
58
63
  end
59
64
  end
60
-
@@ -1,3 +1,3 @@
1
1
  class IMAP_Notifier
2
- VERSION='0.2.7'
2
+ VERSION='0.2.8'
3
3
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: highline
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ruby-growl
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: terminal-notifier
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Notification of new, unread email via IMAP
@@ -87,7 +87,7 @@ executables:
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".gitignore"
90
+ - .gitignore
91
91
  - Gemfile
92
92
  - Gemfile.lock
93
93
  - LICENSE.txt
@@ -112,12 +112,12 @@ require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: 1.9.2
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ">="
120
+ - - '>='
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
@@ -129,3 +129,4 @@ summary: Notification of new, unread email via IMAP using Ruby, Highline, Net/IM
129
129
  and terminal-notifier/ruby-growl. If you're running Max OSX > 10.8, terminal-notifier
130
130
  is required, otherwise ruby-growl and Growl is required.
131
131
  test_files: []
132
+ has_rdoc: