1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails
Marco Costa d79366b4c9 Preserve Bundle configuration during app generation (#34755)
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.
2019-01-09 07:52:06 +09:00
..
api Generate Action Text's API docs 2019-01-04 23:56:22 -05:00
application Send Active Storage jobs to dedicated queues by default 2019-01-04 12:43:51 -05:00
command Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
commands Do not show suggestion message when not exist suggestion 2018-12-29 18:57:55 +09:00
console
engine Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
generators Preserve Bundle configuration during app generation (#34755) 2019-01-09 07:52:06 +09:00
plugin
rack Log the remote IP addr of clients behind a proxy 2018-07-31 20:45:37 +05:30
railtie
tasks Respect Rails.env when running rails yarn:install 2019-01-04 11:54:47 -06:00
templates Ruby can show a little bit more detailed info in shorter code 2018-12-15 13:21:58 +09:00
test_unit Add Rake task for testing mailboxes 2018-12-30 16:17:16 -05:00
all.rb Import Action Text 2019-01-04 22:22:49 -05:00
app_loader.rb Enable Start/EndWith and RegexpMatch cops 2018-07-28 17:37:17 -04:00
app_updater.rb Remove --skip-yarn in favor of --skip-javascript 2018-10-22 16:54:10 +03:00
application.rb chore: implement config_for as ActiveSupport::OrderedOptions 2018-10-19 14:37:06 +02:00
application_controller.rb
backtrace_cleaner.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
cli.rb
code_statistics.rb Enable Start/EndWith and RegexpMatch cops 2018-07-28 17:37:17 -04:00
code_statistics_calculator.rb
command.rb Homogenize rails help output 2018-11-19 22:48:51 +01:00
commands.rb
configuration.rb Turn on performance based cops 2018-07-23 15:37:06 -07:00
dev_caching.rb
engine.rb Revert "Merge pull request #33970 from rails/eager-url-helpers" 2018-10-03 16:15:47 -05:00
gem_version.rb
generators.rb Do not show suggestion message when not exist suggestion 2018-12-29 18:57:55 +09:00
info.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
info_controller.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
initializable.rb
mailers_controller.rb Introduce a guard against DNS rebinding attacks 2018-12-15 20:18:51 +02:00
paths.rb Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
rack.rb
railtie.rb Fix call sites 2018-10-02 15:31:29 -04:00
ruby_version_check.rb Require Ruby 2.5 for Rails 6. 2018-12-19 21:47:50 +01:00
secrets.rb
source_annotation_extractor.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
tasks.rb Make rake routes deprecate before deleting 2018-08-20 08:47:29 +09:00
test_help.rb Use testing lazy-load hooks: 2018-07-04 16:34:59 -04:00
version.rb
welcome_controller.rb