skylight 0.1.4.alpha1 → 0.1.4.alpha2

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: 6312c24e2ef0a54be711b60410888886646f65a0
4
- data.tar.gz: a3dc0c4c3e2374722153c9efe12317955a37fc28
3
+ metadata.gz: 286237c90fbe1e0e498d06e0b53e74c4bc2f5270
4
+ data.tar.gz: 9642d98ba8de748ca46e60e708a95c595d840cb2
5
5
  SHA512:
6
- metadata.gz: d1fedcb75d67f27aa003b8926e40ea1b5eab792b07e486f3e7d1387471e388dc97b2ab85ff8239c13e1eaee593ef6a3fea468c2afd48cabbae57243a95a7b2bd
7
- data.tar.gz: b79ffd3549eb6b0381e86707ae42fbefb2e1e74e05d622681599cfee7c3a1dc37f6edcfd24f353fb7c12546e9d7367c352edc348fb2c76097b2e6205dd84764f
6
+ metadata.gz: 98e253ee2bfd462fb30f5e83da7f54c73c340cbf945224ba0a0679d5d14b9127bc5d9a918e599bf1c868afd5ec9cf794aba2b637f1f1349c911283a5ab8fee46
7
+ data.tar.gz: 796c2df8fc6a41d04e7b7926204b774dbe814c82e2bee4245ed512d8e56c4f09c452e36faa279b4504e4125696843f0fb678bec4a5f69ae243f70eb395581df3
@@ -27,6 +27,9 @@ module Skylight
27
27
  @spans = []
28
28
  @stack = []
29
29
  @parents = []
30
+
31
+ # Track time
32
+ @last_seen_time = start
30
33
  end
31
34
 
32
35
  def root(cat, title = nil, desc = nil, annot = {})
@@ -66,6 +69,8 @@ module Skylight
66
69
  def record(time, cat, title = nil, desc = nil, annot = {})
67
70
  return if @busted
68
71
 
72
+ track_time(time)
73
+
69
74
  sp = span(time, cat, title, desc, annot)
70
75
 
71
76
  return self if :skip == sp
@@ -79,6 +84,8 @@ module Skylight
79
84
  def start(time, cat, title = nil, desc = nil, annot = {})
80
85
  return if @busted
81
86
 
87
+ track_time(time)
88
+
82
89
  sp = span(time, cat, title, desc, annot)
83
90
 
84
91
  push(sp)
@@ -89,6 +96,8 @@ module Skylight
89
96
  def stop(time)
90
97
  return if @busted
91
98
 
99
+ track_time(time)
100
+
92
101
  sp = pop
93
102
 
94
103
  return self if :skip == sp
@@ -177,6 +186,17 @@ module Skylight
177
186
  end
178
187
  end
179
188
 
189
+ def track_time(time)
190
+ if time < @last_seen_time
191
+ @busted = true
192
+ raise TraceError, "time moving backwards; " \
193
+ "prev=#{@last_seen_time}; " \
194
+ "curr=#{time}"
195
+ end
196
+
197
+ @last_seen_time = time
198
+ end
199
+
180
200
  end
181
201
 
182
202
  end
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '0.1.4.alpha1'
2
+ VERSION = '0.1.4.alpha2'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.alpha1
4
+ version: 0.1.4.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.