quby-compiler 0.4.12 → 0.4.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f13fa5a2d4c4da7b41e4a32905226d0523709bac245a9d7cba3d28fd927d2b6a
|
4
|
+
data.tar.gz: 4e8f0dfab2c05e6166176f5ddb951e5f4e51962b9902e75ea3e8561e9cda3392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb6313ab623e76109aa94871bb192da9c95bbaa5809472b29bc88c2f7b61ebcb18b03b7433fe162209c33a1113aa7f359722c8927196d0d9b7ebf022e457e5b4
|
7
|
+
data.tar.gz: 3b3c6aeb7d590570defc880d3b1743ff64c1cb4c6227da2bb779c93057a7c1c249563f0e2366a1e6e13b6760fa90c010f66b57757159b24e0073af71403b6098
|
data/CHANGELOG.md
CHANGED
@@ -24,7 +24,8 @@ module Quby
|
|
24
24
|
def initialize(key, options = {})
|
25
25
|
super
|
26
26
|
|
27
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
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.
|
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-
|
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.
|
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
|