-
Notifications
You must be signed in to change notification settings - Fork 631
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
Make methods private in AnnotateRoutes #598
Make methods private in AnnotateRoutes #598
Conversation
lib/annotate/annotate_routes.rb
Outdated
end | ||
out << '' if magic_comments_map.any? | ||
|
||
out += ["# #{options[:wrapper_open]}"] if options[:wrapper_open] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you didn't make this change, but out of curiosity do you know if there's a reason behind using <<
versus += []
for appending to an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a semantic difference between them:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense but this is mutating an array I believe. Line 43 is out = []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested it in Pry looks like the same applies regardless of if it's a String or an Array. Functionally it looks like one can be substituted over the other so would it makes sense to change the cases so they're the same?
👍 Changes look good to me. Looks a lot cleaner now that class methods are together in the singleton class rather than defined as |
@ctran unsure if you need anything else but it should be good to merge in as it's not changing any functionality. |
Planning on landing this in the next few days and bumping the gem version to |
First I tried to extend
AnnotateModels
, but I found several problems inAnnotateModels
andAnnotateRoutes
.In
AnnotateRoutes
, there were many public methods that is not used in other classes or modules.Before my extension, I made these methods private and sort them in order of appearance.
All tests were passed.
Please trace each commits carefully. I didn't nothing special. The commits consist of coordinating code.
Note
As Code Climate shows, this gem is hard to maintain.
So I'd like to refactor this gem in the near future.