can_can_dry 0.5.4 → 0.5.6

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: 5235cb0ce7810299e45a52f6942e855d2df2dad7de345675f6342837e1d607f4
4
- data.tar.gz: 6e5852733b2c139c87041fc2ab8414b225672c197e3638317285c2fac8b6c40f
3
+ metadata.gz: 8862115914dca56a65d42050c0af7feec70958bcea882e5d99f25efb7c99429f
4
+ data.tar.gz: 8f5858f9368e5f41ceede0fc6585443752310f649cd06a8b4daa408e9289c6dd
5
5
  SHA512:
6
- metadata.gz: 0c9150ba70eedd217e2a08f5b43e6ca89c60f84290412a2a2e9b7519b66f749fb688e95043c933cc9758e59c98b17cd6030097141d8aeb43f6fb6f609191d0c6
7
- data.tar.gz: c337a014e748999fddd9b4987966c8493e7f5051ef2cf89a78fb4063aa3901609a79e732d6622ebbb4e684310dd404a4e07f239f840ab3eeeb13afd784e8620c
6
+ metadata.gz: 1a16c1d38b43cf27fb4c638992c50a5190d2f611de64421e85b37c3e0ed74ea52bcd51c7e3c6eb5d5f2190355d237f08e103c8fe7682654451bf66dbedf13653
7
+ data.tar.gz: bbbdf3abcadd8bf9d80e3a39a8233dc130e802c636b43b3df92fe44ab2e38eb2873eab945ee4a891d39f6b5531fcc337d88ef1c922e1cb164e0e936187500063
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CanCanDryHelper
4
4
  def ability_mapping
5
- @ability_mapping ||= ::AbilityMapping.new # rubocop:disable Rails/HelperInstanceVariable
5
+ @ability_mapping ||= ::AbilityMapping.new
6
6
  end
7
7
 
8
8
  def can_by_path?(path, method = :get)
@@ -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
- "para a action \"#{controller}##{action}\"")
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
- return mapping[controller][action] if mapping[controller][action]
101
+ mapping[controller][action]
102
102
  end
103
103
 
104
104
  def find_by_all_action
105
- return mapping[controller][ALL_ACTION] if mapping[controller][ALL_ACTION]
105
+ mapping[controller][ALL_ACTION]
106
106
  end
107
107
 
108
108
  def mapping_has_controller?
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module CanCanDry
6
+ module AbilityMappingSets
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cancancan'
4
+ require 'eac_rails_utils/engine'
5
+
3
6
  module CanCanDry
4
- class Engine < ::Rails::Engine; end
7
+ class Engine < ::Rails::Engine
8
+ include ::EacRailsUtils::EngineHelper
9
+ end
5
10
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CanCanDry
4
- VERSION = '0.5.4'
4
+ VERSION = '0.5.6'
5
5
  end
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
- require 'can_can_dry/railtie'
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
@@ -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
- Aranha::AddressesController.new
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,71 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: can_can_dry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.6
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: 2021-09-05 00:00:00.000000000 Z
11
+ date: 2024-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.13.0
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: 1.13.0
26
+ version: '3.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: eac_ruby_utils
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.72'
33
+ version: '0.22'
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: 0.22.3
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
- version: '0.72'
43
+ version: '0.22'
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: 0.22.3
41
47
  - !ruby/object:Gem::Dependency
42
- name: rails
48
+ name: eac_ruby_utils
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: 4.2.1
53
+ version: '0.121'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: 4.2.1
60
+ version: '0.121'
55
61
  - !ruby/object:Gem::Dependency
56
- name: eac_ruby_gem_support
62
+ name: eac_rails_gem_support
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '0.4'
67
+ version: '0.9'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.9.2
62
71
  type: :development
63
72
  prerelease: false
64
73
  version_requirements: !ruby/object:Gem::Requirement
65
74
  requirements:
66
75
  - - "~>"
67
76
  - !ruby/object:Gem::Version
68
- version: '0.4'
77
+ version: '0.9'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.9.2
69
81
  description:
70
82
  email:
71
83
  executables: []
@@ -77,6 +89,7 @@ files:
77
89
  - lib/can_can_dry/ability_mapping.rb
78
90
  - lib/can_can_dry/ability_mapping/action_mapping_not_found.rb
79
91
  - lib/can_can_dry/ability_mapping/path_mapping_not_found.rb
92
+ - lib/can_can_dry/ability_mapping_sets.rb
80
93
  - lib/can_can_dry/ability_mapping_sets/active_scaffold.rb
81
94
  - lib/can_can_dry/ability_mapping_sets/devise.rb
82
95
  - lib/can_can_dry/ability_mapping_sets/devise_invitable.rb
@@ -84,12 +97,8 @@ files:
84
97
  - lib/can_can_dry/engine.rb
85
98
  - lib/can_can_dry/no_controller_can_can_additions.rb
86
99
  - lib/can_can_dry/path_recognizer.rb
87
- - lib/can_can_dry/railtie.rb
88
100
  - lib/can_can_dry/version.rb
89
101
  - lib/tasks/can_can_dry.rake
90
- - spec/lib/can_can_dry/path_recognizer_spec.rb
91
- - spec/lib/rubocop_check_spec.rb
92
- - spec/spec_helper.rb
93
102
  homepage: https://github.com/esquilo-azul/can_can_dry
94
103
  licenses: []
95
104
  metadata:
@@ -102,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
111
  requirements:
103
112
  - - ">="
104
113
  - !ruby/object:Gem::Version
105
- version: '0'
114
+ version: '2.7'
106
115
  required_rubygems_version: !ruby/object:Gem::Requirement
107
116
  requirements:
108
117
  - - ">="
@@ -113,7 +122,4 @@ rubygems_version: 3.1.6
113
122
  signing_key:
114
123
  specification_version: 4
115
124
  summary: DRY authorization with CanCanCan.
116
- test_files:
117
- - spec/lib/can_can_dry/path_recognizer_spec.rb
118
- - spec/lib/rubocop_check_spec.rb
119
- - spec/spec_helper.rb
125
+ test_files: []
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module CanCanDry
4
- require 'rails'
5
-
6
- class Railtie < Rails::Railtie
7
- rake_tasks { load 'tasks/can_can_dry.rake' }
8
- end
9
- end
@@ -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
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ::EacRubyUtils::Rspec.default_setup.describe_rubocop
data/spec/spec_helper.rb DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/rspec/default_setup'
4
- ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))