view_tree 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/view_tree/version.rb +1 -1
- data/lib/view_tree.rb +16 -18
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2IxMGUzZjBiNDE4MWQyZDdjZGQwYzBlYzg3N2M1MGI3ZTc1OGRiYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzJiNzUwZjcyOGJmMjRiM2MwMDYzZDNkNGMxOTIzYWQ1MWQzNDRlMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDYzOTM2MDAxNmY2Y2E4MjcxODI2OTFhM2U2MmRlMGY1MThjZTM5YWM3Zjc3
|
10
|
+
NjcyMjg1YTZhYWEwN2Y0ZTY1Njg4MDJiOTMyOGRiMzYxMWEzZmE4ZDAyYWZm
|
11
|
+
ZjIyNTNjOTAyZGFjODQ4MDVlNDI3MTNjMTNmOWEyYWFiZjE1M2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWVmM2M5ZTQxMmM5ZjI4Yzg3YjllOWNjZTk1MGRhYjVhOTc1Zjg0MjJiZDdh
|
14
|
+
NThmZGJmOTg2ODM1ZDQxY2NhMjI0MzQ5ZDFmNTljN2Y1YTdhYTkzNGZiODdl
|
15
|
+
NWVlOWZmZTNmNTkzN2UxNGJlNzgzYmJhZjJlYmY5MzAzYzQ5Yjc=
|
data/lib/view_tree/version.rb
CHANGED
data/lib/view_tree.rb
CHANGED
@@ -31,20 +31,24 @@ class Cb
|
|
31
31
|
# push all the partials into queue
|
32
32
|
|
33
33
|
reg_partial_name = /(?<=(partial=>)|(render)|(spotpartial=>))\s*['"][a-zA-Z_\/-]+(?=['"])/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
partial_name
|
41
|
-
|
42
|
-
|
34
|
+
|
35
|
+
begin
|
36
|
+
File.readlines(file_name).each do |line|
|
37
|
+
if !reg_partial_name.match(line).nil?
|
38
|
+
partial_name = reg_partial_name.match(line)
|
39
|
+
partial_name = partial_name.to_s.gsub!(/[\s'"]*/, "")
|
40
|
+
if !partial_name[/spot_loader/].nil?
|
41
|
+
partial_name = line[/(?<=spotpartial=>)\s*['"][a-zA-Z_\/-]+(?=['"])/].to_s.gsub!(/[\s'"]*/, "")
|
42
|
+
else
|
43
|
+
partial_name = File.basename(partial_name)
|
44
|
+
end
|
45
|
+
self.view_helper("_" + partial_name + ".html.erb" )
|
43
46
|
end
|
44
|
-
self.view_helper("_" + partial_name + ".html.erb" )
|
45
47
|
end
|
48
|
+
rescue
|
49
|
+
puts "Please input correct controller and action name."
|
50
|
+
exit
|
46
51
|
end
|
47
|
-
|
48
52
|
end
|
49
53
|
|
50
54
|
|
@@ -72,13 +76,7 @@ class Cb
|
|
72
76
|
|
73
77
|
view_name = controller_action_name.gsub(/#/, "/")
|
74
78
|
|
75
|
-
|
76
|
-
File.open(file_name)
|
77
|
-
rescue
|
78
|
-
puts "Please input correct controller and action name."
|
79
|
-
exit
|
80
|
-
end
|
81
|
-
|
79
|
+
|
82
80
|
|
83
81
|
self.view_helper(view_name)
|
84
82
|
|