diff --git a/CHANGELOG.md b/CHANGELOG.md index 609d544de5f6365bbc07098f75012dfd298ebc96..bed2f173d29da2cd99865938a623688e30c69605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.3.2 + +* Fix slashes-after-numbers removal when question does not have a title + # 0.3.1 * Slashes after numbers are now removed from question titles when making RoQua seeds (quests attribute). diff --git a/Gemfile.lock b/Gemfile.lock index 4015683b43717965b8f346ba43049f35d1a509fa..ce1c15a39c019414c2abe43d828a5d792ecc23a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - quby-compiler (0.3.1) + quby-compiler (0.3.2) actionview (>= 5.0) activemodel (>= 5.0) activesupport (>= 5.0) @@ -74,10 +74,10 @@ GEM mini_portile2 (2.5.0) minitest (5.14.4) naught (1.1.0) - nokogiri (1.11.1) + nokogiri (1.11.2) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogumbo (2.0.4) + nokogumbo (2.0.5) nokogiri (~> 1.8, >= 1.8.4) pry (0.13.1) coderay (~> 1.1) diff --git a/lib/quby/compiler/services/quby_proxy.rb b/lib/quby/compiler/services/quby_proxy.rb index d9c0a5533d87c99522ba9589f7d814029e0048fe..d3f7c6163137f187e1d09396489ac73f1501ec0c 100644 --- a/lib/quby/compiler/services/quby_proxy.rb +++ b/lib/quby/compiler/services/quby_proxy.rb @@ -292,19 +292,19 @@ module Quby def strip_question_number_slashes(quests) quests.transform_values! do |value| - value.gsub /^(\s*\d+)\\/, '\1' + value&.gsub /^(\s*\d+)\\/, '\1' end end def process_scores scores_from_schemas end - + def scores_from_schemas score_headers = [] # headers outcome (humanized name for subscores) score_keys = [] # headers data-export (not all of it, just the score_subscore part, shortened) score_labels = [] # score names outcome (humanized name for score as a whole) - + questionnaire.score_schemas.values.each do |score_schema| score_labels << score_schema.label score_keys << score_schema.subscore_schemas.map do |subschema| @@ -318,18 +318,18 @@ module Quby hash end end - + headers = score_schema.subscore_schemas.map(&:label) score_headers += headers - score_headers end - + { headers: score_headers, keys: score_keys, labels: score_labels } end - + class ShortenKeysUniq def initialize @seen_results = [] diff --git a/lib/quby/compiler/version.rb b/lib/quby/compiler/version.rb index a744ba170ff7f101e16982cfbc3cdbd3866f01a0..0dbb9741694aa82fccdfd26c032eae8a68b6fee2 100644 --- a/lib/quby/compiler/version.rb +++ b/lib/quby/compiler/version.rb @@ -1,5 +1,5 @@ module Quby module Compiler - VERSION = "0.3.1" + VERSION = "0.3.2" end end