mistiq 0.0.923 → 0.0.924
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 +8 -8
- data/lib/mistiq/base.rb +2 -2
- data/lib/mistiq/defaults.rb +13 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWVlNGJiZTE4YmY2MWUyYjQ5NzkxYjk4ZDEzOTdmNTlkZmIxYmM5Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzdjNGVlYzhlYTc1YzY4ZjA3OWYzNWQxZmZiODdhMzc5MjA1ZjkwOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODYzNWU3NTAwODM0MmViNTVlODQxNTFjYjc1NGU4ZWZmYjg3NzRiNDY5NzQ2
|
10
|
+
OTI3ODRmMmY3MTcyZGM1MDY2YmVlMDVlYjE1M2MyYWNhOTM4ZDBmMWI4YWZh
|
11
|
+
NTRkZGMzZmZjZjUzNWFmNDk4NGRkZWJiYjZhZWI1ZmY3Njc4YWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGUwYzI3ZjJiYzA3Mjg4YzQ5YWI1NDUzNjk0OGNkMjc3YWIxMTRjNDUyYzk1
|
14
|
+
ZjkzNjQ2ZWIwOWU3OTc1NjUyOWYyMWU3NGNhOWE0OGZhMGExY2M2ODYwNDEx
|
15
|
+
NDZhNjg2MWMzYTI5NzAyNzkzN2Y0MGNlOWFmYjI5NWEzOWZhMmY=
|
data/lib/mistiq/base.rb
CHANGED
@@ -39,7 +39,7 @@ module Mistiq
|
|
39
39
|
if(current_controller == pair_array[0] && current_action == pair_array[1])
|
40
40
|
#if strip_links is true, then
|
41
41
|
#enable link removal
|
42
|
-
if
|
42
|
+
if pair[2]
|
43
43
|
disable(pair_array[0],pair_array[1])
|
44
44
|
else
|
45
45
|
disable_action(pair_array[0],pair_array[1])
|
@@ -47,7 +47,7 @@ module Mistiq
|
|
47
47
|
else
|
48
48
|
#if strip_links is true, then
|
49
49
|
#enable link removal
|
50
|
-
if
|
50
|
+
if pair[2]
|
51
51
|
remove_links(pair_array[0],pair_array[1])
|
52
52
|
end
|
53
53
|
end
|
data/lib/mistiq/defaults.rb
CHANGED
@@ -1,46 +1,46 @@
|
|
1
1
|
module Mistiq
|
2
|
-
#disable all
|
3
|
-
|
4
|
-
def disable_action_ops(action)
|
2
|
+
#disable all actions for a specific controller
|
3
|
+
def disable_controller(controller,strip_links=true)
|
5
4
|
Railtie.get_regex_hash.each {
|
6
5
|
|r,p|
|
7
|
-
set_guard_rule(true,r) if r.match(
|
6
|
+
set_guard_rule(true,r,strip_links) if r.match(/#{controller}.*/)
|
8
7
|
}
|
9
8
|
end
|
10
9
|
|
11
|
-
#disable all
|
12
|
-
|
10
|
+
#disable all 'action' operations across
|
11
|
+
#the rails application
|
12
|
+
def disable_action_ops(action,strip_links=true)
|
13
13
|
Railtie.get_regex_hash.each {
|
14
14
|
|r,p|
|
15
|
-
set_guard_rule(true,r) if r.match(
|
15
|
+
set_guard_rule(true,r,strip_links) if r.match(/.*#{action}/)
|
16
16
|
}
|
17
17
|
end
|
18
18
|
|
19
19
|
#disable all destroy operations across
|
20
20
|
#the rails application
|
21
|
-
def disable_create_ops()
|
21
|
+
def disable_create_ops(strip_links=true)
|
22
22
|
Railtie.get_regex_hash.each {
|
23
23
|
|r,p|
|
24
|
-
set_guard_rule(true,r) if r.match(/.*#new/) || r.match(/.*#add/)
|
24
|
+
set_guard_rule(true,r,strip_links) if r.match(/.*#new/) || r.match(/.*#add/) || r.match(/.*#create/)
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
28
28
|
#disable all edit operations across
|
29
29
|
#the rails application
|
30
|
-
def disable_update_ops()
|
30
|
+
def disable_update_ops(strip_links=true)
|
31
31
|
Railtie.get_regex_hash.each {
|
32
32
|
|r,p|
|
33
|
-
set_guard_rule(true,r) if r.match(/.*#edit/) || r.match(/.*#update/)
|
33
|
+
set_guard_rule(true,r,strip_links) if r.match(/.*#edit/) || r.match(/.*#update/)
|
34
34
|
puts p
|
35
35
|
}
|
36
36
|
end
|
37
37
|
|
38
38
|
#disable all destroy operations across
|
39
39
|
#the rails application
|
40
|
-
def disable_destroy_ops()
|
40
|
+
def disable_destroy_ops(strip_links=true)
|
41
41
|
Railtie.get_regex_hash.each {
|
42
42
|
|r,p|
|
43
|
-
set_guard_rule(true,r) if r.match(/.*#destroy/) || r.match(/.*#delete/) || r.match(/.*#remove/)
|
43
|
+
set_guard_rule(true,r,strip_links) if r.match(/.*#destroy/) || r.match(/.*#delete/) || r.match(/.*#remove/)
|
44
44
|
}
|
45
45
|
end
|
46
46
|
end
|