mistiq 0.0.91 → 0.0.92
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mistiq/init.rb +45 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzgzNGFiZDUzNzFkOWJiMDk5MjMxZDIyZjI5ZDQxY2Y4NWQ3ZGNlMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmZiMGE5MDExNzkyZDBhYzZkZmM0YmI0NDM3MTkwNDZjMmI0NTAyYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWVhZGEzMTJjMzY2ZGEwY2QwNDczZTgyNGQ2YTQ0NTE4MjQ3M2E2NmIzOWEx
|
10
|
+
MGJiNzBiNDg1OTg0OWJhZjZlM2IzNmI3NTE3OTBkMGVlNGJlOTg2YmMyOWFh
|
11
|
+
ZTUzNjljMzAyNTQxNWU1NGQ3MTVkNDI1ZWMyNzE4Y2NhZjUyZDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWZiMDg4ZWZkMGE3OTZjNjIxNWY5Mzc3ZWQ4YWNhMDQ4MGFiZDJmZTllNTkx
|
14
|
+
NGIxZDQxYTNmMGJkYTEzZTY2ZGJhNmQ2ZmY2Y2UxZTA4M2QwZDYzOTQxMDM5
|
15
|
+
ZTlkNTkzNjkzZjUxOTdhODIzYmRlODRlN2E0MWRjMjk1OWI0MzY=
|
data/lib/mistiq/init.rb
CHANGED
@@ -47,6 +47,47 @@ module Mistiq
|
|
47
47
|
end
|
48
48
|
}
|
49
49
|
|
50
|
+
engine_routes = inspector.get_engine_routes
|
51
|
+
|
52
|
+
if engine_routes != nil
|
53
|
+
engine_routes.each {
|
54
|
+
|name, routes|
|
55
|
+
|
56
|
+
routes.each {
|
57
|
+
|r|
|
58
|
+
|
59
|
+
reqs = r[:reqs].split('#')
|
60
|
+
|
61
|
+
controller = reqs[0]
|
62
|
+
action = reqs[1]
|
63
|
+
|
64
|
+
route = r[:path]
|
65
|
+
verb = r[:verb]
|
66
|
+
|
67
|
+
#get regex-ed route
|
68
|
+
regex_len = r[:regexp].length
|
69
|
+
regex = r[:regexp].slice(1..regex_len-2)
|
70
|
+
|
71
|
+
#if action#controller's data method is not GET and not POST
|
72
|
+
if verb != "GET" && verb != "POST" && verb != ""
|
73
|
+
method_regex = "data-method=(\"|')#{verb.downcase}(\"|')";
|
74
|
+
pattern = "<a.*#{method_regex}.*href=(\"|')#{regex}(\"|').*>.*<\/a>"
|
75
|
+
|
76
|
+
#also check if method_regex occurs after the href attribute
|
77
|
+
pattern = pattern+"@@@<a.*href=(\"|')#{regex}(\"|').*#{method_regex}.*>.*<\/a>"
|
78
|
+
elsif verb == "GET"
|
79
|
+
#if action#controller's data method is GET
|
80
|
+
#pattern = "<a(.*href=(\"|')#{pattern}(\"|'))(?!.*data\-method)[^<]*<\/a>"
|
81
|
+
pattern = "<a(?!.*data\-method)(.*href=(\"|')#{regex}(\"|'))[^<]*<\/a>"
|
82
|
+
end
|
83
|
+
|
84
|
+
if verb == "GET" || (verb != "POST" && verb != "")
|
85
|
+
@LINK_REGEX_HASH["#{controller}##{action}"] = pattern
|
86
|
+
end
|
87
|
+
}
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
50
91
|
puts "Link REGEX hash has been computed. #{@LINK_REGEX_HASH.size} routes were hashed."
|
51
92
|
end
|
52
93
|
end
|
@@ -142,6 +183,10 @@ module Mistiq
|
|
142
183
|
return routes
|
143
184
|
end
|
144
185
|
|
186
|
+
def get_engine_routes
|
187
|
+
return @engines
|
188
|
+
end
|
189
|
+
|
145
190
|
private
|
146
191
|
|
147
192
|
def filter_routes(filter)
|