bookshop-array-structures 1.4.5 → 1.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9c01f665a4a513af227820d73178c650ada11a5083c4d2c6870dd7f601bae0b
4
- data.tar.gz: d2962ed392eed80038c4be7bdf3e391d185cc992cc33913276eea71f82827544
3
+ metadata.gz: a9c4b7006d6acc1a01ccb184fb5d9122e03acc278d40a9194c5a51e5e53c39ad
4
+ data.tar.gz: aff6856e93b8c304e5003fad6b943148e24253ec2e30a566b4912c12f5150d52
5
5
  SHA512:
6
- metadata.gz: 4542176f7a9b5df942c7c492a1c0ab8bb5f8f5b14bdcd484fe66ce6c4bc9e360fa8d25b610533540073e087fdf722a9e31b18c4e57d4f1da3d6ea5e541e248ba
7
- data.tar.gz: 652a9618a21a82dbfe11f9ddfc1dfbb5fcc66dea3b5a6a6db174b621ffd81e9f3b80241b9b4e4762383dc597b0ab042b4e6cd52cc7f86b0462b10110ead032e8
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.split(".").first;
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"
@@ -1,5 +1,5 @@
1
1
  module Bookshop
2
2
  module Arraystructures
3
- VERSION = "1.4.5"
3
+ VERSION = "1.4.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookshop-array-structures
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tate