matth-growl-atom 0.0.2-universal-darwin-9 → 0.0.3-universal-darwin-9

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.
Files changed (4) hide show
  1. data/bin/growl-atom +2 -2
  2. data/config +2 -0
  3. data/lib/growl-atom.rb +11 -1
  4. metadata +2 -2
data/bin/growl-atom CHANGED
@@ -49,8 +49,8 @@ case ARGV[0]
49
49
 
50
50
  # Create user config dir
51
51
  system 'mkdir -p ' + File.join(user_dir, '.growl-atom/caches')
52
- system "cp #{File.join(gem_dir, 'config')} #{File.join(user_dir, '.growl-atom/config')}"
53
- system "cp -r #{File.join(gem_dir, 'icons')} #{File.join(user_dir, '.growl-atom/icons')}"
52
+ system "cp -i #{File.join(gem_dir, 'config')} #{File.join(user_dir, '.growl-atom/config')}"
53
+ system "cp -ri #{File.join(gem_dir, 'icons')} #{File.join(user_dir, '.growl-atom/icons')}"
54
54
 
55
55
  # Create Launch Agent dir
56
56
  if (!File.directory?(launch_agents_dir))
data/config CHANGED
@@ -13,6 +13,7 @@
13
13
  # url: http://your.feed.com
14
14
  # auth_user: http_user
15
15
  # auth_pass: http_pass
16
+ # cert: /path/to/your/client/cert.pem
16
17
  # title: Name of Atom entry node to be used as notification title, default is title
17
18
  # message: Name of Atom entry node to be used as notification message, default is summary
18
19
  # image: /path/to/notification/icon.png
@@ -35,3 +36,4 @@ feeds:
35
36
  title: author/email
36
37
  message: title
37
38
  sticky: false
39
+
data/lib/growl-atom.rb CHANGED
@@ -9,7 +9,7 @@ require 'rexml/document'
9
9
 
10
10
  module GrowlAtom
11
11
 
12
- VERSION = "0.0.2"
12
+ VERSION = "0.0.3"
13
13
 
14
14
  class Error < StandardError; end
15
15
 
@@ -59,6 +59,14 @@ module GrowlAtom
59
59
  req.basic_auth options['auth_user'], options['auth_pass']
60
60
  end
61
61
 
62
+ if (options['cert'])
63
+ File.open(File.expand_path(options['cert'])) do |cert_file|
64
+ key_data = cert_file.read
65
+ http.cert = OpenSSL::X509::Certificate.new(key_data)
66
+ http.key = OpenSSL::PKey::RSA.new(key_data, nil)
67
+ end
68
+ end
69
+
62
70
  response = http.request(req)
63
71
 
64
72
  if (!response.kind_of?(Net::HTTPClientError) && !response.kind_of?(Net::HTTPServerError))
@@ -98,6 +106,8 @@ module GrowlAtom
98
106
  Growl.notify(growl_options['message'], growl_options)
99
107
 
100
108
  system("echo #{id} >> #{cache_file}")
109
+ system("tail -n 500 #{cache_file} > #{cache_file}.tmp")
110
+ system("mv #{cache_file}.tmp #{cache_file}")
101
111
 
102
112
  end
103
113
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matth-growl-atom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: universal-darwin-9
6
6
  authors:
7
7
  - Matt Haynes
@@ -36,7 +36,7 @@ files:
36
36
  - lib/growl-atom.rb
37
37
  - icons/gmail.png
38
38
  has_rdoc: false
39
- homepage: http://matthaynes.net/blog/
39
+ homepage: http://github.com/matth/growl-atom/tree/master
40
40
  post_install_message:
41
41
  rdoc_options: []
42
42