bookshop-array-structures 2.0.0.pre.alpha.11 → 2.0.0.pre.alpha.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc64af97dba6b97d2887320793f66249a7b17754eb3f21e3007857232bba53a9
4
- data.tar.gz: ac861a05afe512c38ecf28f45e8da9262ef433683b9b12f59274c503d1a869e9
3
+ metadata.gz: e6cb4c0d960445187f93c08e80d5adead49aedd9414dd5bd9ecdda305f089622
4
+ data.tar.gz: 8fb3f57ab0a39b2884527750d6b643658eba5842d275e72d03bb49abf4a282d3
5
5
  SHA512:
6
- metadata.gz: '0957f4491873f58ac95b6569ed762939ccae6cbeeecb3cbf6fb7d4a2f1b5c34ef00207a189411f7666ead8a0e8bc81a524bdd0af1a2ca43a13778cefddca3450'
7
- data.tar.gz: 4f959f0b3e6dfd264745fa5a55f355311e1e31857b469c0e894ee4cea76e17588e51451dd598ae79bbee62a3251dffd2372a923145357b7215d9e74403033a97
6
+ metadata.gz: 475e8001c38b71d60c349a3a81f31039b6e1a4d1f13c5560ef392051a2b3281c31fb80f462a9c0f9a449297b80024150bc8063928f7e9010e1d0f2600c9105db
7
+ data.tar.gz: 229e832ecb9f52f39bc14dbb4a5bdbfaf982df51d8ef3ee42d54496cf9d6d5f601141ce8fbd4dd2246cbc9bf2e6522184ebca7f4f1f7aaa314a0d812145eda4b
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)
@@ -71,7 +71,7 @@ GEM
71
71
  public_suffix (4.0.6)
72
72
  rainbow (2.2.2)
73
73
  rake
74
- rake (10.5.0)
74
+ rake (12.3.3)
75
75
  rb-fsevent (0.11.0)
76
76
  rb-inotify (0.10.1)
77
77
  ffi (~> 1.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.11"
3
+ VERSION = "2.0.0.pre.alpha.16"
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.11
4
+ version: 2.0.0.pre.alpha.16
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-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll