barrage 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: 247efe0edfb9aae9c762b6698e5c90816c95f781
4
- data.tar.gz: 117e43352f37892a675334b48e2b398a90fe167b
2
+ SHA256:
3
+ metadata.gz: 1f1e0b5da1bcf39c6afcd692da7a90d3784bd791a83d2553c62b23c522de5e71
4
+ data.tar.gz: 97c3f16796ab212ad5421d758fdf2773f040befde8170cf5682fa1607b84c84f
5
5
  SHA512:
6
- metadata.gz: ef97bd700202ccdd92acb5a1c498d8ca1245fd6ac8a077acd8ce3f2f9e536de3f04989e77717128a956c30f5714f6c2947e3a3f115a19ec937a428d448ba16af
7
- data.tar.gz: 27265f705dfb1d087a441c86747f70496a505346751a7bbf24c14ff9e9357ec8a91a680a901ff446f3fff52716332f09760c9407c423906bfbf0202eb29aecf3
6
+ metadata.gz: 8c0189dfdd3286230938d122dee87d56d7d41fdf2526115ba87f34c1bbe3ed276e37efe485e8cb8f18dad253bc0b9452f0997db08e5400c5ad690a42da267fe8
7
+ data.tar.gz: 2dff301124982ccec6670d36b53e1e2c48e9108c37eb80a559f85e6a371eccf89a682fcd5ff22485d23fbde51e9529914491f10cc5cf05b20244ecdb042c8e7f
data/.travis.yml CHANGED
@@ -1,7 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
- - 2.1.2
4
+ - 2.1.8
5
+ - 2.2.4
6
+ - 2.3.0
7
+ bundler_args: --jobs=2
5
8
  services:
6
9
  - redis-server
7
10
  script: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.1
4
+
5
+ * Fix redis client disconnect
6
+
3
7
  ## 0.1.0
4
8
 
5
9
  * Fix RedisWorkerId's worker_id handling
data/Gemfile CHANGED
@@ -2,3 +2,17 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in barrage.gemspec
4
4
  gemspec
5
+
6
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
7
+ gem "activesupport", "< 5.0.0"
8
+ end
9
+
10
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.3")
11
+ gem "listen", "< 3.1.0"
12
+ end
13
+
14
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.5")
15
+ gem "ruby_dep", "< 1.4.0"
16
+ end
17
+
18
+ gem "redis", ">= 4.0.0"
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Barrage
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/barrage.svg)](http://badge.fury.io/rb/barrage)
4
+ [![Dependency Status](https://gemnasium.com/drecom/barrage.svg)](https://gemnasium.com/drecom/barrage)
4
5
  [![Coverage Status](https://img.shields.io/coveralls/drecom/barrage.svg)](https://coveralls.io/r/drecom/barrage)
6
+ [![Build Status](https://travis-ci.org/drecom/barrage.svg)](https://travis-ci.org/drecom/barrage)
7
+ [![Code Climate](https://codeclimate.com/github/drecom/barrage.png)](https://codeclimate.com/github/drecom/barrage)
5
8
 
6
9
  Distributed ID generator(like twitter/snowflake)
7
10
 
@@ -44,6 +47,8 @@ barrage.next
44
47
 
45
48
  #### msec
46
49
  #### redis_worker_id
50
+ requirement: redis 2.6+
51
+
47
52
  #### sequence
48
53
 
49
54
  ### Creating your own generator
data/barrage.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.6"
24
24
  spec.add_development_dependency "rake"
25
- spec.add_development_dependency "rspec", "~> 3.0.0"
25
+ spec.add_development_dependency "rspec", "~> 3.5.0"
26
26
  spec.add_development_dependency "rspec-its"
27
27
  spec.add_development_dependency "pry"
28
28
  spec.add_development_dependency "guard-rspec"
@@ -50,7 +50,7 @@ class Barrage
50
50
 
51
51
  if redis.is_a?(Redis) and redis.connected?
52
52
  redis.del("barrage:worker:#{worker_id}") if real_ttl > Time.now.to_i
53
- redis.client.disconnect
53
+ redis._client.disconnect
54
54
  end
55
55
  end
56
56
  end
@@ -1,3 +1,3 @@
1
1
  class Barrage
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -43,4 +43,24 @@ describe Barrage::Generators::RedisWorkerId do
43
43
  end
44
44
  end
45
45
  end
46
+
47
+ describe "#Finalizer" do
48
+ subject { described_class::Finalizer.new(data).call(*args) }
49
+
50
+ before do
51
+ redis._client.connect
52
+ end
53
+ let(:now) { Time.now.to_i }
54
+ let(:ttl) { 300 }
55
+ let(:redis) { Redis.new }
56
+ let(:worker_ttl) { now + ttl / 2 }
57
+ let(:real_ttl) { now + ttl }
58
+ let(:data) { [redis, worker_ttl, real_ttl] }
59
+ let(:args) { {} }
60
+
61
+ it "redis client disconnect" do
62
+ subject
63
+ expect(redis.connected?).to eq false
64
+ end
65
+ end
46
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barrage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gussan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.0.0
61
+ version: 3.5.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.0.0
68
+ version: 3.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-its
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -199,7 +199,7 @@ homepage: http://github.com/drecom/barrage
199
199
  licenses:
200
200
  - MIT
201
201
  metadata: {}
202
- post_install_message:
202
+ post_install_message:
203
203
  rdoc_options: []
204
204
  require_paths:
205
205
  - lib
@@ -214,9 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubyforge_project:
218
- rubygems_version: 2.2.2
219
- signing_key:
217
+ rubygems_version: 3.0.3
218
+ signing_key:
220
219
  specification_version: 4
221
220
  summary: Distributed id generator
222
221
  test_files: