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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1665f074c230a801e0eb6648214a6d0248d4baada8da1f4e60abd0983bba517
4
- data.tar.gz: de4eac12ecba1826d6ae5ef1d6958a451595b1a9e8e54dba7f1718d7f15182dd
3
+ metadata.gz: 327fbcdf5ce2ea7d16dc2d5605046c64bdaccc917d4cab8bd5765d0817883f7d
4
+ data.tar.gz: dcf2c56295c5ee1d2c5160c9a45189ae98efa54bcdced8dc69c86b211769db89
5
5
  SHA512:
6
- metadata.gz: c0e005f02975d324b7fbe7d8e284a2d5318be78352e129ce00abf20594d3e6a18b30103e1137b2d9fe91bd5a2251e7b22fb5cdc255f5153f219bf90bd3b6160d
7
- data.tar.gz: 64210a85d0a8efe2540d9ee6da050c5d8298a5332bd2ba14758bd784a7f991ad40b1f828b47320525ab025249859ca6419f172421492fe6ced56a76e34820541
6
+ metadata.gz: b067c4a96490380d699e47d3712e74a6c723921c0931f9a877a9c4ab924e50187e61427bf39e88f887d487efeac6fa5fe493712852e0306531241a9130020840
7
+ data.tar.gz: efdcc4c8b6e6079327977b7bfdca001e30835e87bac0fb2597a5612a62e4c493cc09574c9be9eaf5220275f7569235e177ede23e2d3e40da4dddc481dc456cf8
@@ -0,0 +1,6 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = tab
5
+ indent_size = 2
6
+
@@ -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
@@ -8,8 +8,8 @@ end
8
8
 
9
9
  group :test do
10
10
  gem 'benchmark-ips'
11
- gem "ruby-prof", platform: :mri
12
11
 
13
- gem 'simplecov'
14
- gem 'coveralls'
12
+ gem "ruby-prof", platform: :mri
13
+ gem 'simplecov', platform: :mri
14
+ gem 'coveralls', platform: :mri
15
15
  end
@@ -58,8 +58,13 @@ module Timers
58
58
 
59
59
  index = bisect_left(@sequence, handle)
60
60
 
61
- # Maintain sorted order, O(logN) insertion time.
62
- @sequence.insert(index, handle)
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
@@ -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.
@@ -6,5 +6,5 @@
6
6
  #
7
7
 
8
8
  module Timers
9
- VERSION = "4.2.0"
9
+ VERSION = "4.2.1"
10
10
  end
@@ -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", "~> 1.3"
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.0
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: 2018-11-06 00:00:00.000000000 Z
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: '1.3'
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: '1.3'
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
- rubyforge_project:
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