timers 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +6 -0
- data/.travis.yml +2 -1
- data/Gemfile +3 -3
- data/lib/timers/events.rb +7 -2
- data/lib/timers/timer.rb +1 -0
- data/lib/timers/version.rb +1 -1
- data/timers.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 327fbcdf5ce2ea7d16dc2d5605046c64bdaccc917d4cab8bd5765d0817883f7d
|
4
|
+
data.tar.gz: dcf2c56295c5ee1d2c5160c9a45189ae98efa54bcdced8dc69c86b211769db89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b067c4a96490380d699e47d3712e74a6c723921c0931f9a877a9c4ab924e50187e61427bf39e88f887d487efeac6fa5fe493712852e0306531241a9130020840
|
7
|
+
data.tar.gz: efdcc4c8b6e6079327977b7bfdca001e30835e87bac0fb2597a5612a62e4c493cc09574c9be9eaf5220275f7569235e177ede23e2d3e40da4dddc481dc456cf8
|
data/.editorconfig
ADDED
data/.travis.yml
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
language: ruby
|
2
|
-
sudo: false
|
3
2
|
dist: xenial
|
4
3
|
cache: bundler
|
5
4
|
|
@@ -10,10 +9,12 @@ matrix:
|
|
10
9
|
- rvm: 2.5
|
11
10
|
- rvm: 2.6
|
12
11
|
- rvm: jruby-head
|
12
|
+
env: JRUBY_OPTS="--debug -X+O"
|
13
13
|
- rvm: truffleruby
|
14
14
|
- rvm: ruby-head
|
15
15
|
- rvm: rbx-3
|
16
16
|
allow_failures:
|
17
17
|
- rvm: ruby-head
|
18
|
+
- rvm: jruby-head
|
18
19
|
- rvm: rbx-3
|
19
20
|
- rvm: truffleruby
|
data/Gemfile
CHANGED
data/lib/timers/events.rb
CHANGED
@@ -58,8 +58,13 @@ module Timers
|
|
58
58
|
|
59
59
|
index = bisect_left(@sequence, handle)
|
60
60
|
|
61
|
-
|
62
|
-
|
61
|
+
if current_handle = @sequence[index] and current_handle.cancelled?
|
62
|
+
# puts "Replacing handle at index: #{index} due to cancellation in array containing #{@sequence.size} item(s)."
|
63
|
+
@sequence[index] = handle
|
64
|
+
else
|
65
|
+
# puts "Inserting handle at index: #{index} in array containing #{@sequence.size} item(s)."
|
66
|
+
@sequence.insert(index, handle)
|
67
|
+
end
|
63
68
|
|
64
69
|
handle
|
65
70
|
end
|
data/lib/timers/timer.rb
CHANGED
@@ -75,6 +75,7 @@ module Timers
|
|
75
75
|
end
|
76
76
|
|
77
77
|
# Reset this timer. Do not call while paused.
|
78
|
+
# @param offset [Numeric] the duration to add to the timer.
|
78
79
|
def reset(offset = @group.current_offset)
|
79
80
|
# This logic allows us to minimise the interaction with @group.timers.
|
80
81
|
# A timer with a handle is always registered with the group.
|
data/lib/timers/version.rb
CHANGED
data/timers.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.required_ruby_version = '>= 2.2.1'
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler"
|
30
|
+
spec.add_development_dependency "bundler"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.6"
|
32
32
|
spec.add_development_dependency "rake"
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,6 +62,7 @@ executables: []
|
|
62
62
|
extensions: []
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
|
+
- ".editorconfig"
|
65
66
|
- ".gitignore"
|
66
67
|
- ".rspec"
|
67
68
|
- ".travis.yml"
|
@@ -103,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
|
-
|
107
|
-
rubygems_version: 2.7.7
|
107
|
+
rubygems_version: 3.0.1
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Pure Ruby one-shot and periodic timers
|