Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
6d7bf167
Commit
6d7bf167
authored
Jul 05, 2018
by
Lucas Nussbaum
Browse files
wikigen: add some context when diffing
parent
ac963f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
generators/wiki/lib/wiki_generator.rb
View file @
6d7bf167
...
...
@@ -68,7 +68,7 @@ class WikiGenerator
def
diff_page
()
wiki_content
=
remove_page_creation_date
(
@mw_client
.
get_page_content
(
@page_name
)).
strip
# .strip removes potential '\n' at end of file
generated_content
=
remove_page_creation_date
(
@generated_content
).
strip
diff
=
Diffy
::
Diff
.
new
(
wiki_content
,
generated_content
,
:context
=>
0
)
diff
=
Diffy
::
Diff
.
new
(
wiki_content
,
generated_content
,
:context
=>
3
)
if
(
diff
.
to_s
.
empty?
)
puts
"No differences found between generated and current wiki content for page
#{
@page_name
}
."
return
true
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment