timeouter 0.1.2.16535 → 0.1.3.38794

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: b773a036929fd83b6bdd8948dd2a6f9fdce5d7d7bff6a638fc2abf6e015685cc
4
- data.tar.gz: 4be1f345d19f4d46086564456b0b2f3ac77131d56d0656c7a1249a5434b59f5c
3
+ metadata.gz: 2db10bb8d5392fade023253773f456b6462c9f51227c7f92577b14bdd17f0970
4
+ data.tar.gz: 622f8012de368fc2f9f697b9bdf3ab2ca112d1456e6f7b1c1fcd6a8f59e6d838
5
5
  SHA512:
6
- metadata.gz: 6f115ca2abe0f1dcf1b49b67dcfff08c9a3131783a6cb078b7e34698c4fd17a65efcdaba2179a040430bb1437fa9f2dbcbda2bde3aca70c989886028c43f8beb
7
- data.tar.gz: 5723686e8bc4161b7870c9355b61a87d30bbf9c0e1061cddc107b52ce938756f13752b84dbb8b570630a4ee7ef3feb1e9bac8775f9c0b8925f5ff70632a739c0
6
+ metadata.gz: 3fce3ddecbb4f6c3f75eb737e2626417c4e681ff36be6413fbdb26523d6e5f3639336f47b507469dbb4fcc0bcddfd2851acb61b809d907078481ef162f4603fc
7
+ data.tar.gz: bbbf61f01f2517e3fd3c9b7430da402144b0e736cdaed8cb4789346665b060ff6832a01c15f5aa75102eb1c09f62465f486ef2f46413db71538744c7e75de585
data/README.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/timeouter.svg)](https://rubygems.org/gems/timeouter)
4
4
  [![Gem](https://img.shields.io/gem/dt/timeouter.svg)](https://rubygems.org/gems/timeouter/versions)
5
+ [![YARD](https://badgen.net/badge/YARD/doc/blue)](http://www.rubydoc.info/gems/timeouter)
5
6
 
6
- [![Test Coverage](https://api.codeclimate.com/v1/badges/4b54466f8f384e3280d8/test_coverage)](https://codeclimate.com/github/RnD-Soft/timeouter/test_coverage)
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/4b54466f8f384e3280d8/maintainability)](https://codeclimate.com/github/RnD-Soft/timeouter/maintainability)
8
- [![Quality](https://lysander.x.rnds.pro/api/v1/badges/timeouter_quality.svg)](https://lysander.x.rnds.pro/api/v1/badges/timeouter_quality.html)
9
- [![Outdated](https://lysander.x.rnds.pro/api/v1/badges/timeouter_outdated.svg)](https://lysander.x.rnds.pro/api/v1/badges/timeouter_outdated.html)
10
- [![Vulnerabilities](https://lysander.x.rnds.pro/api/v1/badges/timeouter_vulnerable.svg)](https://lysander.x.rnds.pro/api/v1/badges/timeouter_vulnerable.html)
7
+ [![Coverage](https://lysander.rnds.pro/api/v1/badges/timeouter_coverage.svg)](https://lysander.rnds.pro/api/v1/badges/timeouter_coverage.html)
8
+ [![Quality](https://lysander.rnds.pro/api/v1/badges/timeouter_quality.svg)](https://lysander.rnds.pro/api/v1/badges/timeouter_quality.html)
9
+ [![Outdated](https://lysander.rnds.pro/api/v1/badges/timeouter_outdated.svg)](https://lysander.rnds.pro/api/v1/badges/timeouter_outdated.html)
10
+ [![Vulnerabilities](https://lysander.rnds.pro/api/v1/badges/timeouter_vulnerable.svg)](https://lysander.rnds.pro/api/v1/badges/timeouter_vulnerable.html)
11
11
 
12
12
 
13
13
  Timeouter is advisory timeout helper without any background threads.
@@ -23,7 +23,7 @@ Timeouter::run(3) do |t|
23
23
  sleep 1 # do some work
24
24
 
25
25
  puts t.elapsed # 1.00011811
26
- puts t.left # 3.99985717 or nil if timeout was 0
26
+ puts t.left # 1.99985717 or nil if timeout was 0
27
27
  puts t.exhausted? # false or nil if timeout was 0
28
28
  puts t.running? # true
29
29
  puts t.running! # true
@@ -13,12 +13,12 @@ module Timeouter
13
13
  @eclass = eclass || Timeouter::TimeoutError
14
14
  @message = message || 'execution expired'
15
15
 
16
- @started_at = Time.now
16
+ @started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
17
17
  end
18
18
 
19
19
  # elapsed time from creation
20
20
  def elapsed
21
- Time.now - @started_at
21
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) - @started_at
22
22
  end
23
23
 
24
24
  # time left to be exhausted or nil if timeout was 0
@@ -1,6 +1,6 @@
1
1
  module Timeouter
2
2
 
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '0.1.3'.freeze
4
4
 
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeouter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.16535
4
+ version: 0.1.3.38794
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler