ruby_timeout_safe 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d30dd51132db09c3107ad7e6fc71d95bd7c85ae0f3eff1959234075824f972c
4
- data.tar.gz: eb1ac80ea077fd5203aac39bc2c613aed7dc7890e3c61d1c6048695e2a1fd712
3
+ metadata.gz: cbc64bed11abfca3a665202b8ebe08e469bbf39d5428dc6f1dff28e25677a47e
4
+ data.tar.gz: 3477cba7467c684c2fca0a603905e53bb921a9e6b8a7f9e52f89b912d179494f
5
5
  SHA512:
6
- metadata.gz: 7f76f10c6b55a0975f16be1f1c0320afa7544a7db6191e860f09923da550449fff49beabebc5f1f7efc05829bbf8c84795271dd67357024a8149db8c471deb69
7
- data.tar.gz: 5b6b833ee878f43f13c17573d82f49cda53c69d4fa6d5cb1938aa4a90ff5f409b1eb9373b164a09351d51605be106c31000dd07003e398cb0294e05dc454c51d
6
+ metadata.gz: 8e23355ad687ab0dca1dd481d37eb6d6a44e9d9a8489477a7e8bfcb7c6bebf6710834d7ae748a42686b6514953e0d702d37f8e11b7ee991b6ba86246ca77cb51
7
+ data.tar.gz: 75330a094648e97e36561b684e886309765bc9556fa1dce4bbf98430f241553352a0fbc43be553c790e8b6ffa6aa221115d7f7f42854e4d1d603d6268fb123ce
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
1
+ --format progress
2
2
  --color
3
3
  --require spec_helper
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyTimeoutSafe
4
- VERSION = '0.2.0'
4
+ VERSION = '1.0.1'
5
5
  end
@@ -5,10 +5,11 @@ require_relative 'ruby_timeout_safe/version'
5
5
 
6
6
  # A safe timeout implementation for Ruby using monotonic time.
7
7
  module RubyTimeoutSafe
8
- def self.timeout(seconds=nil) # rubocop:disable Metrics/MethodLength
8
+ def self.timeout(seconds = nil)
9
9
  return yield if seconds.nil? || seconds.zero?
10
10
 
11
11
  raise ArgumentError, 'timeout value must be at least 0.1 second' if seconds < 0.1
12
+
12
13
  current_thread = Thread.current
13
14
 
14
15
  start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_timeout_safe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sebi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-05 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  ruby-timeout-safe is a Ruby library that provides a safe and reliable timeout
@@ -29,7 +29,7 @@ extensions: []
29
29
  extra_rdoc_files: []
30
30
  files:
31
31
  - ".rspec"
32
- - ".rubcop.yml"
32
+ - ".rubocop.yml"
33
33
  - CODE_OF_CONDUCT.md
34
34
  - LICENSE.txt
35
35
  - README.md
File without changes