powertrack 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTQwZjFmMTc0YTFhNTlmZWIwYzUyYzRlMWMzMjBiNDZkMjBjN2E5MA==
4
+ YmM3YTA5ZDU2Y2Y2ZDkzNzY2NWMzYjExOWU0OTUwMmFjMGY2NTY0NA==
5
5
  data.tar.gz: !binary |-
6
- NzdkY2IwYTk3ZjVlMzdjZmQzYjZkMmM1ZjI5ZGIzMjIyODI2NTllMw==
6
+ ODZiMjAzMjJhNmI0ZTg1ZGI4MmI4YjgwNjhiMWM0NGY2Mjg3Y2U4Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjhiOTk0NWVhYmRmYzUwNTIyNDI5ZDQ3OGMxYmM2NGI1Y2Y5NGJjZGU3ZTg2
10
- MjAyYzFiZjcyYmIyNDE0ODk3MWNiNTIyMWE1Mzk1NWI1MDc4N2Y5YjE2YmJh
11
- OTMxYjM1NjFjZmIxODczMTRmNzFjZWRhNGI0ODZkYjRlMWE1MGE=
9
+ YWFhMTcyNzU1NjkxOTNhZjE5M2RlNmFmZWQ1OGQwMDZiNTE5MWIyYmI5ZmE1
10
+ NjU2ODNkODllMGI1MjI1NmQyZGRjODc1N2Q5MGQzMWNmY2FjYmRmMzgwYWJl
11
+ MzI0MjQzYjBmMTI5YTdmZjc4NzhkNTg5YjU3YzgxMzgwMWQ2NTM=
12
12
  data.tar.gz: !binary |-
13
- NWJhNjA3MDIyMDkyMDFmZTViNzAxNmNmZTRiOThkYzQ0YWI3YmUwYWYyZTE2
14
- OGMzZGM1NWY4NjJlNTYyOWJmMmUxNTI5NjJjYmZjZDk1YmI0NTc4NWZlYTdl
15
- NzEzODgxMzYwMzNkYzlkZWQyZWQ2YTg0MWRmNmM3MjQ3YjI5NTc=
13
+ ODY0NGIyODVlYmQzMWIwNzBlN2NhYzBjNWM0MzU3YjNkY2I4MGEzMzgxY2Qy
14
+ YWRkMzJiZTRlYmFhMGYyNzNlZTQzZTNkYzVjMGE3MGRkNGRkNWM5MGYyODQ4
15
+ NzE1YjY1NDRmY2MyMDE2NDFlZmYxZDcyYmVlODk5ZjA2YTRkODM=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- powertrack (1.3.0)
4
+ powertrack (1.3.1)
5
5
  em-http-request (~> 1.1)
6
6
  eventmachine (~> 1.0)
7
7
  exponential-backoff (~> 0.0.2)
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ v1.3.0
2
+ ------
3
+
4
+ * Add the PowerTrack::Stream.v2? instance method
5
+
1
6
  v1.3.0
2
7
  ------
3
8
 
@@ -71,6 +71,11 @@ module PowerTrack
71
71
  @v2 = !!@options[:v2]
72
72
  end
73
73
 
74
+ # Returns true if the stream uses PowerTrack v2
75
+ def v2?
76
+ @v2
77
+ end
78
+
74
79
  # Adds many rules to your PowerTrack stream’s ruleset.
75
80
  #
76
81
  # <tt>POST /rules</tt>
@@ -1,3 +1,3 @@
1
1
  module PowerTrack
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.3.1'.freeze
3
3
  end
@@ -22,6 +22,7 @@ class TestTrackStream < Minitest::Test
22
22
 
23
23
  def track_simple_stream(v2, replay)
24
24
  stream = new_stream(v2, replay)
25
+ assert_equal !!v2, stream.v2?
25
26
 
26
27
  # add a logger
27
28
  stream.logger = Logger.new(STDERR)
@@ -99,10 +100,9 @@ class TestTrackStream < Minitest::Test
99
100
  assert_nil res
100
101
  assert replay || closed, 'Stream not closed'
101
102
 
102
- if replay
103
- assert (ended_at - started_at) <= delay
104
- else
105
- assert (ended_at - started_at) >= delay
103
+ # a replay may take longer than the delay it passes over...
104
+ unless replay
105
+ assert (ended_at - started_at) >= delay, "#{ended_at - started_at}s < #{delay}s"
106
106
  end
107
107
 
108
108
  # heartbeats only sent every 10 minutes in v2...
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: powertrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Farcy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-09-22 00:00:00.000000000 Z
13
+ date: 2016-09-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler