consul 1.1.1 → 1.2.0

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: a06033efab4b0e24d658424200cb54c5344d477eef168af3d29e5351269e23c6
4
- data.tar.gz: 6933c5cc01fd2be2c050079a665a43f72c06e943e06eb871bbe233129bae7ba9
3
+ metadata.gz: fb2a0c2c9a78ba8ad526c9ed666997e3ce7592b1dbbb29e8623d8c21f92265b9
4
+ data.tar.gz: 8f1f1dc0d6a22f69aba214cbae6f66d564ab338c06ee63dd20ca158a0d1c1f40
5
5
  SHA512:
6
- metadata.gz: 5fbc83485d78d84caf40dbec281549e6e24650b4c1fbe6f57c3a2a81324b42f0bfbf90c8b98f4be9e603f7e0056c51335dd95695d6e8904b32fefa7b34f658b0
7
- data.tar.gz: 2e4f583711220be120cd5461ea24ac4246607b236fb5812987813aa4779d4d1da59e5cfbdac65d0b31566b0189c10417b9d4c1e5a40f17a510ab78ab151bda23
6
+ metadata.gz: 90e19bae5eddeadf3d99a8f31922cb928d911c4957b8558cb28624589b7e6697050d68801af5d2790bb1eae8734aec960ff51976fe8a87abf367788404dcc53e
7
+ data.tar.gz: e3e3f137d384cd4b4248baaedc5a7faa020d889d68bcec5a5aa027cdcf4b6ac3bca4e2acece65a6078adbdc518755c887730f12d65c16f67ed86e47724963ffb
@@ -22,9 +22,9 @@ jobs:
22
22
  gemfile: Gemfile.6-1
23
23
  - ruby: 2.7.3
24
24
  gemfile: Gemfile.7-0
25
- - ruby: 3.0.3
25
+ - ruby: 3.2.0
26
26
  gemfile: Gemfile.6-1
27
- - ruby: 3.0.3
27
+ - ruby: 3.2.0
28
28
  gemfile: Gemfile.7-0
29
29
  env:
30
30
  BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.2.0
data/CHANGELOG.md CHANGED
@@ -9,6 +9,20 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
9
9
 
10
10
  ### Compatible changes
11
11
 
12
+
13
+
14
+ ## 1.2.0 - 2023-01-24
15
+
16
+ ### Compatible changes
17
+
18
+ - Add support for Ruby 3.2
19
+
20
+ ## 1.1.2 - 2022-06-21
21
+
22
+ ### Compatible changes
23
+
24
+ - `.with_power` now also forwards keyword arguments to the Power initializer correctly
25
+
12
26
  ## 1.1.1 - 2022-03-16
13
27
 
14
28
  ### Compatible changes
data/Gemfile.5-2 CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
4
  gem 'railties', '>= 3.2'
5
- gem 'assignable_values'
5
+ gem 'assignable_values', '>= 0.18.0'
6
6
 
7
7
  # Development dependencies
8
8
  gem 'rspec'
@@ -11,7 +11,7 @@ gem 'rspec_candy'
11
11
  gem 'shoulda-matchers'
12
12
  gem 'sqlite3'
13
13
  gem 'database_cleaner'
14
- gem 'gemika'
14
+ gem 'gemika', '>= 0.8.1'
15
15
  gem 'byebug'
16
16
 
17
17
  # Gem under test
