quby-compiler 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +18 -18
- data/exe/quby-compile +2 -3
- data/lib/quby/compiler/entities/questions/float_question.rb +9 -0
- data/lib/quby/compiler/entities/questions/integer_question.rb +9 -0
- data/lib/quby/compiler/instance.rb +1 -1
- data/lib/quby/compiler/services/definition_validator.rb +7 -3
- data/lib/quby/compiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a1a654ea10bed63b7487aaaa16c663efdd89d3a034e52574ea0f05aa08c3845
|
4
|
+
data.tar.gz: 2e6adaba2286e5400de5bebd944fceb3c71b62d32fea9abd9462cc98a9000084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17b23528f435db0eee2157915f3540b4bce2e1cd23adc1247a019a18740588d15ca3d93ce78612f57d0213f54d3156aaa222f8b997f8c7ff4dc9c616dbd89ca9
|
7
|
+
data.tar.gz: 381bc8a3debabde57309e9ae19ba4a46bf1ed7e91a9975314a12bb8784e46ca44c1538c1c6970ae2b142b67b66a00e970f241f91b4c8130c87286fa497a9f8f6
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
# 0.3.4
|
2
|
+
|
3
|
+
* Added preliminary support for sliders to the v2 output.
|
4
|
+
|
1
5
|
# 0.3.3
|
2
6
|
|
3
|
-
Replace `options={}` with `**options` in the builders to prevent prepare for ruby 3.0
|
7
|
+
* Replace `options={}` with `**options` in the builders to prevent prepare for ruby 3.0
|
4
8
|
|
5
9
|
# 0.3.2
|
6
10
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
quby-compiler (0.3.
|
4
|
+
quby-compiler (0.3.4)
|
5
5
|
actionview (>= 5.0)
|
6
6
|
activemodel (>= 5.0)
|
7
7
|
activesupport (>= 5.0)
|
@@ -15,20 +15,20 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
-
actionview (6.0.
|
19
|
-
activesupport (= 6.0.
|
18
|
+
actionview (6.0.4)
|
19
|
+
activesupport (= 6.0.4)
|
20
20
|
builder (~> 3.1)
|
21
21
|
erubi (~> 1.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
23
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
24
|
active_interaction (3.8.3)
|
25
25
|
activemodel (>= 4, < 7)
|
26
|
-
activemodel (6.0.
|
27
|
-
activesupport (= 6.0.
|
28
|
-
activerecord (6.0.
|
29
|
-
activemodel (= 6.0.
|
30
|
-
activesupport (= 6.0.
|
31
|
-
activesupport (6.0.
|
26
|
+
activemodel (6.0.4)
|
27
|
+
activesupport (= 6.0.4)
|
28
|
+
activerecord (6.0.4)
|
29
|
+
activemodel (= 6.0.4)
|
30
|
+
activesupport (= 6.0.4)
|
31
|
+
activesupport (6.0.4)
|
32
32
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
33
33
|
i18n (>= 0.7, < 2)
|
34
34
|
minitest (~> 5.1)
|
@@ -38,10 +38,10 @@ GEM
|
|
38
38
|
rack
|
39
39
|
builder (3.2.4)
|
40
40
|
coderay (1.1.3)
|
41
|
-
concurrent-ruby (1.1.
|
41
|
+
concurrent-ruby (1.1.9)
|
42
42
|
crass (1.0.6)
|
43
43
|
diff-lcs (1.4.4)
|
44
|
-
dry-configurable (0.12.
|
44
|
+
dry-configurable (0.12.1)
|
45
45
|
concurrent-ruby (~> 1.0)
|
46
46
|
dry-core (~> 0.5, >= 0.5.0)
|
47
47
|
dry-container (0.7.2)
|
@@ -57,27 +57,27 @@ GEM
|
|
57
57
|
dry-core (~> 0.5, >= 0.5)
|
58
58
|
dry-types (~> 1.5)
|
59
59
|
ice_nine (~> 0.11)
|
60
|
-
dry-types (1.5.
|
60
|
+
dry-types (1.5.1)
|
61
61
|
concurrent-ruby (~> 1.0)
|
62
62
|
dry-container (~> 0.3)
|
63
63
|
dry-core (~> 0.5, >= 0.5)
|
64
64
|
dry-inflector (~> 0.1, >= 0.1.2)
|
65
65
|
dry-logic (~> 1.0, >= 1.0.2)
|
66
66
|
erubi (1.10.0)
|
67
|
-
i18n (1.8.
|
67
|
+
i18n (1.8.10)
|
68
68
|
concurrent-ruby (~> 1.0)
|
69
69
|
ice_nine (0.11.2)
|
70
|
-
loofah (2.
|
70
|
+
loofah (2.10.0)
|
71
71
|
crass (~> 1.0.2)
|
72
72
|
nokogiri (>= 1.5.9)
|
73
73
|
method_source (1.0.0)
|
74
|
-
mini_portile2 (2.5.
|
74
|
+
mini_portile2 (2.5.3)
|
75
75
|
minitest (5.14.4)
|
76
76
|
naught (1.1.0)
|
77
|
-
nokogiri (1.11.
|
77
|
+
nokogiri (1.11.7)
|
78
78
|
mini_portile2 (~> 2.5.0)
|
79
79
|
racc (~> 1.4)
|
80
|
-
nokogumbo (2.0.
|
80
|
+
nokogumbo (2.0.5)
|
81
81
|
nokogiri (~> 1.8, >= 1.8.4)
|
82
82
|
pry (0.13.1)
|
83
83
|
coderay (~> 1.1)
|
@@ -90,7 +90,7 @@ GEM
|
|
90
90
|
rails-html-sanitizer (1.3.0)
|
91
91
|
loofah (~> 2.3)
|
92
92
|
rake (12.3.3)
|
93
|
-
redcarpet (3.5.
|
93
|
+
redcarpet (3.5.1)
|
94
94
|
roqua-support (0.3.5)
|
95
95
|
active_interaction (~> 3.0)
|
96
96
|
activesupport (>= 5.1, < 6.1)
|
data/exe/quby-compile
CHANGED
@@ -21,7 +21,7 @@ OptionParser.new do |opts|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
opts.on("--seeds=INPUT") do |value|
|
24
|
-
|
24
|
+
puts '--seeds is a deprecated option, questionnaire definitions should use seed_patches to conserve seed tweaks'
|
25
25
|
end
|
26
26
|
end.parse!
|
27
27
|
|
@@ -38,7 +38,7 @@ lookup_tables = Quby::Compiler::Entities::LookupTables.new(lookup_tables_path)
|
|
38
38
|
paths.each do |path|
|
39
39
|
puts "Compiling #{path}"
|
40
40
|
|
41
|
-
key = File.basename(
|
41
|
+
key = File.basename(File.dirname(path))
|
42
42
|
sourcecode = File.read(path)
|
43
43
|
last_update = File.mtime(path)
|
44
44
|
seed_path = File.join(seeds_path, "#{key}.yml")
|
@@ -46,7 +46,6 @@ paths.each do |path|
|
|
46
46
|
compiled = Quby::Compiler.compile(key, sourcecode, path: path, seeds: seeds, lookup_tables: lookup_tables, last_update: last_update)
|
47
47
|
|
48
48
|
FileUtils.mkdir_p(File.join(output_path, key))
|
49
|
-
|
50
49
|
compiled[:outputs].each do |type, output|
|
51
50
|
next unless output
|
52
51
|
File.open(File.join(output_path, key, output.filename), 'w') do |file|
|
@@ -5,6 +5,15 @@ module Quby
|
|
5
5
|
module Entities
|
6
6
|
module Questions
|
7
7
|
class FloatQuestion < Question
|
8
|
+
def as_json(options = {})
|
9
|
+
super.merge(
|
10
|
+
minimum: minimum,
|
11
|
+
maximum: maximum,
|
12
|
+
step: 0.01, # fixed in v1.
|
13
|
+
# defaultPosition: default_position # Needs discussion, can be number or string "hidden"
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
8
17
|
def size
|
9
18
|
@size || 30
|
10
19
|
end
|
@@ -5,6 +5,15 @@ module Quby
|
|
5
5
|
module Entities
|
6
6
|
module Questions
|
7
7
|
class IntegerQuestion < Question
|
8
|
+
def as_json(options = {})
|
9
|
+
super.merge(
|
10
|
+
minimum: minimum,
|
11
|
+
maximum: maximum,
|
12
|
+
step: 1, # fixed in v1.
|
13
|
+
# defaultPosition: default_position # Needs discussion, can be number or string "hidden"
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
8
17
|
def size
|
9
18
|
@size || 30
|
10
19
|
end
|
@@ -11,7 +11,7 @@ module Quby
|
|
11
11
|
if block # defined in block for tests
|
12
12
|
questionnaire = DSL.build(key, path: path, &block)
|
13
13
|
else # sourcecode given as string
|
14
|
-
tempfile = Tempfile.new(key)
|
14
|
+
tempfile = Tempfile.new([key, '.rb'])
|
15
15
|
questionnaire = Entities::Questionnaire.new(key, last_update: last_update)
|
16
16
|
Thread.current["quby-questionnaire-loading"] = Quby::Compiler::DSL::QuestionnaireBuilder.new(questionnaire, lookup_tables: lookup_tables)
|
17
17
|
|
@@ -25,7 +25,6 @@ module Quby
|
|
25
25
|
validate_outcome_tables(questionnaire)
|
26
26
|
validate_markdown_fields(questionnaire) if questionnaire.validate_html
|
27
27
|
validate_raw_content_items(questionnaire) if questionnaire.validate_html
|
28
|
-
validate_scores(questionnaire)
|
29
28
|
# Some compilation errors are Exceptions (pure syntax errors) and some StandardErrors (NameErrors)
|
30
29
|
rescue Exception => exception # rubocop:disable Lint/RescueException
|
31
30
|
definition.errors.add(:sourcecode, {message: "Questionnaire error: #{definition.key}\n" \
|
@@ -81,6 +80,13 @@ module Quby
|
|
81
80
|
fail "Score #{score.key} does not have a score schema" unless score_schema
|
82
81
|
fail "Score label langer dan 100 tekens (geeft problemen oru accare)\n #{score_schema.label}" if score_schema.label&.length > 100
|
83
82
|
end
|
83
|
+
|
84
|
+
export_keys = questionnaire.score_schemas.flat_map { |_key, score_schema|
|
85
|
+
score_schema.subscore_schemas.map(&:export_key)
|
86
|
+
}
|
87
|
+
|
88
|
+
duplicate_export_keys = export_keys.tally.select { |key, count| count > 1 }.keys
|
89
|
+
fail "Score export keys not unique, duplicates: #{duplicate_export_keys}" if duplicate_export_keys.present?
|
84
90
|
end
|
85
91
|
|
86
92
|
def validate_question_options(questionnaire, question)
|
@@ -241,8 +247,6 @@ scores_schema tables to the resulting seed."
|
|
241
247
|
|
242
248
|
def validate_score_label_present(score)
|
243
249
|
fail "Score #{score.key} label must be passed in as an option." unless score.label.present?
|
244
|
-
|
245
|
-
|
246
250
|
end
|
247
251
|
|
248
252
|
def validate_subquestion_absence_in_select(question)
|
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.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|