mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
d79366b4c9
When generating a new rails application (rails new) using a custom template that includes gems from an authenticated source, the user has to provide credentials to bundler. One way to do this is by exporting environment variables, for example: export BUNDLE_GITHUB__COM=user:pass: provides credentials for bundler to fetch gems from github.com. The problem this PR addresses is that we are currently scrubs all /BUNDLE_.*/ environment variables by wrapping our system calls in Bundler.with_clean_env. We do this because we don't want our commands executed against the generated project to use the generator's bundler environment (e.g. our gems): the generated project should use it's own configuration. The problem with Bundler.with_clean_env is that, on top of restoring environment variables to their original state, it also scrubs any /BUNDLE_.*/ variables, which is harmful for authenticated gem sources. This PR replaces Bundler.with_clean_env with Bundler.with_original_env, which only restores environment variables to their initial state, without additional scrubbing. |
||
---|---|---|
.. | ||
api | ||
application | ||
command | ||
commands | ||
console | ||
engine | ||
generators | ||
plugin | ||
rack | ||
railtie | ||
tasks | ||
templates | ||
test_unit | ||
all.rb | ||
app_loader.rb | ||
app_updater.rb | ||
application.rb | ||
application_controller.rb | ||
backtrace_cleaner.rb | ||
cli.rb | ||
code_statistics.rb | ||
code_statistics_calculator.rb | ||
command.rb | ||
commands.rb | ||
configuration.rb | ||
dev_caching.rb | ||
engine.rb | ||
gem_version.rb | ||
generators.rb | ||
info.rb | ||
info_controller.rb | ||
initializable.rb | ||
mailers_controller.rb | ||
paths.rb | ||
rack.rb | ||
railtie.rb | ||
ruby_version_check.rb | ||
secrets.rb | ||
source_annotation_extractor.rb | ||
tasks.rb | ||
test_help.rb | ||
version.rb | ||
welcome_controller.rb |