-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Deprecate RACK_ENV in favour of APP_ENV #2031
Conversation
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.
Thanks for this contribution.
I will defer to @dometto to approve and merge, as he has a clearer picture of what the 6.0.0 release looks like.
bin/gollum
Outdated
if Gollum::VERSION < "6.0.0" && ENV['RACK_ENV'] && !ENV['APP_ENV'] | ||
warn "[DEPRECATION] RACK_ENV will be ignored as of gollum-6.0.0, please use APP_ENV instead." | ||
ENV['APP_ENV'] = ENV['RACK_ENV'] |
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 was surprised to learn that this string comparison works.
If Gollum was a project that had more pre-releases (i.e. 6.0.0.alpha
) I would reach for a more-expressive Gem::Version
comparison:
Gem::Version.new(Gollum::VERSION) < Gem::Version.new("6.0.0")
But I manually tested that this does the right thing, and it does. So looks good to me.
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.
Actually, I'm not really sure whether checking for the version there is a good idea at all. Might just as well without, provided someone keeps track of such post-release TODOs.
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 think it could be alright to leave out the version check, if we open an issue to remove the deprecation notice. Even with the check present, we'll have to remember to remove the code at some point, so it doesn't make that much of a difference I think.
So I propose that we keep the deprecation notice (without the version check) until 7.0 (because 6.0 will happen very soon when I'm back from leave) and open an issue to remind ourselves to remove the relevant code in that release.
I also learned something new about string comparisons today! 😀
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.
@dometto Sorry for the delay, this slipped off my desk somehow. I've removed the version check and just kept the # TODO
which mentions the lines to be removed once gollum-7 is released.
Thank you @svoop and sorry for the delay! |
Easy, thanks for the merge! |
Say goodbye for the often misused
RACK_ENV
in favour ofAPP_ENV
(like Sinatra does). A deprecation warning is printed if onlyRACK_ENV
is set and Golllum has not yet reached version 6.Related issue: #2029