god 0.13.1 → 0.13.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,10 @@
1
+ == 0.13.2 / 2013-02-26
2
+ * Minor Enhancements
3
+ * Added file_touched condition (#86)
4
+ * Bug fixes
5
+ * Ensure Ruby 1.9 fixes only apply to 1.9.0 and 1.9.1 (#125)
6
+ * Documentation fixes (#109, #84, #92)
7
+
1
8
  == 0.13.1 / 2012-09-18
2
9
  * Minor Changes
3
10
  * Prevent auto-loading from bundler by requiring $load_god to require (#97)
@@ -1012,7 +1012,8 @@ delivery_method - The Symbol delivery method. [ :smtp | :sendmail ]
1012
1012
  === SMTP Options (when delivery_method = :smtp) ===
1013
1013
  server_host - The String hostname of the SMTP server (default: localhost).
1014
1014
  server_port - The Integer port of the SMTP server (default: 25).
1015
- server_auth - The Boolean of whether or not to use authentication
1015
+ server_auth - A Boolean or Symbol, false if no authentication else a symbol
1016
+ for the type of authentication [false | :plain | :login | :cram_md5]
1016
1017
  (default: false).
1017
1018
 
1018
1019
  === SMTP Auth Options (when server_auth = true) ===
@@ -1056,7 +1057,7 @@ subject - The String subject of the message (default: "God Notification").
1056
1057
  Prowl
1057
1058
  ~~~~~
1058
1059
 
1059
- Send a notice to Prowl (<a href="http://prowl.weks.net/">http://prowl.weks.net/</a>).
1060
+ Send a notice to Prowl (http://prowl.weks.net/).
1060
1061
 
1061
1062
  ```ruby
1062
1063
  God::Contacts::Prowl.defaults do |d|
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'god'
6
- s.version = '0.13.1'
7
- s.date = '2012-09-18'
6
+ s.version = '0.13.2'
7
+ s.date = '2013-02-26'
8
8
 
9
9
  s.summary = "Process monitoring framework."
10
10
  s.description = "An easy to configure, easy to extend monitoring framework written in Ruby."
@@ -68,6 +68,7 @@ Gem::Specification.new do |s|
68
68
  lib/god/conditions/degrading_lambda.rb
69
69
  lib/god/conditions/disk_usage.rb
70
70
  lib/god/conditions/file_mtime.rb
71
+ lib/god/conditions/file_touched.rb
71
72
  lib/god/conditions/flapping.rb
72
73
  lib/god/conditions/http_response_code.rb
73
74
  lib/god/conditions/lambda.rb
data/lib/god.rb CHANGED
@@ -51,6 +51,7 @@ require 'god/conditions/http_response_code'
51
51
  require 'god/conditions/disk_usage'
52
52
  require 'god/conditions/complex'
53
53
  require 'god/conditions/file_mtime'
54
+ require 'god/conditions/file_touched'
54
55
  require 'god/conditions/socket_responding'
55
56
 
56
57
  require 'god/socket'
@@ -155,7 +156,7 @@ end
155
156
 
156
157
  module God
157
158
  # The String version number for this package.
158
- VERSION = '0.13.1'
159
+ VERSION = '0.13.2'
159
160
 
160
161
  # The Integer number of lines of backlog to keep for the logger.
161
162
  LOG_BUFFER_SIZE_DEFAULT = 100
@@ -0,0 +1,44 @@
1
+ module God
2
+ module Conditions
3
+
4
+ # Condition Symbol :file_touched
5
+ # Type: Poll
6
+ #
7
+ # Trigger when a specified file is touched.
8
+ #
9
+ # Paramaters
10
+ # Required
11
+ # +path+ is the path to the file to watch.
12
+ #
13
+ # Examples
14
+ #
15
+ # Trigger if 'tmp/restart.txt' file is touched (from a Watch):
16
+ #
17
+ # on.condition(:file_touched) do |c|
18
+ # c.path = 'tmp/restart.txt'
19
+ # end
20
+ #
21
+ class FileTouched < PollCondition
22
+ attr_accessor :path
23
+
24
+ def initialize
25
+ super
26
+ self.path = nil
27
+ end
28
+
29
+ def valid?
30
+ valid = true
31
+ valid &= complain("Attribute 'path' must be specified", self) if self.path.nil?
32
+ valid
33
+ end
34
+
35
+ def test
36
+ if File.exists?(self.path)
37
+ (Time.now - File.mtime(self.path)) <= self.interval
38
+ else
39
+ false
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,7 +1,7 @@
1
1
  require 'monitor'
2
2
 
3
- # Ruby 1.9 specific fixes.
4
- unless RUBY_VERSION < '1.9'
3
+ # Ruby 1.9.1 specific fixes.
4
+ if RUBY_VERSION.between?('1.9', '1.9.1')
5
5
  require 'god/compat19'
6
6
  end
7
7
 
@@ -280,7 +280,7 @@ module God
280
280
  # Perform the specifics of the action.
281
281
  #
282
282
  # condition - The Condition.
283
- # action - The Sybmol action.
283
+ # action - The Symbol action.
284
284
  #
285
285
  # Returns nothing.
286
286
  def call_action(condition, action)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 13
8
- - 1
9
- version: 0.13.1
8
+ - 2
9
+ version: 0.13.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tom Preston-Werner
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-09-18 00:00:00 -07:00
19
+ date: 2013-02-26 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -216,6 +216,7 @@ files:
216
216
  - lib/god/conditions/degrading_lambda.rb
217
217
  - lib/god/conditions/disk_usage.rb
218
218
  - lib/god/conditions/file_mtime.rb
219
+ - lib/god/conditions/file_touched.rb
219
220
  - lib/god/conditions/flapping.rb
220
221
  - lib/god/conditions/http_response_code.rb
221
222
  - lib/god/conditions/lambda.rb