quby-compiler 0.6.0 → 0.6.1

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: 9aa19b0ae3da964273f613a8705e3b63e699dc14fc9793f67e13b891f5e6f42f
4
- data.tar.gz: 8b2e41485f4d05711ea4098f1bbc23fdfe6e43fac6764047760434bbc04c41b3
3
+ metadata.gz: 204fe4926804a88d4ba8889a7dc644cf0e6e526f4f0535b066e78cc47fb1dee3
4
+ data.tar.gz: 0fc9f69f7305608de6b1349c3b283da728bea6037689c8d4272012ec56cc23e7
5
5
  SHA512:
6
- metadata.gz: 127e6a879195d5ee84994016e53e7dbb99cb5a188023df2156e708f1e7ca57464d589b7c49adbae203acefbd1ad2eaecf943fa069466d82209a624f477f611dd
7
- data.tar.gz: 5256bfbd80fa05c961cd7cfd0c59c78c35fa6b24fb3581534a7a10d926f58ab5432cdc674ee9ad9abd5262981657f6d164914229a2c28c0a6d836372fff5a08a
6
+ metadata.gz: 24e4d191808d82cd3185d7aa645579af39906b38d02c3bfef736a1d42b49c867086f9a7ac23c6275e7b8918655997edd7b1b1b5b5b3b6d91f47e2e9f89c984a6
7
+ data.tar.gz: 0f888b7293af6f9e5a7dc35fc935c8008af5c61682756a78c8e00fcfa07e19c7de0148ea85971f36b3879f29f5ea3a5a65f8033dcca1f448a0c0a9c0fb772cd4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.6.1
2
+
3
+ * Switch to oj for serializing, since JSON.serialize is dumb as ^%#$& (not serializing inner object)
4
+ * allow visibility_rule call within float questions, like integer.
5
+ * Remove empty outputs from Instance.compile.
6
+
1
7
  # 0.6.0
2
8
 
3
9
  * dsl:
@@ -10,6 +10,7 @@ module Quby
10
10
  include Units
11
11
  include Sizes
12
12
  include CompareVisibilityRule
13
+ include VisibilityRule
13
14
 
14
15
  def initialize(key, **options, &block)
15
16
  super
@@ -1,3 +1,5 @@
1
+ require "oj"
2
+
1
3
  module Quby
2
4
  module Compiler
3
5
  class Instance
@@ -37,7 +39,7 @@ module Quby
37
39
  roqua: Output.new(
38
40
  key: :roqua,
39
41
  filename: "roqua.json",
40
- content: JSON.pretty_generate(Outputs::RoquaSerializer.new(questionnaire).as_json),
42
+ content: Oj.dump(Outputs::RoquaSerializer.new(questionnaire).as_json, mode: :json, indent: 2),
41
43
  ),
42
44
  seeds: Output.new(
43
45
  key: :seeds,
@@ -47,19 +49,19 @@ module Quby
47
49
  quby_frontend_v1: Output.new(
48
50
  key: :quby_frontend_v1,
49
51
  filename: "quby-frontend-v1.json",
50
- content: JSON.pretty_generate(Outputs::QubyFrontendV1Serializer.new(questionnaire).as_json),
52
+ content: Oj.dump(Outputs::QubyFrontendV1Serializer.new(questionnaire).as_json, mode: :json, indent: 2),
51
53
  ),
52
54
  quby_frontend_v2: Output.new(
53
55
  key: :quby_frontend_v2,
54
56
  filename: "quby-frontend-v2.json",
55
- content: JSON.pretty_generate(Outputs::QubyFrontendV2Serializer.new(questionnaire, translations: all_translations).as_json),
57
+ content: Oj.dump(Outputs::QubyFrontendV2Serializer.new(questionnaire, translations: all_translations).as_json, mode: :json, indent: 2),
56
58
  ),
57
- locale: questionnaire.translatable? && Output.new(
59
+ locale: questionnaire.translatable?.presence && Output.new(
58
60
  key: :locale,
59
61
  filename: "#{LOCALE_FILE_PREFIX}#{questionnaire.language}.json",
60
- content: JSON.pretty_generate(original_locale),
62
+ content: Oj.dump(original_locale, mode: :json, indent: 2),
61
63
  ),
62
- },
64
+ }.compact
63
65
  }
64
66
  ensure
65
67
  # We can only close and remove the file once serializers have finished.
@@ -45,7 +45,7 @@ module Quby
45
45
  outcome_description: questionnaire.outcome_description,
46
46
  questions: questions,
47
47
  scores: scores,
48
- anonymous_conditions: questionnaire.anonymous_conditions,
48
+ anonymous_conditions: questionnaire.anonymous_conditions.as_json,
49
49
  flags: flags,
50
50
  textvars: textvars,
51
51
  license: questionnaire.license,
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
@@ -93,6 +93,20 @@ dependencies:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
95
  version: '1.8'
96
+ - !ruby/object:Gem::Dependency
97
+ name: oj
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
96
110
  - !ruby/object:Gem::Dependency
97
111
  name: redcarpet
98
112
  requirement: !ruby/object:Gem::Requirement