Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quby-compiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RoQua
quby-compiler
Commits
137ecd99
Commit
137ecd99
authored
4 years ago
by
Jorn van de Beek
Browse files
Options
Downloads
Patches
Plain Diff
Strip slashes from question title numbers
parent
5ade7107
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Strip slashes from question title numbers
Pipeline
#79809
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Gemfile.lock
+1
-1
1 addition, 1 deletion
Gemfile.lock
lib/quby/compiler/services/quby_proxy.rb
+8
-1
8 additions, 1 deletion
lib/quby/compiler/services/quby_proxy.rb
spec/quby/compiler/outputs/seed_serializer_spec.rb
+12
-0
12 additions, 0 deletions
spec/quby/compiler/outputs/seed_serializer_spec.rb
with
21 additions
and
2 deletions
Gemfile.lock
+
1
−
1
View file @
137ecd99
PATH
remote: .
specs:
quby-compiler (0.
1
.1)
quby-compiler (0.
2
.1)
actionview (>= 5.0)
activemodel (>= 5.0)
activesupport (>= 5.0)
...
...
This diff is collapsed.
Click to expand it.
lib/quby/compiler/services/quby_proxy.rb
+
8
−
1
View file @
137ecd99
...
...
@@ -114,6 +114,7 @@ module Quby
update_dqtypes_depends
(
d_qtypes
,
question
,
options
)
end
strip_question_number_slashes
(
question_titles
)
seed
[
"quests"
]
=
sort_nested_hash
(
question_titles
)
seed
[
"d_qtypes"
]
=
sort_nested_hash
(
d_qtypes
)
seed
[
"name"
]
=
questionnaire
.
title
...
...
@@ -286,7 +287,13 @@ module Quby
end
def
strip_p_tag
(
text
)
text
.
gsub
(
/^<p>(.*)<\/p>\n?$/
,
"
\\
1"
)
text
.
gsub
/^<p>(.*)<\/p>\n?$/
,
'\1'
end
def
strip_question_number_slashes
(
quests
)
quests
.
transform_values!
do
|
value
|
value
.
gsub
/^(\s*\d+)\\/
,
'\1'
end
end
def
process_scores
...
...
This diff is collapsed.
Click to expand it.
spec/quby/compiler/outputs/seed_serializer_spec.rb
+
12
−
0
View file @
137ecd99
...
...
@@ -21,6 +21,18 @@ describe Quby::Compiler::Outputs::SeedSerializer do
])
end
it
'strips slashes after question numbers'
do
questionnaire
=
dsl
(
"test"
)
do
title
"Test Quest"
panel
do
question
:v_1
,
type: :string
,
title:
' 12\. vraag nummer 1'
end
end
serializer
=
described_class
.
new
(
questionnaire
,
[])
expect
(
serializer
.
generate
.
first
[
'quests'
]).
to
eq
(
"v_1"
=>
" 12. vraag nummer 1"
)
end
def
dsl
(
key
,
&
block
)
Quby
::
Compiler
::
DSL
.
build
(
key
,
nil
,
&
block
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment