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
330f8bdb
Commit
330f8bdb
authored
Jul 12, 2017
by
Alexander Belozerov
Committed by
Cuong Tran
Jul 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove empty line with trailing space at the end of routes map (#483)
parent
6775e4a1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
annotate_routes.rb
lib/annotate/annotate_routes.rb
+1
-1
annotate_routes_spec.rb
spec/annotate/annotate_routes_spec.rb
+2
-2
No files found.
lib/annotate/annotate_routes.rb
View file @
330f8bdb
...
...
@@ -77,7 +77,7 @@ module AnnotateRoutes
end
def
self
.
app_routes_map
(
options
)
routes_map
=
`rake routes`
.
split
(
/\n/
,
-
1
)
routes_map
=
`rake routes`
.
chomp
(
"
\n
"
).
split
(
/\n/
,
-
1
)
# In old versions of Rake, the first line of output was the cwd. Not so
# much in newer ones. We ditch that line if it exists, and if not, we
...
...
spec/annotate/annotate_routes_spec.rb
View file @
330f8bdb
...
...
@@ -22,10 +22,10 @@ describe AnnotateRoutes do
expect
(
File
).
to
receive
(
:exists?
).
with
(
ROUTE_FILE
).
and_return
(
true
)
expect
(
File
).
to
receive
(
:read
).
with
(
ROUTE_FILE
).
and_return
(
""
)
expect
(
AnnotateRoutes
).
to
receive
(
:`
).
with
(
'rake routes'
).
and_return
(
'
Prefix Verb URI Pattern Controller#Action
expect
(
AnnotateRoutes
).
to
receive
(
:`
).
with
(
'rake routes'
).
and_return
(
"
Prefix Verb URI Pattern Controller#Action
myaction1 GET /url1(.:format) mycontroller1#action
myaction2 POST /url2(.:format) mycontroller2#action
myaction3 DELETE|GET /url3(.:format) mycontroller3#action
'
)
myaction3 DELETE|GET /url3(.:format) mycontroller3#action
\n
"
)
expect
(
AnnotateRoutes
).
to
receive
(
:puts
).
with
(
ANNOTATION_ADDED
)
end
...
...
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