can_can_dry 0.5.5 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/can_can_dry_helper.rb +1 -1
- data/lib/can_can_dry/ability_mapping/action_mapping_not_found.rb +1 -1
- data/lib/can_can_dry/ability_mapping.rb +2 -2
- data/lib/can_can_dry/ability_mapping_sets.rb +9 -0
- data/lib/can_can_dry/engine.rb +6 -1
- data/lib/can_can_dry/path_recognizer.rb +1 -1
- data/lib/can_can_dry/version.rb +1 -1
- data/lib/can_can_dry.rb +2 -12
- data/lib/tasks/can_can_dry.rake +1 -2
- metadata +22 -28
- data/lib/can_can_dry/railtie.rb +0 -9
- data/spec/lib/can_can_dry/path_recognizer_spec.rb +0 -17
- data/spec/lib/rubocop_check_spec.rb +0 -3
- data/spec/spec_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b07df87371eaf014fadb5e5748318358b26730b525796a29dc92bfec31a703c8
|
4
|
+
data.tar.gz: 7d22d51acbc390222f91b594b01fda7ac8ab788ea40e105029287edb3ab835f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bafc7215cea1623ade93b0cad0eba11b4a573169ffb9589e95ca6e7c4e810f0098470530cf941967b33cf4bd0674f17d1794e620a3c2bc27f86f176d4bfcf90
|
7
|
+
data.tar.gz: 7be3a8052ea0ace0dcd0ccfa3af64ba1b0d49b8940867b26161ef8197c76105f559b9022025fe89595601c360ed7d1d3e334a7ade6a6d97a47c2b74a59e19555
|
@@ -5,7 +5,7 @@ module CanCanDry
|
|
5
5
|
class ActionMappingNotFound < RuntimeError
|
6
6
|
def initialize(controller, action)
|
7
7
|
super('Nenhum mapeamento de controle de acesso encontrado ' \
|
8
|
-
|
8
|
+
"para a action \"#{controller}##{action}\"")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -98,11 +98,11 @@ module CanCanDry
|
|
98
98
|
private
|
99
99
|
|
100
100
|
def find_by_action
|
101
|
-
|
101
|
+
mapping[controller][action]
|
102
102
|
end
|
103
103
|
|
104
104
|
def find_by_all_action
|
105
|
-
|
105
|
+
mapping[controller][ALL_ACTION]
|
106
106
|
end
|
107
107
|
|
108
108
|
def mapping_has_controller?
|
data/lib/can_can_dry/engine.rb
CHANGED
@@ -52,7 +52,7 @@ module CanCanDry
|
|
52
52
|
begin
|
53
53
|
return engine.instance.routes.recognize_path(engine_path, options)
|
54
54
|
rescue ActionController::RoutingError => e
|
55
|
-
Rails.logger.debug "[#{engine}] ActionController::RoutingError: #{e.message}"
|
55
|
+
Rails.logger.debug { "[#{engine}] ActionController::RoutingError: #{e.message}" }
|
56
56
|
end
|
57
57
|
nil
|
58
58
|
end
|
data/lib/can_can_dry/version.rb
CHANGED
data/lib/can_can_dry.rb
CHANGED
@@ -1,18 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'active_support/dependencies'
|
4
3
|
require 'cancancan'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
5
|
|
6
6
|
module CanCanDry
|
7
|
-
|
8
|
-
require_dependency 'can_can_dry/controller_authorization'
|
9
|
-
require_dependency 'can_can_dry/ability_mapping_sets/active_scaffold'
|
10
|
-
require_dependency 'can_can_dry/ability_mapping_sets/devise'
|
11
|
-
require_dependency 'can_can_dry/ability_mapping_sets/devise_invitable'
|
12
|
-
require_dependency 'can_can_dry/ability_mapping'
|
13
|
-
require_dependency 'can_can_dry/ability_mapping/path_mapping_not_found'
|
14
|
-
require_dependency 'can_can_dry/ability_mapping/action_mapping_not_found'
|
15
|
-
require_dependency 'can_can_dry/engine'
|
16
|
-
require_dependency 'can_can_dry/no_controller_can_can_additions'
|
17
|
-
require_dependency 'can_can_dry/path_recognizer'
|
7
|
+
require_sub __FILE__
|
18
8
|
end
|
data/lib/tasks/can_can_dry.rake
CHANGED
@@ -13,8 +13,7 @@ namespace :can_can_dry do
|
|
13
13
|
|
14
14
|
desc 'Inform the path and receive the controller/action.'
|
15
15
|
task :path_recognize, [:path] => :environment do |_t, args|
|
16
|
-
|
17
|
-
r = ::CanCanDry::PathRecognizer.recognize('', args.path)
|
16
|
+
r = CanCanDry::PathRecognizer.recognize('', args.path)
|
18
17
|
Rails.logger.info("Result: #{r}")
|
19
18
|
end
|
20
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: can_can_dry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cancancan
|
@@ -16,68 +16,68 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: eac_rails_utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.23'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.
|
36
|
+
version: 0.23.2
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.23'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
46
|
+
version: 0.23.2
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: eac_ruby_utils
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '0.121'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '0.121'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: eac_rails_gem_support
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.9'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.9.2
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '0.
|
77
|
+
version: '0.9'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.
|
80
|
+
version: 0.9.2
|
81
81
|
description:
|
82
82
|
email:
|
83
83
|
executables: []
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/can_can_dry/ability_mapping.rb
|
90
90
|
- lib/can_can_dry/ability_mapping/action_mapping_not_found.rb
|
91
91
|
- lib/can_can_dry/ability_mapping/path_mapping_not_found.rb
|
92
|
+
- lib/can_can_dry/ability_mapping_sets.rb
|
92
93
|
- lib/can_can_dry/ability_mapping_sets/active_scaffold.rb
|
93
94
|
- lib/can_can_dry/ability_mapping_sets/devise.rb
|
94
95
|
- lib/can_can_dry/ability_mapping_sets/devise_invitable.rb
|
@@ -96,12 +97,8 @@ files:
|
|
96
97
|
- lib/can_can_dry/engine.rb
|
97
98
|
- lib/can_can_dry/no_controller_can_can_additions.rb
|
98
99
|
- lib/can_can_dry/path_recognizer.rb
|
99
|
-
- lib/can_can_dry/railtie.rb
|
100
100
|
- lib/can_can_dry/version.rb
|
101
101
|
- lib/tasks/can_can_dry.rake
|
102
|
-
- spec/lib/can_can_dry/path_recognizer_spec.rb
|
103
|
-
- spec/lib/rubocop_check_spec.rb
|
104
|
-
- spec/spec_helper.rb
|
105
102
|
homepage: https://github.com/esquilo-azul/can_can_dry
|
106
103
|
licenses: []
|
107
104
|
metadata:
|
@@ -114,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
111
|
requirements:
|
115
112
|
- - ">="
|
116
113
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
114
|
+
version: '2.7'
|
118
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
116
|
requirements:
|
120
117
|
- - ">="
|
@@ -125,7 +122,4 @@ rubygems_version: 3.1.6
|
|
125
122
|
signing_key:
|
126
123
|
specification_version: 4
|
127
124
|
summary: DRY authorization with CanCanCan.
|
128
|
-
test_files:
|
129
|
-
- spec/lib/can_can_dry/path_recognizer_spec.rb
|
130
|
-
- spec/lib/rubocop_check_spec.rb
|
131
|
-
- spec/spec_helper.rb
|
125
|
+
test_files: []
|
data/lib/can_can_dry/railtie.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'can_can_dry/path_recognizer'
|
4
|
-
|
5
|
-
RSpec.describe ::CanCanDry::PathRecognizer do
|
6
|
-
describe '#remove_root_path' do
|
7
|
-
[%w[/path/to/action /prefix/ /prefix/path/to/action],
|
8
|
-
%w[/path/to/action /prefix /prefix/path/to/action],
|
9
|
-
%w[/path / /path],
|
10
|
-
['/path', '', '/path'],
|
11
|
-
%w[/unknown/path /abc /unknown/path]].each do |s|
|
12
|
-
it do
|
13
|
-
expect(described_class.send(:remove_root_path, s[1], s[2])).to eq(s[0])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/spec/spec_helper.rb
DELETED