modl 0.3.21 → 0.3.22

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: 84fb9b34002bed8fe52e89fe76f12c611a4c8d615ba8a4e5e11267c0b6deba99
4
- data.tar.gz: 05373b62d95ff9599775eb1bf8a2d8ac060ba3f61baf4569ea63de94bf4d2199
3
+ metadata.gz: 15424e85da367ff2ab9aaf7719c781891382d0b06e8f043b4c53a92da037aa7a
4
+ data.tar.gz: 68d4ccbd3516afd9b628aacdace4689f46706d2db151ef70b2725c3724a7cee0
5
5
  SHA512:
6
- metadata.gz: 94d50dfcd3ea5fa3b716aacc1dd39d2f6455c0d325d6b7cc0fb91d31952aafa48fd7c040451ffeb17248ffaff9337e2d3728881223a5916581c2b1529f529afb
7
- data.tar.gz: 4216880a6c17df8b73cfa9c7828da975518b1b5dfb7dac7c6b38e996338a6b987673c2e43a136ec4273ba68dad6651c14ce01e495888ab6ffa622819017d9a42
6
+ metadata.gz: 2026dcc8197b0ac9beb78555aaa2ed13817b7005a781a85fa7255b29042be14c92aa4aa455522ca67658aa92a86bd49f4e98f0b723359272b13a541dd53be496
7
+ data.tar.gz: 3df4f4c19bdc33b7453146c81802396c15fc90c3e9ebf073f4e8920bb128cf5e1cb7a10c50eaebf8be4631643c3ba73bcb34d031d87643e6806160b37ac2fcba
@@ -1,3 +1,7 @@
1
+ 0.3.22
2
+ ===
3
+ - Two bug fixes - quoted strings, and incomplete strings for certain output situations.
4
+
1
5
  0.3.21
2
6
  ===
3
7
  - Bugfix for `*assign` processing.
@@ -3123,6 +3123,42 @@
3123
3123
  "tested_features": [
3124
3124
  "class"
3125
3125
  ],
