Skip to content
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

Get environment from RACK_ENV if exists by default #13

Merged
merged 2 commits into from
Nov 11, 2014

Conversation

tb0yd
Copy link

@tb0yd tb0yd commented Aug 28, 2014

Hi, it may be a good idea to get the environment from RACK_ENV by default.

We use this in production and recently traced a bug back to the environment not being set in Guard::Puma, so I figured others might have made the same mistake.

@@ -7,9 +7,14 @@
module Guard
class Puma < Guard
attr_reader :options, :runner

def self.default_env
ENV['RACK_ENV'] || 'development'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of the || pattern. Mind switching to Hash#fetch instead? Otherwise, looks good.

@jc00ke
Copy link
Owner

jc00ke commented Sep 1, 2014

And in general, I'm curious how you use this in production?

@tb0yd
Copy link
Author

tb0yd commented Nov 11, 2014

My apologies - we actually don't. There was a bug in production that I was assuming was caused by this, but it wasn't. Thanks!

@jc00ke
Copy link
Owner

jc00ke commented Nov 11, 2014

Build is failing because guard and some dependencies have changed. Specs passed when I ran it locally before updating, so let's go ahead and merge and I'll sort out deps issues.

jc00ke added a commit that referenced this pull request Nov 11, 2014
Get environment from RACK_ENV if exists by default
@jc00ke jc00ke merged commit aaa7a89 into jc00ke:master Nov 11, 2014
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.

None yet

2 participants