redis_web_manager 0.3.6 → 0.3.8

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: cbdfc7a3bf3dce8653e098e69e9eb6af33608eb00c809c0ba957b84981692015
4
- data.tar.gz: '072092fdfbff43aa555692e970e32cff44f93b715308c71c77c37f8007eb362f'
3
+ metadata.gz: 428aa9f1970ae3e2eeab18c4387ba04d5b7abf89e1b4748c8af169eec1e6a5f0
4
+ data.tar.gz: 7436df93d55f63b257f1ffc3005df146700de3bb25cb3bca5a5996431ceb69c6
5
5
  SHA512:
6
- metadata.gz: 9ff8a104b47f8447370702b1284e07f3301a09584642e5f849c4dca77d8083c3830621fb9157bb66e50d154ec0aa7e0ae729bf9d91534a5198eeb623bc5dd16d
7
- data.tar.gz: fe871e15548ea121bf4dddc3d4d0301b7f546897ea8832115117c991fcd396d7881ebd1fff16afd7daa01cbc9c46607254c53fa7e1b81f086e569280163de572
6
+ metadata.gz: 27c014c1b2574c867d0ac66c60b2ce4cae64ec9a778e833f70038c1acb5e18806df7c404e74c2e5d15e13fcb680297245327f970380615379ca8a7b43a45ebfe
7
+ data.tar.gz: 0a2c89e42be5e2232647738c8f8ef8acd75f1f978de0f5564ff11c799575341377f3bbdac42c3d8ce2de8aa27baac974569016842fe3f21b0e24f032b82f0634
@@ -2,6 +2,7 @@
2
2
 
3
3
  RedisWebManager::Engine.routes.draw do
4
4
  redises_keys = RedisWebManager.redises.keys
5
+
5
6
  scope ':instance', instance: /#{redises_keys.join('|')}/ do
6
7
  # Configuration
7
8
  get :configuration, to: 'configuration#index'
@@ -6,10 +6,11 @@ require 'redis_web_manager/action'
6
6
  require 'redis_web_manager/connection'
7
7
  require 'redis_web_manager/info'
8
8
  require 'redis_web_manager/data'
9
+ require 'active_support/time'
9
10
  require 'redis'
10
11
 
11
12
  module RedisWebManager
12
- mattr_accessor :redises, default: { default: ::Redis.new }
13
+ mattr_accessor :redises, default: { default: Redis.new }
13
14
  mattr_accessor :lifespan, default: 15.days
14
15
  mattr_accessor :authenticate, default: nil
15
16
 
@@ -26,7 +27,7 @@ module RedisWebManager
26
27
  raise(ArgumentError, 'Invalid redises hash, use like that { test: Redis.new }')
27
28
  end
28
29
  redises.each do |k, v|
29
- unless v.is_a?(::Redis)
30
+ unless v.is_a?(Redis)
30
31
  raise(ArgumentError, "Invalid Redis instance for #{k}, use like that Redis.new")
31
32
  end
32
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RedisWebManager
4
- VERSION = '0.3.6'
4
+ VERSION = '0.3.8'
5
5
  end
@@ -5,7 +5,7 @@ require 'rails_helper'
5
5
  RSpec.describe RedisWebManager::KeysController, type: :controller do
6
6
  routes { RedisWebManager::Engine.routes }
7
7
  let(:redis) do
8
- ::Redis.new
8
+ Redis.new
9
9
  end
10
10
 
11
11
  let(:default) do
@@ -8,7 +8,7 @@ RSpec.describe RedisWebManager::Action do
8
8
  end
9
9
 
10
10
  let(:redis) do
11
- ::Redis.new
11
+ Redis.new
12
12
  end
13
13
 
14
14
  describe 'action' do
@@ -8,7 +8,6 @@ RSpec.describe RedisWebManager::Connection do
8
8
  end
9
9
 
10
10
  describe 'connection' do
11
-
12
11
  it 'returns a host' do
13
12
  expect(connection.host).to eql('127.0.0.1')
14
13
  end
@@ -28,6 +27,5 @@ RSpec.describe RedisWebManager::Connection do
28
27
  it 'returns a location' do
29
28
  expect(connection.location).to eql('127.0.0.1:6379')
30
29
  end
31
-
32
30
  end
33
31
  end
@@ -8,7 +8,7 @@ RSpec.describe RedisWebManager::Info do
8
8
  end
9
9
 
10
10
  let(:redis) do
11
- ::Redis.new
11
+ Redis.new
12
12
  end
