flame 4.0.10 → 4.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flame/render.rb +17 -4
- data/lib/flame/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbccb14cbd979084bd968f1d33e5a5c14fd3cf85
|
4
|
+
data.tar.gz: 88da7f91e9123ba41ea353f2b67f7fc47893a55a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d0dfedd16b139980f3acaa814f0a5971c8da0da3e71970ba4647a5240ddeeafb010ef694b7ec9d40247d553e47920f23890c9dcc90a0154729e435d8bad3945
|
7
|
+
data.tar.gz: e225d6ba5881aae2fbb6884edc444f8afa6fdd6b9f7722058e8a0c82d5a69ef6390d396068fd3d4273dc63bf7f76e315e1bda92ba7f96be20258a9ca87f129ee
|
data/lib/flame/render.rb
CHANGED
@@ -71,12 +71,25 @@ module Flame
|
|
71
71
|
|
72
72
|
## Find possible directories for the controller
|
73
73
|
def controller_dirs
|
74
|
-
|
75
|
-
(part.split('_') - %w(
|
74
|
+
parts = @ctrl.class.underscore.split('/').map do |part|
|
75
|
+
(part.split('_') - %w(controller controllers ctrl)).join('_')
|
76
76
|
end
|
77
|
-
|
78
|
-
|
77
|
+
combine_parts(parts).map! { |path| path.join('/') }
|
78
|
+
end
|
79
|
+
|
80
|
+
## Make combinations in order with different sizes
|
81
|
+
## @example Make parts for ['project', 'namespace', 'controller']
|
82
|
+
## # => [
|
83
|
+
## ['project', 'namespace', 'controller'],
|
84
|
+
## ['project', 'namespace'],
|
85
|
+
## ['namespace', 'controller'],
|
86
|
+
## ['namespace']
|
87
|
+
## ]
|
88
|
+
def combine_parts(parts)
|
89
|
+
variants = parts.size.times.with_object([]) do |i, arr|
|
90
|
+
arr.push parts[i..-1], parts[0..-(i + 1)], parts[i..-(i + 1)]
|
79
91
|
end
|
92
|
+
variants.uniq!.reject!(&:empty?)
|
80
93
|
end
|
81
94
|
|
82
95
|
def layout_dirs
|
data/lib/flame/version.rb
CHANGED