Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
d4948432
Commit
d4948432
authored
Jan 21, 2020
by
Shu Fujita
Committed by
Andrew W. Lee
Jan 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor AnnotateRoutes.rewrite_contents (#734)
I moved `puts` from `AnnotateRoutes.rewrite_contents` to `.do_annotations` and `.remove_annotations`.
parent
1b51de89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
annotate_routes.rb
lib/annotate/annotate_routes.rb
+4
-1
No files found.
lib/annotate/annotate_routes.rb
View file @
d4948432
...
...
@@ -36,6 +36,8 @@ module AnnotateRoutes
if
rewrite_contents
(
existing_text
,
new_text
)
puts
"
#{
routes_file
}
annotated."
else
puts
"
#{
routes_file
}
unchanged."
end
else
puts
"Can't find routes.rb"
...
...
@@ -50,6 +52,8 @@ module AnnotateRoutes
new_text
=
new_content
.
join
(
"
\n
"
)
if
rewrite_contents
(
existing_text
,
new_text
)
puts
"Removed annotations from
#{
routes_file
}
."
else
puts
"
#{
routes_file
}
unchanged."
end
else
puts
"Can't find routes.rb"
...
...
@@ -156,7 +160,6 @@ module AnnotateRoutes
def
rewrite_contents
(
existing_text
,
new_text
)
if
existing_text
==
new_text
puts
"
#{
routes_file
}
unchanged."
false
else
File
.
open
(
routes_file
,
'wb'
)
{
|
f
|
f
.
puts
(
new_text
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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