quby-compiler 0.2.1 → 0.3.1

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: d38f705b91a2ad37a0babd91c08834ed37c0a0a0bfa60a3e07bebfba06c44cef
4
- data.tar.gz: e98e8f2c06f6a0bd17fef8ee7f631cd0dae29f059266ac84a39e6b56175b886c
3
+ metadata.gz: 4d882604750c6b9e14ef80ebf8251f0cd921b7f9e7db31b843b1c279676904c4
4
+ data.tar.gz: db31a32e46f675814f9ea97d00b0c8b35a45d60b895834c0aeaf0eec58c4ae57
5
5
  SHA512:
6
- metadata.gz: c8b98bea5143a6eca8b122b3b852944e07a29ce2783e6c7380f54b404c78749f4e68716f059217e765da199cf1387f1076dd1d4b1ed445b8cf934a6fbd6f1be5
7
- data.tar.gz: 4c3590905fed76601f80c32d8646bc67c12290a89286886c652f37c6999e7d1dd1abc2540d35f06a015b075e8097d72e1e635a5cad4da30f985d705e29c345ab
6
+ metadata.gz: 816477fed5ba4f5e9c1c36a0766e9e832bb8c9a37ab22e8547f8980937e98b915188a51e5154cde2c88cb0af578fb16d42d0709133c6e1b1622054cb2415e5ae
7
+ data.tar.gz: 97cf01e8fd73955ce8f51e399db8017705a69785f7e48c2f4dc6c40652f17d9638b17542725803442d1c6ca567d7c79bbc49e72d2df7f60cd9481e9aa0ac11c2
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 0.3.1
2
+
3
+ * Slashes after numbers are now removed from question titles when making RoQua seeds (quests attribute).
4
+
5
+ # 0.3.0
6
+
7
+ * [Backward Incompatible]: flag.depends_on is now an array.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quby-compiler (0.1.1)
4
+ quby-compiler (0.3.1)
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.3.4)
19
- activesupport (= 6.0.3.4)
18
+ actionview (6.0.3.5)
19
+ activesupport (= 6.0.3.5)
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.3.4)
27
- activesupport (= 6.0.3.4)
28
- activerecord (6.0.3.4)
29
- activemodel (= 6.0.3.4)
30
- activesupport (= 6.0.3.4)
31
- activesupport (6.0.3.4)
26
+ activemodel (6.0.3.5)
27
+ activesupport (= 6.0.3.5)
28
+ activerecord (6.0.3.5)
29
+ activemodel (= 6.0.3.5)
30
+ activesupport (= 6.0.3.5)
31
+ activesupport (6.0.3.5)
32
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
33
  i18n (>= 0.7, < 2)
34
34
  minitest (~> 5.1)
@@ -38,54 +38,51 @@ GEM
38
38
  rack
39
39
  builder (3.2.4)
40
40
  coderay (1.1.3)
41
- concurrent-ruby (1.1.7)
41
+ concurrent-ruby (1.1.8)
42
42
  crass (1.0.6)
43
43
  diff-lcs (1.4.4)
44
- dry-configurable (0.11.6)
44
+ dry-configurable (0.12.1)
45
45
  concurrent-ruby (~> 1.0)
46
- dry-core (~> 0.4, >= 0.4.7)
47
- dry-equalizer (~> 0.2)
46
+ dry-core (~> 0.5, >= 0.5.0)
48
47
  dry-container (0.7.2)
49
48
  concurrent-ruby (~> 1.0)
50
49
  dry-configurable (~> 0.1, >= 0.1.3)
51
- dry-core (0.4.9)
50
+ dry-core (0.5.0)
52
51
  concurrent-ruby (~> 1.0)
53
- dry-equalizer (0.3.0)
54
52
  dry-inflector (0.2.0)
55
- dry-logic (1.0.7)
53
+ dry-logic (1.1.0)
56
54
  concurrent-ruby (~> 1.0)
57
- dry-core (~> 0.2)
58
- dry-equalizer (~> 0.2)
59
- dry-struct (1.3.0)
60
- dry-core (~> 0.4, >= 0.4.4)
61
- dry-equalizer (~> 0.3)
62
- dry-types (~> 1.3)
55
+ dry-core (~> 0.5, >= 0.5)
56
+ dry-struct (1.4.0)
57
+ dry-core (~> 0.5, >= 0.5)
58
+ dry-types (~> 1.5)
63
59
  ice_nine (~> 0.11)
64
- dry-types (1.4.0)
60
+ dry-types (1.5.1)
65
61
  concurrent-ruby (~> 1.0)
66
62
  dry-container (~> 0.3)
67
- dry-core (~> 0.4, >= 0.4.4)
68
- dry-equalizer (~> 0.3)
63
+ dry-core (~> 0.5, >= 0.5)
69
64
  dry-inflector (~> 0.1, >= 0.1.2)
70
65
  dry-logic (~> 1.0, >= 1.0.2)
71
- erubi (1.9.0)
72
- i18n (1.8.5)
66
+ erubi (1.10.0)
67
+ i18n (1.8.9)
73
68
  concurrent-ruby (~> 1.0)
