strong_actions 0.2.1 → 0.3.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: fdae0a8c14b6469d215869817d425b2eff058e5f5dec21a917907fcf3f2db64f
4
- data.tar.gz: d8d4cbbdc46d75781563efdaa72386cb606dac64e8ef72abb5119c27c45ef1e5
3
+ metadata.gz: 353a6fe22d85f75297477cab87cb2a531ebc1176d0a770455cd38b2d46b8695f
4
+ data.tar.gz: 404296cf097ce84a0679f2dc7fca4815743cf223e6abea1d9551c58cda020861
5
5
  SHA512:
6
- metadata.gz: 4b3c1c3659fcdf6411e803babc9f420cd8702d053f41b224d8456ec0824f5dd952a9d94092f503bba65620d3ad8e3c54dffb0d819796d8e88d8ac80c19d15495
7
- data.tar.gz: cca6fcc202d2718a0232398f6b5568d8064b7262df6ff17ea462365acb71a39ed40128bfe6910c18b80c28285517ec4e2ebd3206d4e4e8bed210b4a7c59f3826
6
+ metadata.gz: fef3d36cf954bb73d98380b28c83a4a63a358d10154fcd54ee5b1fd0b7813bfb866202d983643c1597ab4f61e33a1b25c62a9690a4ac1fec1af0d137740b3aec
7
+ data.tar.gz: 0e8b0020db1df0f31c07bd96ce22f61cbf4e07d3a183fb605920254d09c7cf3ee015264ef33fd01360c658a87a8b25e169ade1feed860340036d1445b5c6cb6d
data/HISTORY.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # History
2
+ ## 0.3.0
3
+ * drop support for ruby-2.5
4
+ * add support for rails-6
2
5
 
3
6
  ## 0.2.1
4
7
  * drop support for rails-4.2, 5.0, 5.1(CVE-2020-8165)
@@ -1,16 +1,11 @@
1
- require 'strong_actions/decision'
1
+ require_relative 'decision'
2
2
 
3
3
  module StrongActions
4
4
  module Controller
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- if ::ActionPack::VERSION::MAJOR < 4
9
- before_filter :authorize_roles!
10
- else
11
- before_action :authorize_roles!
12
- end
13
-
8
+ before_action :authorize_roles!
14
9
  helper_method :available?
15
10
  end
16
11
 
@@ -27,6 +27,8 @@ module StrongActions
27
27
  return false if definition === false
28
28
 
29
29
  role_object = role_object_for(role)
30
+ return false unless role_object
31
+
30
32
  return false unless role_object.instance_eval(definition)
31
33
  end
32
34
 
@@ -1,3 +1,3 @@
1
1
  module StrongActions
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -17,13 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.required_ruby_version = '~> 2.5'
20
+ spec.required_ruby_version = '~> 2.7'
21
21
 
22
- spec.add_dependency "activesupport", '>= 5.2.4.3', '< 6'
23
- spec.add_dependency "actionpack", '>= 5.2.4.3', '< 6'
24
- spec.add_dependency "railties", '>= 5.2.4.3', '< 6'
22
+ spec.add_dependency "activesupport", '>= 5.2', '< 7'
23
+ spec.add_dependency "actionpack", '>= 5.2', '< 7'
24
+ spec.add_dependency "railties", '>= 5.2', '< 7'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 2.0'
27
- spec.add_development_dependency 'minitest'
27
+ spec.add_development_dependency 'minitest', '~> 5.25'
28
28
  spec.add_development_dependency 'rake', '~> 12.0'
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-28 00:00:00.000000000 Z
11
+ date: 2024-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,60 +16,60 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.4.3
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '7'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 5.2.4.3
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 5.2.4.3
39
+ version: '5.2'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '6'
42
+ version: '7'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 5.2.4.3
49
+ version: '5.2'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '6'
52
+ version: '7'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: railties
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 5.2.4.3
59
+ version: '5.2'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '6'
62
+ version: '7'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 5.2.4.3
69
+ version: '5.2'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: '6'
72
+ version: '7'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: bundler
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -88,16 +88,16 @@ dependencies:
88
88
  name: minitest
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ">="
91
+ - - "~>"
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: '5.25'
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - ">="
98
+ - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '0'
100
+ version: '5.25'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: rake
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -152,14 +152,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
153
  - - "~>"
154
154
  - !ruby/object:Gem::Version
155
- version: '2.5'
155
+ version: '2.7'
156
156
  required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.2.16
162
+ rubygems_version: 3.4.22
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: access control for rails controller/action