13
13
 
14
14
  describe 'info' do
@@ -40,7 +40,7 @@ RSpec.describe RedisWebManager do
40
40
  expect do
41
41
  RedisWebManager.configure do |c|
42
42
  c.redises = {
43
- default: ::Redis.new
43
+ default: Redis.new
44
44
  }
45
45
  c.lifespan = 1
46
46
  end
@@ -51,12 +51,24 @@ RSpec.describe RedisWebManager do
51
51
  expect do
52
52
  RedisWebManager.configure do |c|
53
53
  c.redises = {
54
- default: ::Redis.new
54
+ default: Redis.new
55
55
  }
56
56
  c.lifespan = -1.days
57
57
  end
58
58
  end.to raise_error(ArgumentError, 'Invalid lifespan, value must be greater than 0')
59
59
  end
60
60
 
61
+ it 'returns instances' do
62
+ RedisWebManager.configure do |c|
63
+ c.redises = {
64
+ foo: Redis.new,
65
+ bar: Redis.new
66
+ }
67
+ c.lifespan = 12.days
68
+ end
69
+
70
+ expect(RedisWebManager.redises.keys).to eql(%i[foo bar])
71
+ expect(RedisWebManager.redises.values.map(&:class)).to eql([Redis, Redis])
72
+ end
61
73
  end
62
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_web_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris BRESCIANI
@@ -124,7 +124,6 @@ files:
124
124
  - ".rubocop.yml"
125
125
  - ".travis.yml"
126
126
  - Gemfile
127
- - Gemfile.lock
128
127
  - MIT-LICENSE
129
128
  - README.md
130
129
  - Rakefile
