Skip to content

Remove empty line with trailing space at the end of routes map #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2017

Conversation

sashabelozerov
Copy link
Contributor

Fixes #474

Actually, not only fixes issue with trailing space, but removes last empty line (#[EOL]) at the end of routes map completely.

Example:
Instead of

# == Route Map
#
#   Prefix Verb   URI Pattern    Controller#Action
#   root GET       /                    main#index
# [EOL]

Now it will be

# == Route Map
#
#   Prefix Verb   URI Pattern    Controller#Action
#   root GET       /                    main#index

Here is why this empty line occurred in the first place:
rake routes returns text with a new line character at the very end.
AnnotateRoutes treated this last empty line as a useful content and added # [EOL] because of it.

I decided to remove # [EOL], because specs show that it wasn't expected from the beginning. Specs passed only because there was an assumption that rake routes doesn't add new line character at the end, which is wrong.

@ctran ctran added this to the v2.7.3 milestone Jul 12, 2017
@ctran ctran merged commit 330f8bd into ctran:develop Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

annotate 2.7.2 adds trailing space to the last line of route map
2 participants