rails--rails/railties/test
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
..
application Test Action Mailbox configurations 2019-01-04 21:32:07 +02:00
command Use `did_you_mean` spell checker for option suggestions 2018-03-23 11:36:03 +02:00
commands Do not show suggestion message when not exist suggestion 2018-12-29 18:57:55 +09:00
configuration Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
engine Make Webpacker the default JavaScript compiler for Rails 6 (#33079) 2018-09-30 22:31:21 -07:00
fixtures/lib Remove unused fixtures 2017-09-26 07:45:42 +09:00
generators Preserve Bundle configuration during app generation (#34755) 2019-01-09 07:52:06 +09:00
isolation Import Action Mailbox 2018-12-25 21:32:35 -05:00
minitest rubocop single space after assignment 2018-02-19 11:23:47 +05:30
railties Import Action Text 2019-01-04 22:22:49 -05:00
test_unit Show rails instead of bin/rails on USAGE instructions 2018-07-06 22:46:54 +02:00
abstract_unit.rb Remove private def 2018-09-23 21:27:44 +05:30
app_loader_test.rb Turn on performance based cops 2018-07-23 15:37:06 -07:00
backtrace_cleaner_test.rb Use backtrace cleaner to clean up backtrace for verbose query logs 2018-08-14 09:15:28 +10:00
code_statistics_calculator_test.rb use "minitest" consistently 2018-09-11 23:57:25 +02:00
code_statistics_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
console_helpers.rb Enable `Performance/UnfreezeString` cop 2018-09-23 08:56:55 +09:00
credentials_test.rb Add test for reads environment credential file with environment variable key 2018-12-09 15:00:01 +09:00
engine_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
env_helpers.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
generators_test.rb Do not show suggestion message when not exist suggestion 2018-12-29 18:57:55 +09:00
initializable_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
json_params_parsing_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
path_generation_test.rb Add credentials using a generic EncryptedConfiguration class (#30067) 2017-09-11 20:21:20 +02:00
paths_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
rack_logger_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
rails_info_controller_test.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
rails_info_test.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
secrets_test.rb Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
version_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00