quby-compiler 0.5.37 → 0.5.38

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: f99d7e4e00d6ab08172da731229ed790720f8131ca55a9919a8d6f4823da1bbe
4
- data.tar.gz: a7855f35d16daded7a21e60564322576b7ea8f967052e72d8d4f8eb194b53f04
3
+ metadata.gz: 9f717b87f1eeac5b54e6230cc80880a40b46596790536a513a3802d050e25ab6
4
+ data.tar.gz: e28bf580f65ab625b51d8448f5a49f03169694a0864e7d3d888cef7d7d83f3f3
5
5
  SHA512:
6
- metadata.gz: 4c0260b251395ef6fcf757ecc1ddaf120139716c6f0ae27a77450dea9719d76f103891b060b74146aee408d68febffd398436ce613d3c8031215e6f6b01035d6
7
- data.tar.gz: e20c44b3fba04514aa601e52c9b7321e185bbea66d9e12e112efdd20023b91bfc52f30de3f4ebf0959426eb4aa351499abe2b7b4b5e5ac5ea2b6b04b5e4f5544
6
+ metadata.gz: 0ee40da6cd79071369b6b183ef357b915a03a6f7755a92e06ee61167c7a39863086656b61e715e03e68db0d856d4fbf76b394801ae488c5673750aa7ac57cd2e
7
+ data.tar.gz: be3c0096361e0713738fdbbd3e2d497c9788a0dfe72df83298e189caa811ca55707d57f78bc32c7acb6ae42c7f4e9b3f646865e675b86a2c60a458d865c41528
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.5.38
2
+
3
+ * Fail when using unsupported features in layout_version :v2
4
+ * Allow context_description to set via question options, so custom_methods don't have to specifically mention it.
5
+
1
6
  # 0.5.37
2
7
 
3
8
  * added support for indenting questions
@@ -152,6 +152,7 @@ module Quby
152
152
  @context_free_title = options[:context_free_title]
153
153
  @allow_blank_titles = options[:allow_blank_titles]
154
154
  @description = options[:description]
155
+ @context_description = options[:context_description]
155
156
  @display_modes = options[:display_modes]
156
157
  @presentation = options[:presentation]
157
158
  @validations = []
@@ -30,6 +30,7 @@ module Quby
30
30
  validate_info_blocks(questionnaire)
31
31
  validate_checkbox_options(questionnaire)
32
32
  validate_visiblity_rules(questionnaire)
33
+ validate_quby2_unsupported_features(questionnaire)
33
34
  # Some compilation errors are Exceptions (pure syntax errors) and some StandardErrors (NameErrors)
34
35
  rescue Exception => exception # rubocop:disable Lint/RescueException
35
36
  definition.errors.add(:sourcecode, message: "Questionnaire error: #{definition.key}\n" \
@@ -436,6 +437,29 @@ scores_schema tables to the resulting seed."
436
437
  end
437
438
  end
438
439
  end
440
+
441
+ def validate_quby2_unsupported_features(questionnaire)
442
+ return unless questionnaire.layout_version == :v2
443
+
444
+ if questionnaire.extra_css.present?
445
+ fail "'extra_css' unsupported for Quby 2 layout."
446
+ end
447
+ questionnaire.questions.each do |question|
448
+ if question.title_question
449
+ fail "Question #{question.key} uses unsupported feature 'title_question' for Quby 2 layout."
450
+ end
451
+ if question.display_modes.present?
452
+ fail "Question #{question.key} uses unsupported feature 'display_modes' for Quby 2 layout."
453
+ end
454
+ end
455
+ questionnaire.panels.each do |panel|
456
+ panel.items.each do |item|
457
+ if item.is_a?(Entities::Table)
458
+ fail "Questionnaire uses unsupported feature 'table' for Quby 2 layout."
459
+ end
460
+ end
461
+ end
462
+ end
439
463
  end
440
464
  end
441
465
  end
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.5.37"
3
+ VERSION = "0.5.38"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.37
4
+ version: 0.5.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-16 00:00:00.000000000 Z
10
+ date: 2025-10-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel
@@ -151,7 +151,6 @@ files:
151
151
  - lib/quby/compiler/dsl/charting/radar_chart_builder.rb
152
152
  - lib/quby/compiler/dsl/helpers.rb
153
153
  - lib/quby/compiler/dsl/info_block_builder.rb
154
- - lib/quby/compiler/dsl/merge(values(:v_1, :v_2), values(v_4).rb
155
154
  - lib/quby/compiler/dsl/panel_builder.rb
156
155
  - lib/quby/compiler/dsl/question_builder.rb
157
156
  - lib/quby/compiler/dsl/questionnaire_builder.rb
@@ -1,16 +0,0 @@
1
- merge(values(:v_1, :v_2), values(v_4).recode(1 => 3)).sum
2
-
3
-
4
-
5
- divide(value(:v_2), multiply(value(:v_1), value(:v_1)))
6
-
7
- w / l * l
8
-
9
-
10
- sexp_variable :key1 do
11
- foo = values(:v_1, :v_2)
12
- bar = recode(foo, 1 => 3)
13
- bla = merge(foo, bar)
14
- sum(bla)
15
-
16
- end