bookshop-array-structures 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bookshop-array-structures.rb +12 -1
- data/lib/bookshop-array-structures/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c4b7006d6acc1a01ccb184fb5d9122e03acc278d40a9194c5a51e5e53c39ad
|
4
|
+
data.tar.gz: aff6856e93b8c304e5003fad6b943148e24253ec2e30a566b4912c12f5150d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fb28bef8d8e90f581be164b8dec8fe3689b0801bad16fdad31b2b8cebc7a287d4c46edd48805928a3e6abd4d494016ae5f405dfb3119b1a9033232fb966797
|
7
|
+
data.tar.gz: ca588fddf15bc24e5814c259e36d89fc9b20beb86a2dd5b204f05d4535c444af710e5a30eca0507e9682c190705cc87f9fc6f95dc69bcaa52a12cf468e02f1c5
|
@@ -8,9 +8,20 @@ module Bookshop
|
|
8
8
|
return basename.split("-").map(&:capitalize).join(" ")
|
9
9
|
end
|
10
10
|
|
11
|
+
def self.get_component_type(path)
|
12
|
+
result = path.split(".").first;
|
13
|
+
pathParts = path.split(".").first.split("/")
|
14
|
+
if pathParts.length >= 2 && pathParts[pathParts.length-1] === pathParts[pathParts.length-2]
|
15
|
+
pathParts.pop
|
16
|
+
result = pathParts.join("/")
|
17
|
+
end
|
18
|
+
return result
|
19
|
+
end
|
20
|
+
|
21
|
+
|
11
22
|
def self.transform_component(path, component, site)
|
12
23
|
result = {}
|
13
|
-
result['_component_type'] = path
|
24
|
+
result['_component_type'] = get_component_type(path);
|
14
25
|
component.each_pair { |storyname, story|
|
15
26
|
story.each_pair {|key, value|
|
16
27
|
if result.has_key?(key) && storyname != "defaults"
|