futex 0.8.5 → 0.8.6

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: c0e4abff4199f0689d0b4cd5690cff965c73ecd8d677f1462990988b2d812f95
4
- data.tar.gz: 796906e21996515e1dda5a4e5d3e61de99214626b3940c950fff6443121a5e1f
3
+ metadata.gz: a39e776160fae9f2f978b7f38b2eb93d1e36fdf1a9fe0fd6987d86fa17f39bcf
4
+ data.tar.gz: fcc63a92c287cea29dd530d12784b43e3140f41c0be505cf531821c835e7672d
5
5
  SHA512:
6
- metadata.gz: bc1ea4e547ccda842801c62a758bd2b6a2705e88ce30c9a73455db238766a738c8203b8d674ab352ea12c7c700490c7178e3d69085d7bff3265a7528812c7e7c
7
- data.tar.gz: 73c7b53cab1bc82e526cd01f9c5435de634f92fb2628367eca44bec1a82e47204ce464de48b6c39dff3897c467e360f411f93e14a550650abda7ec5950f38bcd
6
+ metadata.gz: 4789faeaa4ba7042d0f11df6097fb202b2a79ac1a057dbce9a410ff88d00c0ce86c8a9207544f61292575d7cf1f4dd8f7ab55427297f5013b6894f3f9cc6b3e3
7
+ data.tar.gz: 0e5687638ad390464f890b2c881bccddc5d1d7cbe11100245e6dbcab9fdac29067563527dc781db457fa0a34341e842ff1173cbd50385c358394296ad6f1e4c6
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
2
  DisplayCopNames: true
3
- TargetRubyVersion: 2.3.3
3
+ TargetRubyVersion: 2.3
4
4
 
5
5
  Layout/EmptyLineAfterGuardClause:
6
6
  Enabled: false
data/Gemfile CHANGED
@@ -21,4 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  source 'https://rubygems.org'
24
+ ruby '2.6.0'
24
25
  gemspec
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.rubygems_version = '2.3.3'
32
32
  s.required_ruby_version = '>=2.3'
33
33
  s.name = 'futex'
34
- s.version = '0.8.5'
34
+ s.version = '0.8.6'
35
35
  s.license = 'MIT'
36
36
  s.summary = 'File-based mutex'
37
37
  s.description = 'Ruby Gem for file-based locking'
@@ -115,7 +115,8 @@ class Futex
115
115
  if Time.now - start > @timeout
116
116
  raise CantLock.new("#{b} can't get #{prefix}exclusive access \
117
117
  to the file #{@path} because of the lock at #{@lock}, after #{age(start)} \
118
- of waiting: #{IO.read(@lock)} (modified #{age(File.mtime(@lock))} ago)", start)
118
+ of waiting: #{IO.read(@lock)} (modified #{age(File.mtime(@lock))} ago)",
119
+ File.mtime(@lock))
119
120
  end
120
121
  next unless (cycle % step).zero? && Time.now - start > @timeout / 2
121
122
  debug("#{b} still waiting for #{prefix}exclusive \
@@ -82,14 +82,14 @@ class FutexTest < Minitest::Test
82
82
  sleep 10
83
83
  end
84
84
  end
85
- sleep 0.1
85
+ sleep 2
86
86
  ex = assert_raises(Futex::CantLock) do
87
87
  Futex.new(path, timeout: 0.1).open do |f|
88
88
  # Will never reach this point
89
89
  end
90
90
  end
91
91
  assert(ex.message.include?('can\'t get exclusive access to the file'), ex)
92
- assert(!ex.start.nil?)
92
+ assert(ex.start < Time.now - 1)
93
93
  end
94
94
  end
95
95
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-07 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest