strong_actions 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +18 -18
- data/HISTORY.md +3 -0
- data/lib/strong_actions/config.rb +22 -7
- data/lib/strong_actions/version.rb +1 -1
- data/strong_actions.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cb9467219528ebebcfced8aba69697ccce65389
|
4
|
+
data.tar.gz: 968f1316ff553ee8f9075acb4797e8d875f0a467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a6a0c9caf21a3d6d95a3a3cdaeb4f75c1fdce95f9ca2ed5cf8965b0c365097d7080f4a9338fd804c55c133b3755ad5be23a4b63fc2f7525728ae7f5c62467b3
|
7
|
+
data.tar.gz: 2b72b1197594bda0b7cdbb9f0b5a58504922999f0214405eb073ab5e72b0011b3ec3ac6ef350579e64e94cde3bbbb5cd4e23db54cd9a955c2b12d48e79d46281
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strong_actions (0.0.
|
4
|
+
strong_actions (0.0.9)
|
5
5
|
actionpack (>= 4.1, < 5.1)
|
6
6
|
activesupport (>= 4.1, < 5.1)
|
7
7
|
railties (>= 4.1, < 5.1)
|
@@ -9,34 +9,34 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (5.0.
|
13
|
-
actionview (= 5.0.
|
14
|
-
activesupport (= 5.0.
|
12
|
+
actionpack (5.0.2)
|
13
|
+
actionview (= 5.0.2)
|
14
|
+
activesupport (= 5.0.2)
|
15
15
|
rack (~> 2.0)
|
16
16
|
rack-test (~> 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
19
|
-
actionview (5.0.
|
20
|
-
activesupport (= 5.0.
|
19
|
+
actionview (5.0.2)
|
20
|
+
activesupport (= 5.0.2)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubis (~> 2.7.0)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
25
|
-
activesupport (5.0.
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
25
|
+
activesupport (5.0.2)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (~> 0.7)
|
28
28
|
minitest (~> 5.1)
|
29
29
|
tzinfo (~> 1.1)
|
30
30
|
builder (3.2.3)
|
31
|
-
concurrent-ruby (1.0.
|
31
|
+
concurrent-ruby (1.0.5)
|
32
32
|
erubis (2.7.0)
|
33
|
-
i18n (0.8.
|
33
|
+
i18n (0.8.1)
|
34
34
|
loofah (2.0.3)
|
35
35
|
nokogiri (>= 1.5.9)
|
36
36
|
method_source (0.8.2)
|
37
37
|
mini_portile2 (2.1.0)
|
38
38
|
minitest (5.10.1)
|
39
|
-
nokogiri (1.7.
|
39
|
+
nokogiri (1.7.1)
|
40
40
|
mini_portile2 (~> 2.1.0)
|
41
41
|
rack (2.0.1)
|
42
42
|
rack-test (0.6.3)
|
@@ -46,16 +46,16 @@ GEM
|
|
46
46
|
nokogiri (~> 1.6)
|
47
47
|
rails-html-sanitizer (1.0.3)
|
48
48
|
loofah (~> 2.0)
|
49
|
-
railties (5.0.
|
50
|
-
actionpack (= 5.0.
|
51
|
-
activesupport (= 5.0.
|
49
|
+
railties (5.0.2)
|
50
|
+
actionpack (= 5.0.2)
|
51
|
+
activesupport (= 5.0.2)
|
52
52
|
method_source
|
53
53
|
rake (>= 0.8.7)
|
54
54
|
thor (>= 0.18.1, < 2.0)
|
55
|
-
rake (
|
55
|
+
rake (12.0.0)
|
56
56
|
thor (0.19.4)
|
57
|
-
thread_safe (0.3.
|
58
|
-
tzinfo (1.2.
|
57
|
+
thread_safe (0.3.6)
|
58
|
+
tzinfo (1.2.3)
|
59
59
|
thread_safe (~> 0.1)
|
60
60
|
|
61
61
|
PLATFORMS
|
@@ -64,7 +64,7 @@ PLATFORMS
|
|
64
64
|
DEPENDENCIES
|
65
65
|
bundler (~> 1.7)
|
66
66
|
minitest
|
67
|
-
rake (~>
|
67
|
+
rake (~> 12.0)
|
68
68
|
strong_actions!
|
69
69
|
|
70
70
|
BUNDLED WITH
|
data/HISTORY.md
CHANGED
@@ -7,6 +7,7 @@ module StrongActions
|
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@config_files ||= ['config/acl.yml']
|
10
|
+
@mutex = Mutex.new
|
10
11
|
end
|
11
12
|
|
12
13
|
def config_files
|
@@ -28,18 +29,32 @@ module StrongActions
|
|
28
29
|
private
|
29
30
|
|
30
31
|
def definitions
|
31
|
-
if
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
if should_load?
|
33
|
+
with_mutex do
|
34
|
+
if should_load?
|
35
|
+
@acl = {}
|
36
|
+
config_files.each do |config_file|
|
37
|
+
yml = YAML.load_file(config_file)
|
38
|
+
yml.each do |role, values|
|
39
|
+
raise "role #{role} is defined multiple times. config files are [#{config_files.join(', ')}]" if @acl.has_key?(role)
|
40
|
+
@acl[role] = values
|
41
|
+
end
|
42
|
+
end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
@acl
|
42
47
|
end
|
43
48
|
|
49
|
+
def should_load?
|
50
|
+
@acl.nil? or Rails.env.development?
|
51
|
+
end
|
52
|
+
|
53
|
+
def with_mutex
|
54
|
+
@mutex.synchronize do
|
55
|
+
yield
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
44
59
|
end
|
45
60
|
end
|
data/strong_actions.gemspec
CHANGED
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.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -104,14 +104,14 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - "~>"
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
107
|
+
version: '12.0'
|
108
108
|
type: :development
|
109
109
|
prerelease: false
|
110
110
|
version_requirements: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - "~>"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
114
|
+
version: '12.0'
|
115
115
|
description: access control for rails controller/action
|
116
116
|
email:
|
117
117
|
- ichylinux@gmail.com
|