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 +5 -5
- data/.travis.yml +4 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +14 -0
- data/README.md +5 -0
- data/barrage.gemspec +1 -1
- data/lib/barrage/generators/redis_worker_id.rb +1 -1
- data/lib/barrage/version.rb +1 -1
- data/spec/barrage/generators/redis_worker_id_spec.rb +20 -0
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1f1e0b5da1bcf39c6afcd692da7a90d3784bd791a83d2553c62b23c522de5e71
|
4
|
+
data.tar.gz: 97c3f16796ab212ad5421d758fdf2773f040befde8170cf5682fa1607b84c84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0189dfdd3286230938d122dee87d56d7d41fdf2526115ba87f34c1bbe3ed276e37efe485e8cb8f18dad253bc0b9452f0997db08e5400c5ad690a42da267fe8
|
7
|
+
data.tar.gz: 2dff301124982ccec6670d36b53e1e2c48e9108c37eb80a559f85e6a371eccf89a682fcd5ff22485d23fbde51e9529914491f10cc5cf05b20244ecdb042c8e7f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
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.
|
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"
|
data/lib/barrage/version.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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.
|
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
|
-
|
218
|
-
|
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:
|