data/Gemfile.5-2.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- consul (1.1.0)
4
+ consul (1.2.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -36,7 +36,7 @@ GEM
36
36
  minitest (~> 5.1)
37
37
  tzinfo (~> 1.1)
38
38
  arel (9.0.0)
39
- assignable_values (0.12.1)
39
+ assignable_values (0.18.0)
40
40
  activerecord (>= 2.3)
41
41
  builder (3.2.3)
42
42
  byebug (11.0.1)
@@ -44,16 +44,16 @@ GEM
44
44
  crass (1.0.4)
45
45
  database_cleaner (1.7.0)
46
46
  diff-lcs (1.3)
47
- edge_rider (2.0.0)
47
+ edge_rider (2.1.1)
48
48
  activerecord (>= 3.2)
49
49
  erubi (1.8.0)
50
- gemika (0.5.0)
50
+ gemika (0.8.1)
51
51
  i18n (1.5.3)
52
52
  concurrent-ruby (~> 1.0)
53
53
  loofah (2.2.3)
54
54
  crass (~> 1.0.2)
55
55
  nokogiri (>= 1.5.9)
56
- memoized (1.0.2)
56
+ memoized (1.1.1)
57
57
  method_source (0.9.2)
58
58
  mini_portile2 (2.4.0)
59
59
  minitest (5.11.3)
@@ -112,11 +112,11 @@ PLATFORMS
112
112
  ruby
113
113
 
114
114
  DEPENDENCIES
115
- assignable_values
115
+ assignable_values (>= 0.18.0)
116
116
  byebug
117
117
  consul!
118
118
  database_cleaner
119
- gemika
119
+ gemika (>= 0.8.1)
120
120
  railties (>= 3.2)
121
121
  rspec
122
122
  rspec-rails
data/Gemfile.6-1 CHANGED
@@ -11,7 +11,7 @@ gem 'rspec_candy'
11
11
  gem 'shoulda-matchers'
12
12
  gem 'sqlite3'
13
13
  gem 'database_cleaner'
14
- gem 'gemika'
14
+ gem 'gemika', '>= 0.8.1'
15
15
 
16
16
  # Gem under test
17
17
  gem 'consul', :path => '.'
data/Gemfile.6-1.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- consul (1.1.0)
4
+ consul (1.2.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -35,30 +35,30 @@ GEM
35
35
  minitest (>= 5.1)
36
36
  tzinfo (~> 2.0)
37
37
  zeitwerk (~> 2.3)
38
- assignable_values (0.16.1)
38
+ assignable_values (0.18.0)
39
39
  activerecord (>= 2.3)
40
40
  builder (3.2.4)
41
- concurrent-ruby (1.1.8)
41
+ concurrent-ruby (1.2.0)
42
42
  crass (1.0.6)
43
43
  database_cleaner (1.7.0)
44
44
  diff-lcs (1.3)
45
- edge_rider (1.1.0)
45
+ edge_rider (2.1.1)
46
46
  activerecord (>= 3.2)
47
47
  erubi (1.10.0)
48
- gemika (0.6.1)
49
- i18n (1.8.9)
48
+ gemika (0.8.1)
49
+ i18n (1.12.0)
50
50
  concurrent-ruby (~> 1.0)
51
51
  loofah (2.9.0)
52
52
  crass (~> 1.0.2)
53
53
  nokogiri (>= 1.5.9)
54
- memoized (1.0.2)
54
+ memoized (1.1.1)
55
55
  method_source (1.0.0)
56
- mini_portile2 (2.5.0)
57
- minitest (5.14.4)
58
- nokogiri (1.11.2)
59
- mini_portile2 (~> 2.5.0)
56
+ mini_portile2 (2.6.1)
57
+ minitest (5.15.0)
58
+ nokogiri (1.12.5)
59
+ mini_portile2 (~> 2.6.1)
60
60
  racc (~> 1.4)
61
- racc (1.5.2)
61
+ racc (1.6.2)
62
62
  rack (2.2.3)
63
63
  rack-test (1.1.0)
64
64
  rack (>= 1.0, < 3)
@@ -104,9 +104,9 @@ GEM
104
104
  activerecord (>= 3.2.0)
105
105
  sqlite3 (1.4.2)
106
106
  thor (1.1.0)
107
- tzinfo (2.0.4)
107
+ tzinfo (2.0.5)
108
108
  concurrent-ruby (~> 1.0)
109
- zeitwerk (2.4.2)
109
+ zeitwerk (2.6.6)
110
110
 
111
111
  PLATFORMS
112
112
  ruby
@@ -115,7 +115,7 @@ DEPENDENCIES
115
115
  assignable_values
116
116
  consul!
117
117
  database_cleaner
118
- gemika
118
+ gemika (>= 0.8.1)
119
119
  railties (>= 3.2)
120
120
  rspec
121
121
  rspec-rails
data/Gemfile.7-0 CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
- gem 'railties', '>= 7.0'
4
+ gem 'railties', '>= 7.0.1'
5
5
  gem 'assignable_values'
6
6
 
7
7
  # Development dependencies
@@ -11,7 +11,7 @@ gem 'rspec_candy'
11
11
  gem 'shoulda-matchers'
12
12
  gem 'sqlite3'
13
13
  gem 'database_cleaner'
14
- gem 'gemika'
14
+ gem 'gemika', '>= 0.8.1'
15
15
 
16
16
  # Gem under test
17
17
  gem 'consul', :path => '.'
data/Gemfile.7-0.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- consul (1.1.1)
4
+ consul (1.2.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -11,33 +11,33 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actionpack (7.0.0)
15
- actionview (= 7.0.0)
16
- activesupport (= 7.0.0)
14
+ actionpack (7.0.4.1)
15
+ actionview (= 7.0.4.1)
16
+ activesupport (= 7.0.4.1)
17
17
  rack (~> 2.0, >= 2.2.0)
18
18
  rack-test (>= 0.6.3)
19
19
  rails-dom-testing (~> 2.0)
20
20
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
21
- actionview (7.0.0)
22
- activesupport (= 7.0.0)
21
+ actionview (7.0.4.1)
22
+ activesupport (= 7.0.4.1)
23
23
  builder (~> 3.1)
24
24
  erubi (~> 1.4)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
27
- activemodel (7.0.0)
28
- activesupport (= 7.0.0)
29
- activerecord (7.0.0)
30
- activemodel (= 7.0.0)
31
- activesupport (= 7.0.0)
32
- activesupport (7.0.0)
27
+ activemodel (7.0.4.1)
28
+ activesupport (= 7.0.4.1)
29
+ activerecord (7.0.4.1)
30
+ activemodel (= 7.0.4.1)
31
+ activesupport (= 7.0.4.1)
32
+ activesupport (7.0.4.1)
33
33
  concurrent-ruby (~> 1.0, >= 1.0.2)
34
34
  i18n (>= 1.6, < 2)
35
35
  minitest (>= 5.1)
36
36
  tzinfo (~> 2.0)
37
- assignable_values (0.16.5)
37
+ assignable_values (0.18.0)
38
38
  activerecord (>= 2.3)
39
39
  builder (3.2.4)
40
- concurrent-ruby (1.1.9)
40
+ concurrent-ruby (1.2.0)
41
41
  crass (1.0.6)
42
42
  database_cleaner (2.0.1)
43
43
  database_cleaner-active_record (~> 2.0.0)
@@ -45,73 +45,74 @@ GEM
45
45
  activerecord (>= 5.a)
46
46
  database_cleaner-core (~> 2.0.0)
47
47
  database_cleaner-core (2.0.1)
48
- diff-lcs (1.4.4)
49
- edge_rider (2.0.0)
48
+ diff-lcs (1.5.0)
49
+ edge_rider (2.1.1)
50
50
  activerecord (>= 3.2)
51
- erubi (1.10.0)
52
- gemika (0.6.1)
53
- i18n (1.8.11)
51
+ erubi (1.12.0)
52
+ gemika (0.8.1)
53
+ i18n (1.12.0)
54
54
  concurrent-ruby (~> 1.0)
55
- loofah (2.13.0)
55
+ loofah (2.19.1)
56
56
  crass (~> 1.0.2)
57
57
  nokogiri (>= 1.5.9)
58
- memoized (1.0.2)
58
+ memoized (1.1.1)
59
59
  method_source (1.0.0)
60
- mini_portile2 (2.6.1)
61
- minitest (5.15.0)
62
- nokogiri (1.12.5)
63
- mini_portile2 (~> 2.6.1)
60
+ mini_portile2 (2.8.1)
61
+ minitest (5.17.0)
62
+ nokogiri (1.14.0)
63
+ mini_portile2 (~> 2.8.0)
64
64
  racc (~> 1.4)
65
- racc (1.6.0)
66
- rack (2.2.3)
67
- rack-test (1.1.0)
68
- rack (>= 1.0, < 3)
65
+ racc (1.6.2)
66
+ rack (2.2.6.2)
67
+ rack-test (2.0.2)
68
+ rack (>= 1.3)
69
69
  rails-dom-testing (2.0.3)
70
70
  activesupport (>= 4.2.0)
71
71
  nokogiri (>= 1.6)
72
- rails-html-sanitizer (1.4.2)
73
- loofah (~> 2.3)
74
- railties (7.0.0)
75
- actionpack (= 7.0.0)
76
- activesupport (= 7.0.0)
72
+ rails-html-sanitizer (1.5.0)
73
+ loofah (~> 2.19, >= 2.19.1)
74
+ railties (7.0.4.1)
75
+ actionpack (= 7.0.4.1)
76
+ activesupport (= 7.0.4.1)
77
77
  method_source
78
78
  rake (>= 12.2)
79
79
  thor (~> 1.0)
80
80
  zeitwerk (~> 2.5)
81
81
  rake (13.0.6)
82
- rspec (3.10.0)
83
- rspec-core (~> 3.10.0)
84
- rspec-expectations (~> 3.10.0)
85
- rspec-mocks (~> 3.10.0)
86
- rspec-core (3.10.1)
87
- rspec-support (~> 3.10.0)
88
- rspec-expectations (3.10.1)
82
+ rspec (3.12.0)
83
+ rspec-core (~> 3.12.0)
84
+ rspec-expectations (~> 3.12.0)
85
+ rspec-mocks (~> 3.12.0)
86
+ rspec-core (3.12.0)
87
+ rspec-support (~> 3.12.0)
88
+ rspec-expectations (3.12.2)
89
89
  diff-lcs (>= 1.2.0, < 2.0)
90
- rspec-support (~> 3.10.0)
91
- rspec-mocks (3.10.2)
90
+ rspec-support (~> 3.12.0)
91
+ rspec-mocks (3.12.3)
92
92
  diff-lcs (>= 1.2.0, < 2.0)
93
- rspec-support (~> 3.10.0)
94
- rspec-rails (5.0.2)
95
- actionpack (>= 5.2)
96
- activesupport (>= 5.2)
97
- railties (>= 5.2)
98
- rspec-core (~> 3.10)
99
- rspec-expectations (~> 3.10)
100
- rspec-mocks (~> 3.10)
101
- rspec-support (~> 3.10)
102
- rspec-support (3.10.3)
93
+ rspec-support (~> 3.12.0)
94
+ rspec-rails (6.0.1)
95
+ actionpack (>= 6.1)
96
+ activesupport (>= 6.1)
97
+ railties (>= 6.1)
98
+ rspec-core (~> 3.11)
99
+ rspec-expectations (~> 3.11)
100
+ rspec-mocks (~> 3.11)
101
+ rspec-support (~> 3.11)
102
+ rspec-support (3.12.0)
103
103
  rspec_candy (0.5.1)
104
104
  rspec
105
105
  sneaky-save
106
- shoulda-matchers (5.0.0)
106
+ shoulda-matchers (5.3.0)
107
107
  activesupport (>= 5.2.0)
108
108
  sneaky-save (0.1.3)
109
109
  activerecord (>= 3.2.0)
110
- sqlite3 (1.4.2)
111
- thor (1.1.0)
112
- tzinfo (2.0.4)
110
+ sqlite3 (1.6.0)
111
+ mini_portile2 (~> 2.8.0)
112
+ thor (1.2.1)
113
+ tzinfo (2.0.5)
113
114
  concurrent-ruby (~> 1.0)
114
- zeitwerk (2.5.1)
115
+ zeitwerk (2.6.6)
115
116
 
116
117
  PLATFORMS
117
118
  ruby
@@ -120,8 +121,8 @@ DEPENDENCIES
120
121
  assignable_values
121
122
  consul!
122
123
  database_cleaner
123
- gemika
124
- railties (>= 7.0)
124
+ gemika (>= 0.8.1)
125
+ railties (>= 7.0.1)
125
126
  rspec
126
127
  rspec-rails
127
128
  rspec_candy
@@ -129,4 +130,4 @@ DEPENDENCIES
129
130
  sqlite3
130
131
 
131
132
  BUNDLED WITH
132
- 2.2.25
133
+ 2.3.5
data/lib/consul/power.rb CHANGED
@@ -99,10 +99,17 @@ module Consul
99
99
  Thread.current[ClassMethods.thread_key(self)] = power
100
100
  end
101
101
 
102
- def with_power(inner_power, &block)
103
- unless inner_power.is_a?(self) || inner_power.nil?
104
- inner_power = new(inner_power)
102
+ def with_power(*args, **kwargs , &block)
103
+ inner_power = if args.first.is_a?(self)
104
+ args.first
105
+ elsif args.length == 1 && args.first.nil?
106
+ nil
107
+ elsif kwargs.empty?
108
+ new(*args)
109
+ else
110
+ new(*args, **kwargs)
105
111
  end
112
+
106
113
  old_power = current
107
114
  self.current = inner_power
108
115
  block.call
@@ -1,3 +1,3 @@
1
1
  module Consul
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-16 00:00:00.000000000 Z
11
+ date: 2023-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memoized
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.2.22
138
+ rubygems_version: 3.4.1
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: A scope-based authorization solution for Ruby on Rails.