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

Support separate color var #5

Merged
merged 2 commits into from
Apr 17, 2020

Conversation

jonallured
Copy link
Collaborator

This gem assumes that a project has set their RAILS_ENV in staging and production to different values and that's certainly one way to do it, but another way is to set them both to production to ensure that the app setup doesn't drift. This is how we have convection setup, for example.

So this PR just adds a way to override the reliance on Rails.env with a separate ENV var called CONSOLE_COLOR_ENV.

Note that the git ignore file actually removes the tests from the repo so I was not able to test this change. I guess I could link my local convection to this gem on my machine to ensure it works as expected, but I would love to get some rspec coverage on this project - what do you think @joeyAghion?

@jonallured
Copy link
Collaborator Author

jonallured commented Apr 15, 2020

Ok yeah that did work:

# Gemfile
gem 'console_color', path: "../console_color"
jon@juggernaut:~/code/convection(add-published-submissions*)% bundle exec rails console
convection:development>

jon@juggernaut:~/code/convection(add-published-submissions*)% CONSOLE_COLOR_ENV=hahaha bundle exec rails console
convection:hahaha>

@joeyAghion
Copy link
Owner

I endorse this change! Staging should really run in production mode where possible.

@joeyAghion joeyAghion merged commit f99dce1 into joeyAghion:master Apr 17, 2020
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