reckoner 0.9.3 → 0.9.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,10 @@
1
+ === 0.9.4.1
2
+ * Excluding files that are more than a day in the future from Freshness
3
+ checks.
4
+
5
+ === 0.9.4
6
+ * Fixed a problem with mail when running from a CRON job
7
+
1
8
  === 0.9.0 / 2010-3-31
2
9
  * Moving to github and gemcutter
3
10
  * Switched to new 'mail' gem instead of rolling my own
@@ -4,6 +4,7 @@ require 'yaml'
4
4
  require 'optparse'
5
5
  require 'fileutils'
6
6
  require 'mail'
7
+ require 'socket'
7
8
 
8
9
  require 'rfile.rb'
9
10
  require 'abstract_check.rb'
@@ -16,7 +17,7 @@ with the command line arguments, configuration file and email.
16
17
  =end
17
18
 
18
19
  class Main
19
- VERSION = '0.9.3'
20
+ VERSION = '0.9.4.1'
20
21
  include SampleFile
21
22
 
22
23
  DEFAULT_ARGUMENTS = {
@@ -106,9 +107,13 @@ class Main
106
107
  always_mail = mail_config['always_mail'] || true
107
108
 
108
109
  mail = Mail.new
109
- mail[:from] = mail_config['from'] || ENV['USER'] + '@' + ENV['HOSTNAME']
110
110
  mail[:to] = mail_config['to']
111
111
 
112
+ mail_user = ENV['USER'] || 'reckoner'
113
+ mail_host = Socket.gethostname || ENV['HOSTNAME'] || 'unknown'
114
+
115
+ mail[:from] = mail_user + '@' + mail_host.downcase
116
+
112
117
  prefix = mail_config['subject_prefix'] || 'Reckoner:'
113
118
  prefix.strip
114
119
 
@@ -14,8 +14,10 @@ class Freshness < AbstractCheck
14
14
  hours = unit_parse(options,HOUR_HASH)
15
15
 
16
16
  old_time = Time.now - (hours * SECONDS_IN_HOUR)
17
+ tomorrow = Time.now + (24 * SECONDS_IN_HOUR)
17
18
 
18
- unless path_obj.any_sub_node?{|f| f.mtime > old_time}
19
+ unless path_obj.any_sub_node?{|f| f.mtime < tomorrow && f.mtime > old_time}
20
+ #unless path_obj.any_sub_node?{|f| f.mtime > old_time}
19
21
  add_error('file is too old')
20
22
  end
21
23
  end
metadata CHANGED
@@ -5,8 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 3
9
- version: 0.9.3
8
+ - 4
9
+ - 1
10
+ version: 0.9.4.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Geoff Kloess
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-31 00:00:00 -07:00
18
+ date: 2010-07-27 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency