mistiq 0.0.88 → 0.0.89
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/init.rb +12 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODg3ZjBjZDdkZjkzNjA4ODFhMzk4ZjE5NmM5YjIzNTZiMDdjNzJmMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTc5MmU4YjY5YTQzZjVlMWNmMTc0ZWJhOGRhMTZlZWI5ZTAxMzM2Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDY3NTNhNDc3OTM5MTliNjQwZTg4ZDgzMzFkMzQ3ZTQ4NTNlMzkzMzVhOWMy
|
10
|
+
ODA3NzU1YmEyMTk3OGQyYzM4ZTU5Yjk4ZjhjZjQzN2E1NTBlM2I0MjRlYjEw
|
11
|
+
M2M0YWZmYTFlNWVlYmRlMWZlMTM1ZWFmZGM2ZTYxZmZmNGJhYzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGQyYTUwNzE3N2ViMzE0ZmQzYzEwNGFkYzAzMzQwYzI2NjBhNzYxMTU0YjAy
|
14
|
+
MTVlMDZkNzM5MzliMzc3YjA4MmQyMWJlZjk4MjliNGM1MzEyMTc4ODkzZmE5
|
15
|
+
ZjdkMTZjYzQ1MjMzMWMzODdmOTcyZmExNTdlZjc5MDlkMDg3Y2Q=
|
data/lib/mistiq/init.rb
CHANGED
@@ -5,6 +5,7 @@ module Mistiq
|
|
5
5
|
#to redact links in the views
|
6
6
|
Rails.application.config.after_initialize do
|
7
7
|
@LINK_REGEX_HASH = Hash.new
|
8
|
+
clashes = Hash.new
|
8
9
|
|
9
10
|
#pre-load routes
|
10
11
|
Rails.application.reload_routes!
|
@@ -18,7 +19,7 @@ module Mistiq
|
|
18
19
|
action = r.defaults[:action]
|
19
20
|
|
20
21
|
route = r.path.spec.to_s
|
21
|
-
|
22
|
+
|
22
23
|
#removes (.:format)
|
23
24
|
if route.match("(.:format)")
|
24
25
|
pattern = route.sub("(.:format)","")
|
@@ -49,10 +50,19 @@ module Mistiq
|
|
49
50
|
#espace / characters
|
50
51
|
pattern.gsub!(/\//,"\\/")
|
51
52
|
|
53
|
+
#check if the current route clashes with another one
|
54
|
+
if !clashes[route].nil?
|
55
|
+
puts "Route clash at #{controller}##{action} for route #{route} with route for #{clashes[route]}"
|
56
|
+
else
|
57
|
+
#add route to the clashes hash to detect
|
58
|
+
#any future route clashes
|
59
|
+
clashes[route] = "#{controller}##{action}"
|
60
|
+
end
|
61
|
+
|
52
62
|
@LINK_REGEX_HASH["#{controller}##{action}"] = pattern
|
53
63
|
}
|
54
64
|
|
55
|
-
puts "Link REGEX hash has been computed"
|
65
|
+
puts "Link REGEX hash has been computed. #{clashes.size} route clashes have been found."
|
56
66
|
end
|
57
67
|
end
|
58
68
|
|