bookshop-array-structures 2.0.0.pre.alpha.10 → 2.0.0.pre.alpha.15

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: 8bdfa2472fe2135938ef5d3c819411412c46f1b5c30cc224ae1f388442a28e3a
4
- data.tar.gz: 0140b5a55a4684fe41e00e448fafafee6e2c61d569d881fe82e73870b3bad1e8
3
+ metadata.gz: bace748fda301cb3e66748d9409cf2aa8e40e4e8cc2af43bef0d822c28346520
4
+ data.tar.gz: 7debdea47455c136a495e67770f6c185c2ad5bc2aaf1f7a770b10c57f107aed1
5
5
  SHA512:
6
- metadata.gz: 583bd805506bf76b676efa8f456799a51d487454af3374f6d8dc4678af9abf2063ba623b7dc34b4ab722ec926abb6fae86ad78a13fddeae94d8ae4359062c741
7
- data.tar.gz: 9b0d91988ba19200cc686cb5fc3a9f1bbc781dca017bca5ab1e179f5c51048c25a457e1ca97ccef93692c90edca92b66460633ea9f23ce294562811d1722072f
6
+ metadata.gz: f99fce9ad1030399ed5bd1403e201bdc65b92c77be7bc6b634ffca83c9d4b0e94cd4b4c17ab42afcc6102ee7dc1e2dc61a784a18bced89ca2e8900c60475b189
7
+ data.tar.gz: 969c6ad1417dc99853296c0706e6be47033beb2d016050fbf6fd756e90888947cfa60a97b3bfb4967798602cf537371225fd4d6333ae35030c2de5302483feb5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bookshop-array-structures (2.0.0.pre.alpha.9)
4
+ bookshop-array-structures (2.0.0.pre.alpha.14)
5
5
  dry-inflector (>= 0.1, < 1.0)
6
6
  jekyll (>= 3.7, < 5.0)
7
7
  toml-rb (>= 2.0, < 3.0)
@@ -22,7 +22,7 @@ GEM
22
22
  eventmachine (>= 0.12.9)
23
23
  http_parser.rb (~> 0.6.0)
24
24
  eventmachine (1.2.7)
25
- ffi (1.15.1)
25
+ ffi (1.15.3)
26
26
  forwardable-extended (2.6.0)
27
27
  hashdiff (1.0.1)
28
28
  http_parser.rb (0.6.0)
@@ -37,24 +37,24 @@ module Bookshop
37
37
 
38
38
  if value.is_a? Hash
39
39
  comment = value["--bookshop_comment"] ||
40
- value["default--bookshop_comment"] ||
41
- value["select--bookshop_comment"] ||
42
- value["preview--bookshop_comment"]
40
+ value["select--bookshop_comment"] ||
41
+ value["preview--bookshop_comment"] ||
42
+ value["default--bookshop_comment"]
43
43
  if comment
44
44
  structure["_comments"][key] = comment
45
45
  end
46
- unless value["default"].nil?
47
- value_context[key] = value["default"]
48
- next
49
- end
50
46
  if value["select"]
51
- value_context[key] = nil
47
+ value_context[key] = value["default"]
52
48
  plural_key = inflector.pluralize(key)
53
49
  structure["_select_data"][plural_key] = value["select"]
54
50
  next
55
51
  end
56
52
  if value["preview"]
57
- value_context[key] = nil
53
+ value_context[key] = value["default"]
54
+ next
55
+ end
56
+ unless value["default"].nil?
57
+ value_context[key] = value["default"]
58
58
  next
59
59
  end
60
60
  value_context[key] ||= {}
@@ -180,10 +180,12 @@ module Bookshop
180
180
  end
181
181
 
182
182
  def self.transform_template_component(result)
183
+ base_template_hash = {"pre.__template_code" => ""}
184
+ base_comment_hash = {"pre.__template_code" => "Helper liquid to run before the feilds below. Assigns and captures will be available"}
183
185
  schema_result = Marshal.load(Marshal.dump(result))
184
186
  unwrap_structure_template(schema_result, "site")
185
- schema_result["value"] = templatize_values(schema_result["value"])
186
- schema_result["_comments"] = templatize_comments(schema_result["_comments"])
187
+ schema_result["value"] = base_template_hash.merge! templatize_values(schema_result["value"])
188
+ schema_result["_comments"] = base_comment_hash.merge! templatize_comments(schema_result["_comments"])
187
189
  schema_result["value"]["_bookshop_name"] = "#{schema_result["value"]["_bookshop_name"]}.__template"
188
190
  schema_result["label"] = "Templated #{schema_result["label"]}"
189
191
  schema_result["_array_structures"] = {}
@@ -1,5 +1,5 @@
1
1
  module Bookshop
2
2
  module Arraystructures
3
- VERSION = "2.0.0.pre.alpha.10"
3
+ VERSION = "2.0.0.pre.alpha.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookshop-array-structures
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.10
4
+ version: 2.0.0.pre.alpha.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-13 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll