Rails alternative environment and additional key lookup during env mapping#285
Closed
neilwilliams wants to merge 7 commits into
Closed
Rails alternative environment and additional key lookup during env mapping#285neilwilliams wants to merge 7 commits into
neilwilliams wants to merge 7 commits into
Conversation
… Rails.env Started work on changing how the keys are converted from the environment into the config, when using the underscore seperator, it should work as expected - it currently doesn't
…e keys which contain the seperator being used
Fryguy
reviewed
Nov 6, 2020
| if platform.nil? | ||
| s.add_development_dependency name, version | ||
| else | ||
| if platform.to_s == RUBY_ENGINE |
Fryguy
reviewed
Nov 6, 2020
Comment on lines
+40
to
+41
| gems_to_install = /gem "(.*?)", "(.*?)"(, platform: \:(.*))?/ | ||
| File.read(Dir['gemfiles/rails*.gemfile'].sort.last).scan(gems_to_install) do |name, version, _, platform| |
Member
There was a problem hiding this comment.
Suggested change
| gems_to_install = /gem "(.*?)", "(.*?)"(, platform: \:(.*))?/ | |
| File.read(Dir['gemfiles/rails*.gemfile'].sort.last).scan(gems_to_install) do |name, version, _, platform| | |
| gems_to_install = /gem "(.*?)", "(.*?)"(?:, platform: \:(.*))?/ | |
| File.read(Dir['gemfiles/rails*.gemfile'].sort.last).scan(gems_to_install) do |name, version, platform| |
I think you can do this to avoid capturing that third unused value
Member
|
I only commented on the Ruby env fix...can you please move that into a separate PR, as that is more likely to be merged sooner, and it's unrelated to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's three main changes in this PR.
A rails app can now configure where the 'environment' comes from. Previously, it was inferred from Rails.environment. We didn't want to pollute RAILS_ENV with actual environments (e.g. stage, preprod). So this change allows the two things to be separated.
Devs are now able to run
bundle exec rspecwhen using the ruby platformWhen overriding keys from the environment, there wasn't a way to do this if the keys used in the settings.yml contained the seperation character being used in the environment variables.
E.g.
settings.yml
When using:
I was never able to overide these settings with:
The change allows this to work as expected, but it will still allow the gem to work as it did before.
E.g.
If the structure above cannot be found, it will set the value under:
Note The code I've created for the third feature is quite crude at the moment, so would appreciate any feedback you have!