@@ -1,189 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- redis_web_manager (0.3.6)
5
- pagy (~> 3.8)
6
- rails (>= 5.2, < 7)
7
- redis (>= 4.1.0, < 5)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (6.1.1)
13
- actionpack (= 6.1.1)
14
- activesupport (= 6.1.1)
15
- nio4r (~> 2.0)
16
- websocket-driver (>= 0.6.1)
17
- actionmailbox (6.1.1)
18
- actionpack (= 6.1.1)
19
- activejob (= 6.1.1)
20
- activerecord (= 6.1.1)
21
- activestorage (= 6.1.1)
22
- activesupport (= 6.1.1)
23
- mail (>= 2.7.1)
24
- actionmailer (6.1.1)
25
- actionpack (= 6.1.1)
26
- actionview (= 6.1.1)
27
- activejob (= 6.1.1)
28
- activesupport (= 6.1.1)
29
- mail (~> 2.5, >= 2.5.4)
30
- rails-dom-testing (~> 2.0)
31
- actionpack (6.1.1)
32
- actionview (= 6.1.1)
33
- activesupport (= 6.1.1)
34
- rack (~> 2.0, >= 2.0.9)
35
- rack-test (>= 0.6.3)
36
- rails-dom-testing (~> 2.0)
37
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
- actiontext (6.1.1)
39
- actionpack (= 6.1.1)
40
- activerecord (= 6.1.1)
41
- activestorage (= 6.1.1)
42
- activesupport (= 6.1.1)
43
- nokogiri (>= 1.8.5)
44
- actionview (6.1.1)
45
- activesupport (= 6.1.1)
46
- builder (~> 3.1)
47
- erubi (~> 1.4)
48
- rails-dom-testing (~> 2.0)
49
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
- activejob (6.1.1)
51
- activesupport (= 6.1.1)
52
- globalid (>= 0.3.6)
53
- activemodel (6.1.1)
54
- activesupport (= 6.1.1)
55
- activerecord (6.1.1)
56
- activemodel (= 6.1.1)
57
- activesupport (= 6.1.1)
58
- activestorage (6.1.1)
59
- actionpack (= 6.1.1)
60
- activejob (= 6.1.1)
61
- activerecord (= 6.1.1)
62
- activesupport (= 6.1.1)
63
- marcel (~> 0.3.1)
64
- mimemagic (~> 0.3.2)
65
- activesupport (6.1.1)
66
- concurrent-ruby (~> 1.0, >= 1.0.2)
67
- i18n (>= 1.6, < 2)
68
- minitest (>= 5.1)
69
- tzinfo (~> 2.0)
70
- zeitwerk (~> 2.3)
71
- builder (3.2.4)
72
- concurrent-ruby (1.1.8)
73
- coveralls (0.8.23)
74
- json (>= 1.8, < 3)
75
- simplecov (~> 0.16.1)
76
- term-ansicolor (~> 1.3)
77
- thor (>= 0.19.4, < 2.0)
78
- tins (~> 1.6)
79
- crass (1.0.6)
80
- diff-lcs (1.4.4)
81
- docile (1.3.5)
82
- erubi (1.10.0)
83
- globalid (0.4.2)
84
- activesupport (>= 4.2.0)
85
- i18n (1.8.7)
86
- concurrent-ruby (~> 1.0)
87
- json (2.5.1)
88
- loofah (2.9.0)
89
- crass (~> 1.0.2)
90
- nokogiri (>= 1.5.9)
91
- mail (2.7.1)
92
- mini_mime (>= 0.1.1)
93
- marcel (0.3.3)
94
- mimemagic (~> 0.3.2)
95
- method_source (1.0.0)
96
- mimemagic (0.3.5)
97
- mini_mime (1.0.2)
98
- mini_portile2 (2.5.0)
99
- minitest (5.14.3)
100
- nio4r (2.5.4)
101
- nokogiri (1.11.1)
102
- mini_portile2 (~> 2.5.0)
103
- racc (~> 1.4)
104
- pagy (3.10.0)
105
- racc (1.5.2)
106
- rack (2.2.3)
107
- rack-test (1.1.0)
108
- rack (>= 1.0, < 3)
109
- rails (6.1.1)
110
- actioncable (= 6.1.1)
111
- actionmailbox (= 6.1.1)
112
- actionmailer (= 6.1.1)
113
- actionpack (= 6.1.1)
114
- actiontext (= 6.1.1)
115
- actionview (= 6.1.1)
116
- activejob (= 6.1.1)
117
- activemodel (= 6.1.1)
118
- activerecord (= 6.1.1)
119
- activestorage (= 6.1.1)
120
- activesupport (= 6.1.1)
121
- bundler (>= 1.15.0)
122
- railties (= 6.1.1)
123
- sprockets-rails (>= 2.0.0)
124
- rails-dom-testing (2.0.3)
125
- activesupport (>= 4.2.0)
126
- nokogiri (>= 1.6)
127
- rails-html-sanitizer (1.3.0)
128
- loofah (~> 2.3)
129
- railties (6.1.1)
130
- actionpack (= 6.1.1)
131
- activesupport (= 6.1.1)
132
- method_source
133
- rake (>= 0.8.7)
134
- thor (~> 1.0)
135
- rake (13.0.3)
136
- redis (4.2.5)
137
- rspec-core (3.10.1)
138
- rspec-support (~> 3.10.0)
139
- rspec-expectations (3.10.1)
140
- diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.10.0)
142
- rspec-mocks (3.10.1)
143
- diff-lcs (>= 1.2.0, < 2.0)
144
- rspec-support (~> 3.10.0)
145
- rspec-rails (4.0.2)
146
- actionpack (>= 4.2)
147
- activesupport (>= 4.2)
148
- railties (>= 4.2)
149
- rspec-core (~> 3.10)
150
- rspec-expectations (~> 3.10)
151
- rspec-mocks (~> 3.10)
152
- rspec-support (~> 3.10)
153
- rspec-support (3.10.1)
154
- simplecov (0.16.1)
155
- docile (~> 1.1)
156
- json (>= 1.8, < 3)
157
- simplecov-html (~> 0.10.0)
158
- simplecov-html (0.10.2)
159
- sprockets (4.0.2)
160
- concurrent-ruby (~> 1.0)
161
- rack (> 1, < 3)
162
- sprockets-rails (3.2.2)
163
- actionpack (>= 4.0)
164
- activesupport (>= 4.0)
165
- sprockets (>= 3.0.0)
166
- sync (0.5.0)
167
- term-ansicolor (1.7.1)
168
- tins (~> 1.0)
169
- thor (1.1.0)
170
- tins (1.28.0)
171
- sync
172
- tzinfo (2.0.4)
173
- concurrent-ruby (~> 1.0)
174
- websocket-driver (0.7.3)
175
- websocket-extensions (>= 0.1.0)
176
- websocket-extensions (0.1.5)
177
- zeitwerk (2.4.2)
178
-
179
- PLATFORMS
180
- ruby
181
-
182
- DEPENDENCIES
183
- coveralls (~> 0.8)
184
- redis_web_manager!
185
- rspec-rails (~> 4.0.0)
186
- simplecov (~> 0.16)
187
-
188
- BUNDLED WITH
189
- 2.1.4