lusnoc 0.1.2.16587 → 1.0.0.70325

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: c78a72fc2b905efdcacede9def08910760b12c8247d6a6355496fba44fe84aaf
4
- data.tar.gz: 1ed0b514299e550ca0a9d9f98426c312beb59ccc10db41cbff39c0d8a7d45127
3
+ metadata.gz: bb34cf9c0298c287853840b632bba99c26366c00d22c6707edff4c100c79b6ea
4
+ data.tar.gz: ff3cf1b6d5db904261f0e6ecceb3393ba9e5ea14b408bf8150a816fd2ac6ee55
5
5
  SHA512:
6
- metadata.gz: a73f22f19384c540dd82394b6d0107ad937d0208e126eb97845b0b9ec8e1aad55ec44ff0780129f5c2de2ec1ed069082ed20d9ad9029f12c0bd7a54bd1d383d5
7
- data.tar.gz: 9087bd675341cfa4ad3568757e87ab8900af19e3d8dd120e7a9121962d369669c089ee1e18133d678f3b33e99593e987c5d5898ed11d1517c4317aa0e4e77eec
6
+ metadata.gz: 2fe4689e9edf5be69f6d0c881c2ac3ad40248e649164347c4bcba6134530d38bbe4aa90fe187ffba4f7452f85a9f8c9e766194f69b32c0586ab00392c9b3b65f
7
+ data.tar.gz: 7cde1cc5d3617a4de67958528b07cf2ab7a81faa04653174df8c654375c3c090b4de483a3fd024620e8bdbaf28320b79070260ce0d5a75e00b59619d0e5ba542
data/README.md CHANGED
@@ -4,14 +4,15 @@
4
4
  [![Gem](https://img.shields.io/gem/dt/lusnoc.svg)](https://rubygems.org/gems/lusnoc/versions)
5
5
  [![YARD](https://badgen.net/badge/YARD/doc/blue)](http://www.rubydoc.info/gems/lusnoc)
6
6
 
7
- [![Test Coverage](https://api.codeclimate.com/v1/badges/ed48b89a9793a074cd23/test_coverage)](https://codeclimate.com/github/RnD-Soft/lusnoc/test_coverage)
8
- [![Maintainability](https://api.codeclimate.com/v1/badges/ed48b89a9793a074cd23/maintainability)](https://codeclimate.com/github/RnD-Soft/lusnoc/maintainability)
9
- [![Quality](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_quality.svg)](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_quality.html)
10
- [![Outdated](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_outdated.svg)](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_outdated.html)
11
- [![Vulnerabilities](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_vulnerable.svg)](https://lysander.x.rnds.pro/api/v1/badges/lusnoc_vulnerable.html)
7
+ [![Coverage](https://lysander.rnds.pro/api/v1/badges/lusnoc_coverage.svg)](https://lysander.rnds.pro/api/v1/badges/lusnoc_coverage.html)
8
+ [![Quality](https://lysander.rnds.pro/api/v1/badges/lusnoc_quality.svg)](https://lysander.rnds.pro/api/v1/badges/lusnoc_quality.html)
9
+ [![Outdated](https://lysander.rnds.pro/api/v1/badges/lusnoc_outdated.svg)](https://lysander.rnds.pro/api/v1/badges/lusnoc_outdated.html)
10
+ [![Vulnerabilities](https://lysander.rnds.pro/api/v1/badges/lusnoc_vulnerable.svg)](https://lysander.rnds.pro/api/v1/badges/lusnoc_vulnerable.html)
12
11
 
13
12
  Lusnoc is reliable gem to deal with [Consul](https://www.consul.io). It is designed to be simple and work without dark background magic.
14
- It is inspired by [consul-mutex](https://github.com/discourse/consul-mutex)(which has hard background magic).
13
+ It is inspired by [consul-mutex](https://github.com/kinnalru/consul-mutex)(which has hard background magic).
14
+
15
+ Article about gem: https://blog.rnds.pro/lusnoc (in russian)
15
16
 
16
17
  ## FAQ
17
18
 
@@ -19,7 +20,7 @@ It is inspired by [consul-mutex](https://github.com/discourse/consul-mutex)(whic
19
20
 
20
21
  Lusnoc allows you to interact with Consul to provide distributed locks(mutex) to your application.
21
22
 
22
- #### What's the difference between lusnoc and [consul-mutex](https://github.com/discourse/consul-mutex) or [diplomat](https://github.com/WeAreFarmGeek/diplomat)
23
+ #### What's the difference between lusnoc and [consul-mutex](https://github.com/kinnalru/consul-mutex) or [diplomat](https://github.com/WeAreFarmGeek/diplomat)
23
24
  * consul-mutex starts background thread and ***the block of code that you pass to #synchronize runs on a separate thread, and can be killed without warning if the mutex determines that it no longer holds the lock.***
24
25
  * diplomat provides the basic session/locks functionality but no automated control over it
25
26
 
@@ -44,7 +45,7 @@ TTL will be used in session creation on `#synchronize`:
44
45
  puts "We are exclusively owns resource"
45
46
  end
46
47
  ```
47
- If mutex cannot be acquired within given timeout Lusnoc::TimeoutError is raised.
48
+ If mutex cannot be acquired within given timeout `Lusnoc::TimeoutError` is raised.
48
49
  By default, the "value" of the lock resource will be the hostname of the
49
50
  machine that it's running on (so you know who has the lock). If, for some
50
51
  reason, you'd like to set the value to something else, you can do that, too:
@@ -63,7 +63,7 @@ module Lusnoc
63
63
  def create_session(name, ttl)
64
64
  resp = Lusnoc.http_put(build_url('/v1/session/create'),
65
65
  { Name: name, TTL: "#{ttl}s", LockDelay: '5s' },
66
- { timeout: 1 })
66
+ **{ timeout: 1 })
67
67
  session_id = JSON.parse(resp.body)['ID']
68
68
  @expired_at = Time.now + ttl
69
69
  logger.info "Session[#{name}:#{session_id}] created. TTL:#{ttl}s. Next expiration: #{@expired_at}"
@@ -1,6 +1,6 @@
1
1
  module Lusnoc
2
2
 
3
- VERSION = '0.1.2'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
 
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lusnoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.16587
4
+ version: 1.0.0.70325
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-24 00:00:00.000000000 Z
11
+ date: 2021-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler