quby-compiler 0.4.12 → 0.4.13

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: a9f80c06ecab5163ba31ba68e5548ec4e53211b4d327d738b07947578409afed
4
- data.tar.gz: a56fa925a142ec55eb909e33257c3f399d8990c79ace266e6ebc7687cefb49cc
3
+ metadata.gz: f13fa5a2d4c4da7b41e4a32905226d0523709bac245a9d7cba3d28fd927d2b6a
4
+ data.tar.gz: 4e8f0dfab2c05e6166176f5ddb951e5f4e51962b9902e75ea3e8561e9cda3392
5
5
  SHA512:
6
- metadata.gz: 3aa823181f25722654444f7ad79e8922b59f6cb93463e12e61abef7ead8a391695156fcb4cb8f4551ad115b6a710ab2e5d81138575d7fce05d442db1e86dd809
7
- data.tar.gz: 89376384e57965c290e667984fd98605668ef2a832a87d78215e6c0435379bd6ce4b4cf994091bcc9975554fb05e7ed3f6bfbf4beab6af13115fb3489cd87a94
6
+ metadata.gz: fb6313ab623e76109aa94871bb192da9c95bbaa5809472b29bc88c2f7b61ebcb18b03b7433fe162209c33a1113aa7f359722c8927196d0d9b7ebf022e457e5b4
7
+ data.tar.gz: 3b3c6aeb7d590570defc880d3b1743ff64c1cb4c6227da2bb779c93057a7c1c249563f0e2366a1e6e13b6760fa90c010f66b57757159b24e0073af71403b6098
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.4.13
2
+
3
+ * quby2.json:
4
+ * string-questions: Don't pass a size of 30, when no size had been specified
5
+ * rename date type to date_parts, switch to use `date_parts: [{part: year, key: 'yyyy'}, ..]`
6
+
1
7
  # 0.4.12
2
8
 
3
9
  * roqua.json: Add questionnaire license
@@ -24,7 +24,8 @@ module Quby
24
24
  def initialize(key, options = {})
25
25
  super
26
26
 
27
- @components = options[:components] || DEFAULT_COMPONENTS
27
+ # only possible order we support.
28
+ @components = options[:components] ? POSSIBLE_COMPONENTS & options[:components] : DEFAULT_COMPONENTS
28
29
  @required_components = options[:required_components] || @components
29
30
  @optional_components = @components - @required_components
30
31
 
@@ -39,7 +40,8 @@ module Quby
39
40
  def add_date_validation(explanation)
40
41
  @validations << {type: :valid_date,
41
42
  subtype: :"valid_date_#{components.sort.join('_')}",
42
- explanation: explanation}
43
+ explanation: explanation,
44
+ requiredParts: required_components}
43
45
  end
44
46
 
45
47
  def claimed_keys
@@ -60,10 +62,16 @@ module Quby
60
62
  end
61
63
 
62
64
  def as_json(options = {})
63
- component_keys = components.each_with_object({}) do |component, hash|
64
- hash["#{component}Key"] = send("#{component}_key")
65
- end
66
- super.merge(components: components).merge(component_keys)
65
+ super.merge(
66
+ type: 'date_parts',
67
+ as: 'date_parts',
68
+ dateParts: components.map { |component|
69
+ {
70
+ part: component,
71
+ key: send("#{component}_key")
72
+ }
73
+ }
74
+ )
67
75
  end
68
76
  end
69
77
  end
@@ -6,7 +6,7 @@ module Quby
6
6
  module Questions
7
7
  class StringQuestion < Question
8
8
  def as_json(options = {})
9
- super.merge(autocomplete: @autocomplete, size: @size || 30)
9
+ super.merge(autocomplete: @autocomplete, size: @size)
10
10
  end
11
11
  end
12
12
  end
@@ -6,7 +6,7 @@ module Quby
6
6
  module Questions
7
7
  class TextQuestion < Question
8
8
  def as_json(options = {})
9
- super.merge(autocomplete: @autocomplete, lines: lines, cols: cols)
9
+ super.merge(autocomplete: @autocomplete, lines: lines)
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.4.12"
3
+ VERSION = "0.4.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  - !ruby/object:Gem::Version
260
260
  version: '0'
261
261
  requirements: []
262
- rubygems_version: 3.1.4
262
+ rubygems_version: 3.3.22
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: Quby::Compiler compiles a DSL for questionnaires to JSON