goat 0.3.39 → 0.3.40

Sign up to get free protection for your applications and to get access to all the features.
data/goat.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'goat'
3
- s.version = '0.3.39'
3
+ s.version = '0.3.40'
4
4
  s.summary = 'Pre-release beta version of Goat'
5
5
  s.author = 'Patrick Collison'
6
6
  s.email = 'patrick@collison.ie'
@@ -40,7 +40,7 @@ module Goat
40
40
  end
41
41
 
42
42
  def self.command
43
- @command || "ruby #{$0} #{ARGV.join(' ')}"
43
+ @command || "ruby #{$0} #{ARGV.join(' ')}"
44
44
  end
45
45
 
46
46
  def initialize(dir, interval)
@@ -6,13 +6,22 @@ module Goat
6
6
  def self.loge(msg); Log.log(:error, msg); end
7
7
 
8
8
  module Log
9
+ def self.tai64n
10
+ # http://cr.yp.to/libtai/tai64.html
11
+ # as of feb 9 2011, TAI - UTC = 34
12
+ # see http://en.wikipedia.org/wiki/Leap_second
13
+ tai_utc_diff = 34
14
+ t = Time.now.utc
15
+ "@40000000%08x%08x" % [t.to_i + tai_utc_diff, (t.to_f - t.to_i) * 10**9]
16
+ end
17
+
9
18
  def self.logname; File.basename($0); end
10
19
  def self.logpath; "/tmp/#{logname}.log"; end
11
20
  def self.lockpath; "/tmp/#{logname}.lock"; end
12
21
  def self.logf; @log ||= File.open(logpath, 'a'); end
13
22
 
14
23
  def self.log(lvl, msg, termmsg=nil)
15
- logf.puts("#{Time.now.asctime} #{msg}")
24
+ logf.puts("#{tai64n} #{msg}")
16
25
  logf.flush
17
26
 
18
27
  termmsg ||= msg
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 67
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 39
10
- version: 0.3.39
9
+ - 40
10
+ version: 0.3.40
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Collison
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-07 00:00:00 +00:00
18
+ date: 2011-02-09 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency