consul 1.1.1 → 1.1.2

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: b6eccaaa16ca09bba64c34fa020ccf3afb232c8703e8eba552f69aae5e23862b
4
+ data.tar.gz: a3b9012b301fe1a1d3aa2cf9f537c1fc38d67e5d2fa83f0f261ddac2b713e29a
5
5
  SHA512:
6
- metadata.gz: 5fbc83485d78d84caf40dbec281549e6e24650b4c1fbe6f57c3a2a81324b42f0bfbf90c8b98f4be9e603f7e0056c51335dd95695d6e8904b32fefa7b34f658b0
7
- data.tar.gz: 2e4f583711220be120cd5461ea24ac4246607b236fb5812987813aa4779d4d1da59e5cfbdac65d0b31566b0189c10417b9d4c1e5a40f17a510ab78ab151bda23
6
+ metadata.gz: 0e7505d616107cae74166d72b05f93e4ac1f13f2d7ce5f99ca435f6cca0e239aaf67c3d91e5aef31e59c0ace66de97b229a863541417d5b7b1594b568578899c
7
+ data.tar.gz: '048d362f26b0acac2067eda1220561ae1c6afe7566c804e48fbe077693292f74905acd2de76954df6026363b35dcd0e64dcbf9ebf9c38a173b8a220bda0c0f40'
data/CHANGELOG.md CHANGED
@@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
9
9
 
10
10
  ### Compatible changes
11
11
 
12
+ ## 1.1.2 - 2022-06-21
13
+
14
+ ### Compatible changes
15
+
16
+ - `.with_power` now also forwards keyword arguments to the Power initializer correctly
17
+
12
18
  ## 1.1.1 - 2022-03-16
13
19
 
14
20
  ### Compatible changes
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.1.1)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -47,7 +47,7 @@ GEM
47
47
  edge_rider (2.0.0)
48
48
  activerecord (>= 3.2)
49
49
  erubi (1.8.0)
50
- gemika (0.5.0)
50
+ gemika (0.7.1)
51
51
  i18n (1.5.3)
52
52
  concurrent-ruby (~> 1.0)
53
53
  loofah (2.2.3)
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.1.1)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -45,7 +45,7 @@ GEM
45
45
  edge_rider (1.1.0)
46
46
  activerecord (>= 3.2)
47
47
  erubi (1.10.0)
48
- gemika (0.6.1)
48
+ gemika (0.7.1)
49
49
  i18n (1.8.9)
50
50
  concurrent-ruby (~> 1.0)
51
51
  loofah (2.9.0)
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.1.2)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.3.0)
@@ -46,16 +46,16 @@ GEM
46
46
  database_cleaner-core (~> 2.0.0)
47
47
  database_cleaner-core (2.0.1)
48
48
  diff-lcs (1.4.4)
49
- edge_rider (2.0.0)
49
+ edge_rider (2.1.1)
50
50
  activerecord (>= 3.2)
51
51
  erubi (1.10.0)
52
- gemika (0.6.1)
52
+ gemika (0.7.1)
53
53
  i18n (1.8.11)
54
54
  concurrent-ruby (~> 1.0)
55
55
  loofah (2.13.0)
56
56
  crass (~> 1.0.2)
57
57
  nokogiri (>= 1.5.9)
58
- memoized (1.0.2)
58
+ memoized (1.1.0)
59
59
  method_source (1.0.0)
60
60
  mini_portile2 (2.6.1)
61
61
  minitest (5.15.0)
@@ -129,4 +129,4 @@ DEPENDENCIES
129
129
  sqlite3
130
130
 
131
131
  BUNDLED WITH
132
- 2.2.25
132
+ 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.1.2'
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.1.2
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: 2022-06-21 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.2.32
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: A scope-based authorization solution for Ruby on Rails.