74
69
  ice_nine (0.11.2)
75
- loofah (2.7.0)
70
+ loofah (2.9.0)
76
71
  crass (~> 1.0.2)
77
72
  nokogiri (>= 1.5.9)
78
73
  method_source (1.0.0)
79
- mini_portile2 (2.4.0)
80
- minitest (5.14.2)
74
+ mini_portile2 (2.5.0)
75
+ minitest (5.14.4)
81
76
  naught (1.1.0)
82
- nokogiri (1.10.10)
83
- mini_portile2 (~> 2.4.0)
84
- nokogumbo (2.0.2)
77
+ nokogiri (1.11.1)
78
+ mini_portile2 (~> 2.5.0)
79
+ racc (~> 1.4)
80
+ nokogumbo (2.0.4)
85
81
  nokogiri (~> 1.8, >= 1.8.4)
86
82
  pry (0.13.1)
87
83
  coderay (~> 1.1)
88
84
  method_source (~> 1.0)
85
+ racc (1.5.2)
89
86
  rack (2.2.3)
90
87
  rails-dom-testing (2.0.3)
91
88
  activesupport (>= 4.2.0)
@@ -93,8 +90,8 @@ GEM
93
90
  rails-html-sanitizer (1.3.0)
94
91
  loofah (~> 2.3)
95
92
  rake (12.3.3)
96
- redcarpet (3.5.0)
97
- roqua-support (0.3.4)
93
+ redcarpet (3.5.1)
94
+ roqua-support (0.3.5)
98
95
  active_interaction (~> 3.0)
99
96
  activesupport (>= 5.1, < 6.1)
100
97
  appsignal (>= 2.9, < 2.11)
@@ -114,11 +111,11 @@ GEM
114
111
  rspec-support (~> 3.9.0)
115
112
  rspec-support (3.9.3)
116
113
  thread_safe (0.3.6)
117
- tzinfo (1.2.8)
114
+ tzinfo (1.2.9)
118
115
  thread_safe (~> 0.1)
119
116
  with_advisory_lock (3.2.0)
120
117
  activerecord (>= 3.2)
121
- zeitwerk (2.4.1)
118
+ zeitwerk (2.4.2)
122
119
 
123
120
  PLATFORMS
124
121
  ruby
@@ -14,11 +14,11 @@ module Quby
14
14
  trigger_on: true,
15
15
  shows_questions: [],
16
16
  hides_questions: [],
17
- depends_on: nil, # used in interface to hide this flag unless the depended on flag is set to true
17
+ depends_on: [], # used in interface to hide this flag unless the depended on flag is set to true
18
18
  default_in_interface: nil) # used in interface to set a default for the flag state,
19
19
  # does not have an effect outside of the interface
20
20
  super(key, description_true, description_false, description, internal, trigger_on, shows_questions,
21
- hides_questions, depends_on, default_in_interface)
21
+ hides_questions, Array.wrap(depends_on).map(&:to_s), default_in_interface)
22
22
  ensure_valid_descriptions
23
23
  end
24
24
  # rubocop:enable ParameterLists
@@ -131,9 +131,9 @@ module Quby
131
131
  end
132
132
 
133
133
  def validate_flag_depends_on(questionnaire, flag)
134
- return if flag.depends_on.blank? || questionnaire.flags.key?(flag.depends_on)
134
+ return if (missing = flag.depends_on - questionnaire.flags.keys).blank?
135
135
 
136
- fail ArgumentError, "Flag #{flag.key} depends_on nonexistent flag '#{flag.depends_on}'"
136
+ fail ArgumentError, "Flag #{flag.key} depends_on nonexistent flag '#{missing.to_sentence}'"
137
137
  end
138
138
 
139
139
  def validate_respondent_types(questionnaire)
@@ -114,6 +114,7 @@ module Quby
114
114
  update_dqtypes_depends(d_qtypes, question, options)
115
115
  end
116
116
 
117
+ strip_question_number_slashes(question_titles)
117
118
  seed["quests"] = sort_nested_hash(question_titles)
118
119
  seed["d_qtypes"] = sort_nested_hash(d_qtypes)
119
120
  seed["name"] = questionnaire.title
@@ -286,7 +287,13 @@ module Quby
286
287
  end
287
288
 
288
289
  def strip_p_tag(text)
289
- text.gsub(/^<p>(.*)<\/p>\n?$/, "\\1")
290
+ text.gsub /^<p>(.*)<\/p>\n?$/, '\1'
291
+ end
292
+
293
+ def strip_question_number_slashes(quests)
294
+ quests.transform_values! do |value|
295
+ value.gsub /^(\s*\d+)\\/, '\1'
296
+ end
290
297
  end
291
298
 
292
299
  def process_scores
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.1"
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.2.1
4
+ version: 0.3.1
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-01-22 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -148,6 +148,7 @@ files:
148
148
  - ".gitlab-ci.yml"
149
149
  - ".rspec"
150
150
  - ".ruby-version"
151
+ - CHANGELOG.md
151
152
  - CODE_OF_CONDUCT.md
152
153
  - Dockerfile
153
154
  - Gemfile