3126
- "minimised_modl": "*class(*id=v;*name=variants;*assign=[[variant*]]);*class(*id=variant;*assign=[[key1;key2;key3]]);v[[one;two;three];[four;five;six]]"
3126
+ "minimised_modl": "*class(*id=v;*name=variants;*assign=[[variant*]]);*class(*id=variant;*assign=[[key1;key2;key3]]);v[one:two:three]"
3127
+ },
3128
+ {
3129
+ "id": "328",
3130
+ "input": "*class(\n *id=i;\n *name=images\n);\n\n*class(\n *id=n;\n *name=name\n);\n\n*class(\n *id=t;\n *name=type\n);\n\n*class(\n *id=u;\n *name=url\n);\n\n*class(\n *id=m;\n *name=mime\n);\n\n*class(\n *id=w;\n *name=width\n);\n\n*class(\n *id=h;\n *name=height\n);\n\n*class(\n *id=v;\n *name=variants;\n *assign=[[variant*]]\n);\n\n*class(\n *id=variant;\n *assign=[[u;m;w;h]]\n);\n\n_U(\n ## Logo hosting URLs\n l=\"https://www.logos.uk/num/\"\n);\n\n_M(\n ## MIME types\n p=\"image/png\"\n);i[(t=logo;v[(u=`http://www.bupa.com/~/media/images/site-specific-images/corporate-images/content%20block%20images/dad-kissing-daughter.jpg`;m=image/jpeg;w=541;h=281)]);(t=logo;v[(u=`https://www.bupa.com/favicon.ico`;m=image/jpeg;w=16;h=16)])]",
3131
+ "expected_output": "{\n \"images\": [\n {\n \"type\": \"logo\",\n \"variants\": [\n {\n \"url\": \"http://www.bupa.com//media/images/site-specific-images/corporate-images/content%20block%20images/dad-kissing-daughter.jpg\",\n \"mime\": \"image/jpeg\",\n \"width\": 541,\n \"height\": 281\n }\n ]\n },\n {\n \"type\": \"logo\",\n \"variants\": [\n {\n \"url\": \"https://www.bupa.com/favicon.ico\",\n \"mime\": \"image/jpeg\",\n \"width\": 16,\n \"height\": 16\n }\n ]\n }\n ]\n}",
3132
+ "tested_features": [
3133
+ "class"
3134
+ ],
3135
+ "minimised_modl": "*class(*id=i;*name=images);*class(*id=n;*name=name);*class(*id=t;*name=type);*class(*id=u;*name=url);*class(*id=m;*name=mime);*class(*id=w;*name=width);*class(*id=h;*name=height);*class(*id=v;*name=variants;*assign=[[variant*]]);*class(*id=variant;*assign=[[u;m;w;h]]\n);\n\n_U(\n ## Logo hosting URLs\n l=\"https://www.logos.uk/num/\"\n);\n\n_M(\n ## MIME types\n p=\"image/png\"\n);i[(t=logo;v[(u=`http://www.bupa.com/~/media/images/site-specific-images/corporate-images/content%20block%20images/dad-kissing-daughter.jpg`;m=image/jpeg;w=541;h=281)]);(t=logo;v[(u=`https://www.bupa.com/favicon.ico`;m=image/jpeg;w=16;h=16)])]"
3136
+ },
3137
+ {
3138
+ "id": "329",
3139
+ "input": "*load=\"http://modules.num.uk/3/rcf.txt!\";_n=1;?=tesco.com;i(t=icon;v[%U.l%%0%.png:%M.p%:300:300])",
3140
+ "expected_output": "{\n \"images\": {\n \"type\": \"icon\",\n \"variants\": [\n {\n \"url\": \"https://www.logos.uk/num/tesco.com.png\",\n \"mime\": \"image/png\",\n \"width\": 300,\n \"height\": 300\n }\n ]\n }\n}",
3141
+ "tested_features": [
3142
+ "object_ref"
3143
+ ],
3144
+ "minimised_modl": "*load=\"http://modules.num.uk/3/rcf.txt!\";_n=1;?=tesco.com;i(t=icon;v[%U.l%%0%.png:%M.p%:300:300])"
3145
+ },
3146
+ {
3147
+ "id": "330",
3148
+ "input": "_u=[\"https://www.logos.uk/\"];\nl=%u.0%logo.png",
3149
+ "expected_output": "{\"l\": \"https://www.logos.uk/logo.png\"}",
3150
+ "tested_features": [
3151
+ "object_ref"
3152
+ ],
3153
+ "minimised_modl": "_u=[\"https://www.logos.uk/\"];l=%u.0%logo.png"
3154
+ },
3155
+ {
3156
+ "id": "331",
3157
+ "input": "_C=gb;_L=en;*load=\"http://modules.num.uk/1/rcf.txt!\";o(c[fb=abc;tw=abc])",
3158
+ "expected_output": "{\n \"organisation\": {\n \"contacts\": [\n {\n \"facebook\": {\n \"value\": \"abc\",\n \"object_type\": \"media\",\n \"object_display_name\": \"Facebook\",\n \"description_default\": \"View Facebook profile\",\n \"prefix\": \"https://www.facebook.com/\",\n \"media_type\": \"3p\",\n \"controller\": \"facebook.com\"\n }\n },\n {\n \"twitter\": {\n \"value\": \"abc\",\n \"object_type\": \"media\",\n \"object_display_name\": \"Twitter\",\n \"description_default\": \"View Twitter profile\",\n \"prefix\": \"https://www.twitter.com/\",\n \"media_type\": \"3p\",\n \"value_prefix\": \"@\",\n \"controller\": \"twitter.com\"\n }\n }\n ],\n \"object_type\": \"entity\",\n \"object_display_name\": \"Organisation\",\n \"description_default\": \"View Organisation\"\n }\n}",
3159
+ "tested_features": [
3160
+ "object_ref"
3161
+ ],
3162
+ "minimised_modl": "_C=gb;_L=en;*load=\"http://modules.num.uk/1/rcf.txt!\";o(c[fb=abc;tw=abc])"
3127
3163
  }
3128
3164
  ]
@@ -346,7 +346,7 @@ module MODL
346
346
 
347
347
  if keys.nil?
348
348
  if v.is_a?(Hash)
349
- new_value.merge v
349
+ new_value.merge! v
350
350
  elsif v.is_a?(Array) && v.length > 0
351
351
  v.each do |item|
352
352
  if item.is_a?(Hash)
@@ -360,6 +360,9 @@ module MODL
360
360
 
361
361
  process_nested_classes(global, new_value)
362
362
  clazz.merge_content(new_value)
363
+ elsif v.is_a? String
364
+ new_value[keys[0]] = v
365
+ new_value
363
366
  else
364
367
  keys.each_index do |i|
365
368
  tmp_value = {keys[i] => v[i]}
@@ -715,7 +715,7 @@ module MODL
715
715
  @text = @string.string
716
716
  elsif !ctx_quoted.nil?
717
717
  @constant = true
718
- @text = ctx_quoted.text
718
+ @text = Sutil.toptail ctx_quoted.text
719
719
  @quoted = ParsedQuoted.new(@text)
720
720
  elsif !ctx_null.nil?
721
721
  @nilVal = ParsedNull.instance
@@ -24,6 +24,6 @@
24
24
 
25
25
  module MODL
26
26
  module Parser
27
- VERSION = "0.3.21"
27
+ VERSION = "0.3.22"
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Walmsley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-17 00:00:00.000000000 Z
11
+ date: 2019-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake