futex 0.2.1 → 0.3.0

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: 9e68cf513b00bc3f84e78169f756837af26d0f23437313647ff189f1d203d448
4
- data.tar.gz: b27655b081d1907b360058e8754add2ec9f4d743a9f1f561a75c58a0d0f4382f
3
+ metadata.gz: bc966cb2da1f00c01883f0c460f481110c8fa74ee6aa6b10ce4a1355d40d211b
4
+ data.tar.gz: c9e9794071fe3e2984bd6a411dd57fd20b9a4e67a18cd4843b60a609bd212aff
5
5
  SHA512:
6
- metadata.gz: 847ee06fbf22f53fc3bc097f5f39cc7a7d04f8a34587a4a661f48f335a0871787b4d6ebca9c77363d17009d7a8a9038e120a564227849364af80a0e856655d8a
7
- data.tar.gz: d2c47e694cc1befccf8191f6d906f54c4a7989227a46d05d2521e95cd56df9660ec54656dd7b79fab9c7588accbae14886016655797734d298a9f671971f55ea
6
+ metadata.gz: 86431c6b633f2d3485ca2321110853c198904682b5498a2cb439b702be54e012ab0b3204887e893a92c116111d04d36fa841c8a72edac6f41f8939bfe1f2683a
7
+ data.tar.gz: e77aa4ee5b397613df270f476f69e2297b4e26f18296391a9e4b9421201a368d9e992afa06ddaa7f5580e91944b141f64b0d31f9614e379f261da7e220edf76e
data/README.md CHANGED
@@ -34,7 +34,7 @@ constructor of the `Futex` class, including:
34
34
  * `log`: an object that implements `debug()` method, which will
35
35
  receive supplementary messages from the locking mechanism;
36
36
 
37
- * `logging`: set it to `false` if you don't want to see any logs;
37
+ * `logging`: set it to `true` if you want to see logs;
38
38
 
39
39
  * `timeout`: the number of seconds to wait for the lock availability
40
40
  (an exception is raised when the wait is expired);
data/futex.gemspec CHANGED
@@ -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.2.1'
34
+ s.version = '0.3.0'
35
35
  s.license = 'MIT'
36
36
  s.summary = 'File-based mutex'
37
37
  s.description = 'Ruby Gem for file-based locking'
data/lib/futex.rb CHANGED
@@ -31,7 +31,7 @@ require 'time'
31
31
  # License:: MIT
32
32
  class Futex
33
33
  def initialize(path, log: STDOUT, timeout: 16, sleep: 0.005,
34
- lock: path + '.lock', logging: true)
34
+ lock: path + '.lock', logging: false)
35
35
  raise "File path can't be nil" if path.nil?
36
36
  @path = path
37
37
  raise "Log can't be nil" if log.nil?
data/test/test_futex.rb CHANGED
@@ -36,7 +36,7 @@ class FutexTest < Minitest::Test
36
36
  Dir.mktmpdir do |dir|
37
37
  path = File.join(dir, 'a/b/c/file.txt')
38
38
  Threads.new(2).assert do |_, r|
39
- Futex.new(path, logging: false).open do |f|
39
+ Futex.new(path, logging: true).open do |f|
40
40
  text = "op no.#{r}"
41
41
  IO.write(f, text)
42
42
  assert_equal(text, IO.read(f))
@@ -49,7 +49,7 @@ class FutexTest < Minitest::Test
49
49
  Dir.mktmpdir do |dir|
50
50
  path = File.join(dir, 'a/b/c/file.txt')
51
51
  Threads.new(20).assert(200) do |_, r|
52
- Futex.new(path, logging: false).open do |f|
52
+ Futex.new(path).open do |f|
53
53
  text = "op no.#{r}"
54
54
  IO.write(f, text)
55
55
  sleep 0.01
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko