aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/bundle2
-rw-r--r--common.mk2
-rw-r--r--lib/bundler.gemspec516
-rw-r--r--lib/bundler.rb86
-rw-r--r--lib/bundler/build_metadata.rb36
-rw-r--r--lib/bundler/capistrano.rb5
-rw-r--r--lib/bundler/cli.rb222
-rw-r--r--lib/bundler/cli/add.rb1
-rw-r--r--lib/bundler/cli/binstubs.rb16
-rw-r--r--lib/bundler/cli/cache.rb9
-rw-r--r--lib/bundler/cli/check.rb8
-rw-r--r--lib/bundler/cli/clean.rb11
-rw-r--r--lib/bundler/cli/common.rb13
-rw-r--r--lib/bundler/cli/config.rb3
-rw-r--r--lib/bundler/cli/console.rb3
-rw-r--r--lib/bundler/cli/doctor.rb1
-rw-r--r--lib/bundler/cli/exec.rb5
-rw-r--r--lib/bundler/cli/gem.rb5
-rw-r--r--lib/bundler/cli/info.rb1
-rw-r--r--lib/bundler/cli/init.rb23
-rw-r--r--lib/bundler/cli/inject.rb1
-rw-r--r--lib/bundler/cli/install.rb122
-rw-r--r--lib/bundler/cli/issue.rb2
-rw-r--r--lib/bundler/cli/list.rb22
-rw-r--r--lib/bundler/cli/lock.rb1
-rw-r--r--lib/bundler/cli/open.rb4
-rw-r--r--lib/bundler/cli/outdated.rb21
-rw-r--r--lib/bundler/cli/package.rb15
-rw-r--r--lib/bundler/cli/platform.rb1
-rw-r--r--lib/bundler/cli/plugin.rb1
-rw-r--r--lib/bundler/cli/pristine.rb11
-rw-r--r--lib/bundler/cli/show.rb1
-rw-r--r--lib/bundler/cli/update.rb36
-rw-r--r--lib/bundler/cli/viz.rb1
-rw-r--r--lib/bundler/compact_index_client.rb1
-rw-r--r--lib/bundler/compact_index_client/cache.rb3
-rw-r--r--lib/bundler/compact_index_client/updater.rb7
-rw-r--r--lib/bundler/compatibility_guard.rb14
-rw-r--r--lib/bundler/constants.rb1
-rw-r--r--lib/bundler/current_ruby.rb9
-rw-r--r--lib/bundler/definition.rb266
-rw-r--r--lib/bundler/dep_proxy.rb2
-rw-r--r--lib/bundler/dependency.rb13
-rw-r--r--lib/bundler/deployment.rb2
-rw-r--r--lib/bundler/deprecate.rb17
-rw-r--r--lib/bundler/dsl.rb159
-rw-r--r--lib/bundler/endpoint_specification.rb9
-rw-r--r--lib/bundler/env.rb113
-rw-r--r--lib/bundler/environment_preserver.rb33
-rw-r--r--lib/bundler/errors.rb1
-rw-r--r--lib/bundler/feature_flag.rb43
-rw-r--r--lib/bundler/fetcher.rb23
-rw-r--r--lib/bundler/fetcher/base.rb1
-rw-r--r--lib/bundler/fetcher/compact_index.rb13
-rw-r--r--lib/bundler/fetcher/dependency.rb3
-rw-r--r--lib/bundler/fetcher/downloader.rb1
-rw-r--r--lib/bundler/fetcher/index.rb1
-rw-r--r--lib/bundler/friendly_errors.rb5
-rw-r--r--lib/bundler/gem_helper.rb27
-rw-r--r--lib/bundler/gem_helpers.rb1
-rw-r--r--lib/bundler/gem_remote_fetcher.rb1
-rw-r--r--lib/bundler/gem_tasks.rb1
-rw-r--r--lib/bundler/gem_version_promoter.rb1
-rw-r--r--lib/bundler/gemdeps.rb1
-rw-r--r--lib/bundler/graph.rb1
-rw-r--r--lib/bundler/index.rb16
-rw-r--r--lib/bundler/injector.rb47
-rw-r--r--lib/bundler/inline.rb12
-rw-r--r--lib/bundler/installer.rb154
-rw-r--r--lib/bundler/installer/gem_installer.rb2
-rw-r--r--lib/bundler/installer/parallel_installer.rb115
-rw-r--r--lib/bundler/installer/standalone.rb1
-rw-r--r--lib/bundler/lazy_specification.rb3
-rw-r--r--lib/bundler/lockfile_generator.rb95
-rw-r--r--lib/bundler/lockfile_parser.rb14
-rw-r--r--lib/bundler/match_platform.rb1
-rw-r--r--lib/bundler/mirror.rb9
-rw-r--r--lib/bundler/plugin.rb1
-rw-r--r--lib/bundler/plugin/api/source.rb11
-rw-r--r--lib/bundler/plugin/installer.rb13
-rw-r--r--lib/bundler/plugin/source_list.rb15
-rw-r--r--lib/bundler/process_lock.rb24
-rw-r--r--lib/bundler/psyched_yaml.rb10
-rw-r--r--lib/bundler/remote_specification.rb1
-rw-r--r--lib/bundler/resolver.rb345
-rw-r--r--lib/bundler/resolver/spec_group.rb111
-rw-r--r--lib/bundler/retry.rb1
-rw-r--r--lib/bundler/ruby_dsl.rb1
-rw-r--r--lib/bundler/ruby_version.rb1
-rw-r--r--lib/bundler/rubygems_ext.rb9
-rw-r--r--lib/bundler/rubygems_gem_installer.rb25
-rw-r--r--lib/bundler/rubygems_integration.rb84
-rw-r--r--lib/bundler/runtime.rb8
-rw-r--r--lib/bundler/settings.rb254
-rw-r--r--lib/bundler/settings/validator.rb79
-rw-r--r--lib/bundler/setup.rb1
-rw-r--r--lib/bundler/shared_helpers.rb119
-rw-r--r--lib/bundler/similarity_detector.rb1
-rw-r--r--lib/bundler/source.rb36
-rw-r--r--lib/bundler/source/gemspec.rb1
-rw-r--r--lib/bundler/source/git.rb40
-rw-r--r--lib/bundler/source/git/git_proxy.rb25
-rw-r--r--lib/bundler/source/metadata.rb63
-rw-r--r--lib/bundler/source/path.rb16
-rw-r--r--lib/bundler/source/path/installer.rb2
-rw-r--r--lib/bundler/source/rubygems.rb238
-rw-r--r--lib/bundler/source/rubygems/remote.rb5
-rw-r--r--lib/bundler/source_list.rb90
-rw-r--r--lib/bundler/spec_set.rb10
-rw-r--r--lib/bundler/ssl_certs/certificate_manager.rb3
-rw-r--r--lib/bundler/stub_specification.rb1
-rwxr-xr-xlib/bundler/templates/Executable4
-rw-r--r--lib/bundler/templates/Executable.bundler105
-rw-r--r--lib/bundler/templates/Gemfile1
-rw-r--r--lib/bundler/templates/gems.rb8
-rw-r--r--lib/bundler/templates/newgem/README.md.tt2
-rw-r--r--lib/bundler/templates/newgem/gitignore.tt1
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt5
-rw-r--r--lib/bundler/templates/newgem/rspec.tt1
-rw-r--r--lib/bundler/templates/newgem/spec/newgem_spec.rb.tt2
-rw-r--r--lib/bundler/ui.rb1
-rw-r--r--lib/bundler/ui/rg_proxy.rb1
-rw-r--r--lib/bundler/ui/shell.rb19
-rw-r--r--lib/bundler/ui/silent.rb1
-rw-r--r--lib/bundler/uri_credentials_filter.rb1
-rw-r--r--lib/bundler/vendor/fileutils/lib/fileutils.rb1638
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo.rb2
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb26
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb7
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb5
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb7
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/errors.rb75
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb3
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb4
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb639
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb1
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/state.rb12
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb2
-rw-r--r--lib/bundler/vendor/thor/lib/thor/runner.rb4
-rw-r--r--lib/bundler/vendored_fileutils.rb9
-rw-r--r--lib/bundler/vendored_molinillo.rb1
-rw-r--r--lib/bundler/vendored_persistent.rb35
-rw-r--r--lib/bundler/vendored_thor.rb1
-rw-r--r--lib/bundler/version.rb8
-rw-r--r--lib/bundler/version_ranges.rb1
-rw-r--r--lib/bundler/vlad.rb5
-rw-r--r--lib/bundler/worker.rb1
-rw-r--r--lib/bundler/yaml_serializer.rb6
-rw-r--r--spec/bundler/bundler/bundler_spec.rb28
-rw-r--r--spec/bundler/bundler/cli_spec.rb52
-rw-r--r--spec/bundler/bundler/compact_index_client/updater_spec.rb2
-rw-r--r--spec/bundler/bundler/definition_spec.rb101
-rw-r--r--spec/bundler/bundler/dsl_spec.rb41
-rw-r--r--spec/bundler/bundler/endpoint_specification_spec.rb9
-rw-r--r--spec/bundler/bundler/env_spec.rb65
-rw-r--r--spec/bundler/bundler/environment_preserver_spec.rb5
-rw-r--r--spec/bundler/bundler/fetcher/base_spec.rb1
-rw-r--r--spec/bundler/bundler/fetcher/compact_index_spec.rb13
-rw-r--r--spec/bundler/bundler/fetcher/dependency_spec.rb15
-rw-r--r--spec/bundler/bundler/fetcher/downloader_spec.rb1
-rw-r--r--spec/bundler/bundler/fetcher/index_spec.rb3
-rw-r--r--spec/bundler/bundler/fetcher_spec.rb45
-rw-r--r--spec/bundler/bundler/friendly_errors_spec.rb4
-rw-r--r--spec/bundler/bundler/gem_helper_spec.rb96
-rw-r--r--spec/bundler/bundler/gem_version_promoter_spec.rb54
-rw-r--r--spec/bundler/bundler/index_spec.rb1
-rw-r--r--spec/bundler/bundler/installer/gem_installer_spec.rb3
-rw-r--r--spec/bundler/bundler/installer/parallel_installer_spec.rb2
-rw-r--r--spec/bundler/bundler/installer/spec_installation_spec.rb2
-rw-r--r--spec/bundler/bundler/lockfile_parser_spec.rb61
-rw-r--r--spec/bundler/bundler/mirror_spec.rb2
-rw-r--r--spec/bundler/bundler/plugin/api/source_spec.rb3
-rw-r--r--spec/bundler/bundler/plugin/api_spec.rb9
-rw-r--r--spec/bundler/bundler/plugin/dsl_spec.rb1
-rw-r--r--spec/bundler/bundler/plugin/index_spec.rb1
-rw-r--r--spec/bundler/bundler/plugin/installer_spec.rb6
-rw-r--r--spec/bundler/bundler/plugin/source_list_spec.rb1
-rw-r--r--spec/bundler/bundler/plugin_spec.rb1
-rw-r--r--spec/bundler/bundler/psyched_yaml_spec.rb2
-rw-r--r--spec/bundler/bundler/remote_specification_spec.rb1
-rw-r--r--spec/bundler/bundler/retry_spec.rb1
-rw-r--r--spec/bundler/bundler/ruby_dsl_spec.rb2
-rw-r--r--spec/bundler/bundler/ruby_version_spec.rb2
-rw-r--r--spec/bundler/bundler/rubygems_integration_spec.rb7
-rw-r--r--spec/bundler/bundler/settings/validator_spec.rb111
-rw-r--r--spec/bundler/bundler/settings_spec.rb82
-rw-r--r--spec/bundler/bundler/shared_helpers_spec.rb54
-rw-r--r--spec/bundler/bundler/source/git/git_proxy_spec.rb9
-rw-r--r--spec/bundler/bundler/source/rubygems/remote_spec.rb22
-rw-r--r--spec/bundler/bundler/source/rubygems_spec.rb1
-rw-r--r--spec/bundler/bundler/source_list_spec.rb44
-rw-r--r--spec/bundler/bundler/source_spec.rb1
-rw-r--r--spec/bundler/bundler/spec_set_spec.rb40
-rw-r--r--spec/bundler/bundler/ssl_certs/certificate_manager_spec.rb10
-rw-r--r--spec/bundler/bundler/stub_specification_spec.rb1
-rw-r--r--spec/bundler/bundler/ui/shell_spec.rb64
-rw-r--r--spec/bundler/bundler/ui_spec.rb1
-rw-r--r--spec/bundler/bundler/uri_credentials_filter_spec.rb1
-rw-r--r--spec/bundler/bundler/vendored_persistent_spec.rb78
-rw-r--r--spec/bundler/bundler/version_ranges_spec.rb2
-rw-r--r--spec/bundler/bundler/worker_spec.rb2
-rw-r--r--spec/bundler/bundler/yaml_serializer_spec.rb3
-rw-r--r--spec/bundler/cache/cache_path_spec.rb8
-rw-r--r--spec/bundler/cache/gems_spec.rb30
-rw-r--r--spec/bundler/cache/git_spec.rb37
-rw-r--r--spec/bundler/cache/path_spec.rb23
-rw-r--r--spec/bundler/cache/platform_spec.rb9
-rw-r--r--spec/bundler/commands/add_spec.rb5
-rw-r--r--spec/bundler/commands/binstubs_spec.rb168
-rw-r--r--spec/bundler/commands/check_spec.rb56
-rw-r--r--spec/bundler/commands/clean_spec.rb147
-rw-r--r--spec/bundler/commands/config_spec.rb7
-rw-r--r--spec/bundler/commands/console_spec.rb3
-rw-r--r--spec/bundler/commands/doctor_spec.rb17
-rw-r--r--spec/bundler/commands/exec_spec.rb81
-rw-r--r--spec/bundler/commands/help_spec.rb3
-rw-r--r--spec/bundler/commands/info_spec.rb1
-rw-r--r--spec/bundler/commands/init_spec.rb99
-rw-r--r--spec/bundler/commands/inject_spec.rb11
-rw-r--r--spec/bundler/commands/install_spec.rb82
-rw-r--r--spec/bundler/commands/issue_spec.rb1
-rw-r--r--spec/bundler/commands/licenses_spec.rb1
-rw-r--r--spec/bundler/commands/list_spec.rb40
-rw-r--r--spec/bundler/commands/lock_spec.rb35
-rw-r--r--spec/bundler/commands/newgem_spec.rb30
-rw-r--r--spec/bundler/commands/open_spec.rb1
-rw-r--r--spec/bundler/commands/outdated_spec.rb54
-rw-r--r--spec/bundler/commands/package_spec.rb30
-rw-r--r--spec/bundler/commands/pristine_spec.rb56
-rw-r--r--spec/bundler/commands/show_spec.rb11
-rw-r--r--spec/bundler/commands/update_spec.rb282
-rw-r--r--spec/bundler/commands/version_spec.rb39
-rw-r--r--spec/bundler/commands/viz_spec.rb1
-rw-r--r--spec/bundler/install/allow_offline_install_spec.rb10
-rw-r--r--spec/bundler/install/binstubs_spec.rb11
-rw-r--r--spec/bundler/install/bundler_spec.rb59
-rw-r--r--spec/bundler/install/deploy_spec.rb248
-rw-r--r--spec/bundler/install/failure_spec.rb3
-rw-r--r--spec/bundler/install/force_spec.rb91
-rw-r--r--spec/bundler/install/gemfile/eval_gemfile_spec.rb23
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb151
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb152
-rw-r--r--spec/bundler/install/gemfile/groups_spec.rb91
-rw-r--r--spec/bundler/install/gemfile/install_if.rb1
-rw-r--r--spec/bundler/install/gemfile/lockfile_spec.rb48
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb45
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb9
-rw-r--r--spec/bundler/install/gemfile/ruby_spec.rb1
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb138
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb13
-rw-r--r--spec/bundler/install/gemfile_spec.rb21
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb148
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb127
-rw-r--r--spec/bundler/install/gems/env_spec.rb1
-rw-r--r--spec/bundler/install/gems/flex_spec.rb46
-rw-r--r--spec/bundler/install/gems/mirror_spec.rb1
-rw-r--r--spec/bundler/install/gems/native_extensions_spec.rb2
-rw-r--r--spec/bundler/install/gems/post_install_spec.rb1
-rw-r--r--spec/bundler/install/gems/resolving_spec.rb15
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb45
-rw-r--r--spec/bundler/install/gems/sudo_spec.rb15
-rw-r--r--spec/bundler/install/gems/win32_spec.rb1
-rw-r--r--spec/bundler/install/gemspecs_spec.rb5
-rw-r--r--spec/bundler/install/git_spec.rb17
-rw-r--r--spec/bundler/install/global_cache_spec.rb235
-rw-r--r--spec/bundler/install/path_spec.rb29
-rw-r--r--spec/bundler/install/post_bundle_message_spec.rb86
-rw-r--r--spec/bundler/install/prereleases_spec.rb1
-rw-r--r--spec/bundler/install/process_lock_spec.rb24
-rw-r--r--spec/bundler/install/security_policy_spec.rb6
-rw-r--r--spec/bundler/install/yanked_spec.rb3
-rw-r--r--spec/bundler/lock/git_spec.rb3
-rw-r--r--spec/bundler/lock/lockfile_bundler_1_spec.rb1386
-rw-r--r--spec/bundler/lock/lockfile_spec.rb286
-rw-r--r--spec/bundler/other/bundle_ruby_spec.rb3
-rw-r--r--spec/bundler/other/cli_dispatch_spec.rb21
-rw-r--r--spec/bundler/other/compatibility_guard_spec.rb25
-rw-r--r--spec/bundler/other/ext_spec.rb1
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb106
-rw-r--r--spec/bundler/other/platform_spec.rb69
-rw-r--r--spec/bundler/other/ssl_cert_spec.rb6
-rw-r--r--spec/bundler/plugins/command_spec.rb1
-rw-r--r--spec/bundler/plugins/hook_spec.rb1
-rw-r--r--spec/bundler/plugins/install_spec.rb3
-rw-r--r--spec/bundler/plugins/source/example_spec.rb85
-rw-r--r--spec/bundler/plugins/source_spec.rb1
-rw-r--r--spec/bundler/quality_spec.rb105
-rw-r--r--spec/bundler/realworld/dependency_api_spec.rb9
-rw-r--r--spec/bundler/realworld/edgecases_spec.rb48
-rw-r--r--spec/bundler/realworld/gemfile_source_header_spec.rb4
-rw-r--r--spec/bundler/realworld/mirror_probe_spec.rb19
-rw-r--r--spec/bundler/realworld/parallel_spec.rb17
-rw-r--r--spec/bundler/resolver/basic_spec.rb98
-rw-r--r--spec/bundler/resolver/platform_spec.rb19
-rw-r--r--spec/bundler/runtime/executable_spec.rb54
-rw-r--r--spec/bundler/runtime/gem_tasks_spec.rb1
-rw-r--r--spec/bundler/runtime/inline_spec.rb20
-rw-r--r--spec/bundler/runtime/load_spec.rb18
-rw-r--r--spec/bundler/runtime/platform_spec.rb11
-rw-r--r--spec/bundler/runtime/require_spec.rb86
-rw-r--r--spec/bundler/runtime/setup_spec.rb193
-rw-r--r--spec/bundler/runtime/with_clean_env_spec.rb37
-rw-r--r--spec/bundler/spec_helper.rb47
-rw-r--r--spec/bundler/support/artifice/compact_index.rb5
-rw-r--r--spec/bundler/support/artifice/compact_index_api_missing.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_basic_authentication.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_checksum_mismatch.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_concurrent_download.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_creds_diff_host.rb3
-rw-r--r--spec/bundler/support/artifice/compact_index_extra.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_api.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_api_missing.rb17
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_missing.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_forbidden.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_host_redirect.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_no_gem.rb13
-rw-r--r--spec/bundler/support/artifice/compact_index_partial_update.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_redirects.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_wrong_dependencies.rb1
-rw-r--r--spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb1
-rw-r--r--spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint.rb29
-rw-r--r--spec/bundler/support/artifice/endpoint_500.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_api_forbidden.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_api_missing.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_basic_authentication.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_creds_diff_host.rb3
-rw-r--r--spec/bundler/support/artifice/endpoint_extra.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_extra_api.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_extra_missing.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_fallback.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_host_redirect.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_marshal_fail.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_mirror_source.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_redirect.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb1
-rw-r--r--spec/bundler/support/artifice/endpoint_timeout.rb3
-rw-r--r--spec/bundler/support/artifice/vcr.rb158
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/responsebin0 -> 13564 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/request6
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/response24
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/responsebin0 -> 280903 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/responsebin0 -> 1425 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/responsebin0 -> 3259479 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/responsebin0 -> 2409 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/responsebin0 -> 3082 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/responsebin0 -> 3967 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/responsebin0 -> 2679 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/responsebin0 -> 1139 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/responsebin0 -> 3605 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/responsebin0 -> 1119 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/responsebin0 -> 2215 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/responsebin0 -> 15980 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/responsebin0 -> 17131 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/responsebin0 -> 5642 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/responsebin0 -> 2436 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/responsebin0 -> 3570 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/responsebin0 -> 1259 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/responsebin0 -> 12759 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/responsebin0 -> 1396 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/responsebin0 -> 16487 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/responsebin0 -> 8619 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/responsebin0 -> 14268 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/responsebin0 -> 1716 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/responsebin0 -> 2539 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/responsebin0 -> 1292 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/responsebin0 -> 1673 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/responsebin0 -> 983 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/responsebin0 -> 3489 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/responsebin0 -> 1459 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/responsebin0 -> 1632 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/responsebin0 -> 3388 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/responsebin0 -> 1542 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/responsebin0 -> 1484 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/responsebin0 -> 5492 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/responsebin0 -> 1290 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/responsebin0 -> 3733 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/responsebin0 -> 2290 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/responsebin0 -> 1409 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/responsebin0 -> 1472 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/responsebin0 -> 1624 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/responsebin0 -> 1188 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/responsebin0 -> 1331 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/responsebin0 -> 1150 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/responsebin0 -> 1210 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/responsebin0 -> 3707 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/responsebin0 -> 2000 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/responsebin0 -> 11826 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/responsebin0 -> 1815 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/responsebin0 -> 4161 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/responsebin0 -> 2444 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/responsebin0 -> 1814 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/responsebin0 -> 1572 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/responsebin0 -> 1533 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/responsebin0 -> 2502 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/responsebin0 -> 1495 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/responsebin0 -> 1618 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/responsebin0 -> 3624 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/responsebin0 -> 1316 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/responsebin0 -> 3743 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/responsebin0 -> 1331 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/responsebin0 -> 1973 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/responsebin0 -> 1405 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/responsebin0 -> 1935 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/responsebin0 -> 2382 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/responsebin0 -> 2266 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/responsebin0 -> 1783 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/responsebin0 -> 5791 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/responsebin0 -> 1437 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/responsebin0 -> 3647 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/responsebin0 -> 1417 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/responsebin0 -> 1867 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/responsebin0 -> 1133 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/responsebin0 -> 8723 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/responsebin0 -> 1646 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/responsebin0 -> 2166 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/responsebin0 -> 2369 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/responsebin0 -> 2825 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/responsebin0 -> 1183 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/responsebin0 -> 1449 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/responsebin0 -> 1266 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/responsebin0 -> 1552 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/responsebin0 -> 1690 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/responsebin0 -> 2706 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/responsebin0 -> 1322 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/responsebin0 -> 2171 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/responsebin0 -> 3497 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/responsebin0 -> 1475 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/responsebin0 -> 1473 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/responsebin0 -> 1624 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/responsebin0 -> 1457 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/responsebin0 -> 1909 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/responsebin0 -> 2132 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/responsebin0 -> 1347 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/responsebin0 -> 1280 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/responsebin0 -> 1550 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/responsebin0 -> 5984 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/responsebin0 -> 3128 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/responsebin0 -> 1731 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/responsebin0 -> 4020 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/responsebin0 -> 6040 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/responsebin0 -> 2506 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/responsebin0 -> 4140 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/responsebin0 -> 1678 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/responsebin0 -> 2954 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/responsebin0 -> 1394 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/responsebin0 -> 1247 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/responsebin0 -> 10317 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/responsebin0 -> 4115 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/responsebin0 -> 1720 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/responsebin0 -> 1292 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/responsebin0 -> 2356 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/responsebin0 -> 24606 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/responsebin0 -> 1385 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/responsebin0 -> 1868 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/responsebin0 -> 1713 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/responsebin0 -> 4701 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/responsebin0 -> 1604 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/responsebin0 -> 1461 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/responsebin0 -> 2836 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/responsebin0 -> 3414 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/responsebin0 -> 2159 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/responsebin0 -> 2409 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/responsebin0 -> 3196 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/responsebin0 -> 6300 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/responsebin0 -> 1870 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/responsebin0 -> 1702 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/responsebin0 -> 1984 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/responsebin0 -> 1300 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/responsebin0 -> 3289 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/responsebin0 -> 1159 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/responsebin0 -> 2461 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/responsebin0 -> 1643 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/responsebin0 -> 1461 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/responsebin0 -> 1477 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/responsebin0 -> 5773 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/responsebin0 -> 3740 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/responsebin0 -> 1834 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/responsebin0 -> 1119 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/responsebin0 -> 2825 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/responsebin0 -> 1625 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/responsebin0 -> 5226 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/responsebin0 -> 2606 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/responsebin0 -> 5535 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/responsebin0 -> 1385 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/responsebin0 -> 1536 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/responsebin0 -> 3756 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/responsebin0 -> 2157 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/responsebin0 -> 2055 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/responsebin0 -> 1251 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/responsebin0 -> 4606 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/responsebin0 -> 1626 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/responsebin0 -> 2171 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/responsebin0 -> 1621 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/responsebin0 -> 1396 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/responsebin0 -> 1239 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/responsebin0 -> 1117 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/responsebin0 -> 2123 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/responsebin0 -> 1224 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/responsebin0 -> 2502 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/responsebin0 -> 1608 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/responsebin0 -> 1860 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/responsebin0 -> 1319 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/responsebin0 -> 1270 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/responsebin0 -> 1254 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/responsebin0 -> 5382 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/responsebin0 -> 1354 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/responsebin0 -> 3771 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/responsebin0 -> 3434 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/responsebin0 -> 1252 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/responsebin0 -> 3387 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/responsebin0 -> 1315 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/responsebin0 -> 1171 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/responsebin0 -> 1600 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/responsebin0 -> 1524 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/responsebin0 -> 1395 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/responsebin0 -> 1372 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/responsebin0 -> 1517 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/responsebin0 -> 6107 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/responsebin0 -> 2064 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/responsebin0 -> 4664 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/responsebin0 -> 3204 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/responsebin0 -> 16546 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/responsebin0 -> 2022 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/responsebin0 -> 5136 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/responsebin0 -> 4832 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/responsebin0 -> 1486 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/responsebin0 -> 1967 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/responsebin0 -> 1780 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/responsebin0 -> 1921 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/responsebin0 -> 1595 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/responsebin0 -> 1516 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/responsebin0 -> 1161 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/responsebin0 -> 1992 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/responsebin0 -> 1605 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/responsebin0 -> 2061 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/responsebin0 -> 3015 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/responsebin0 -> 1826 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/responsebin0 -> 1537 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/responsebin0 -> 1821 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/responsebin0 -> 3633 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/responsebin0 -> 1320 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/responsebin0 -> 1706 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/responsebin0 -> 1308 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/responsebin0 -> 1297 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/responsebin0 -> 21031 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/responsebin0 -> 13615 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/responsebin0 -> 1836 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/responsebin0 -> 2482 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/responsebin0 -> 4284 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/responsebin0 -> 1330 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/responsebin0 -> 2441 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/responsebin0 -> 2294 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/responsebin0 -> 1512 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/responsebin0 -> 1954 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/responsebin0 -> 1869 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/responsebin0 -> 2709 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/responsebin0 -> 3765 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/responsebin0 -> 2749 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/responsebin0 -> 3469 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/responsebin0 -> 1331 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/responsebin0 -> 5461 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/responsebin0 -> 3413 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/responsebin0 -> 4325 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/responsebin0 -> 5867 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/responsebin0 -> 1988 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/responsebin0 -> 1320 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/responsebin0 -> 2220 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/responsebin0 -> 1463 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/responsebin0 -> 6529 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/responsebin0 -> 5082 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/responsebin0 -> 1145 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/responsebin0 -> 5744 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/responsebin0 -> 1803 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/responsebin0 -> 9093 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/responsebin0 -> 2604 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/responsebin0 -> 5383 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/responsebin0 -> 2169 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/responsebin0 -> 2172 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/responsebin0 -> 1396 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/responsebin0 -> 1449 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/responsebin0 -> 3610 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/responsebin0 -> 2161 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/responsebin0 -> 2154 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/responsebin0 -> 4127 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/responsebin0 -> 1210 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/responsebin0 -> 3197 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/responsebin0 -> 14818 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/responsebin0 -> 8060 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/responsebin0 -> 2676 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/responsebin0 -> 1262 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/responsebin0 -> 2507 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/responsebin0 -> 1939 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/responsebin0 -> 2867 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/responsebin0 -> 4641 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/responsebin0 -> 3976 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/responsebin0 -> 1380 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/responsebin0 -> 984 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/responsebin0 -> 2411 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/responsebin0 -> 5490 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/responsebin0 -> 1758 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/responsebin0 -> 3024 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/responsebin0 -> 1320 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/responsebin0 -> 2482 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/responsebin0 -> 1127 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/responsebin0 -> 2152 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/responsebin0 -> 1120 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/responsebin0 -> 1314 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/responsebin0 -> 3248 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/responsebin0 -> 1203 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/responsebin0 -> 1367 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/responsebin0 -> 4119 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/responsebin0 -> 2902 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/responsebin0 -> 1730 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/responsebin0 -> 1797 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/responsebin0 -> 2483 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/responsebin0 -> 1959 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/responsebin0 -> 4223 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/responsebin0 -> 1118 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/responsebin0 -> 1384 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/responsebin0 -> 2820 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/responsebin0 -> 2282 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/responsebin0 -> 4085 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/responsebin0 -> 1784 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/responsebin0 -> 1799 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/responsebin0 -> 1944 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/responsebin0 -> 1885 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/responsebin0 -> 2003 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/responsebin0 -> 1922 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/responsebin0 -> 2839 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/responsebin0 -> 1309 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/responsebin0 -> 2733 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/responsebin0 -> 1267 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/responsebin0 -> 1863 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/responsebin0 -> 3049 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/responsebin0 -> 1924 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/responsebin0 -> 1918 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/responsebin0 -> 2032 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/responsebin0 -> 1752 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/responsebin0 -> 3434 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/responsebin0 -> 1537 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/responsebin0 -> 4840181 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/responsebin0 -> 288578 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/responsebin0 -> 290666 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/responsebin0 -> 280901 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/responsebin0 -> 46952 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/responsebin0 -> 97089 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/responsebin0 -> 62275 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/responsebin0 -> 60267 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/responsebin0 -> 11073 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/responsebin0 -> 26949 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/responsebin0 -> 135492 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/responsebin0 -> 230247 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/responsebin0 -> 19265 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/responsebin0 -> 93544 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/responsebin0 -> 17766 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/responsebin0 -> 91457 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/responsebin0 -> 37697 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/responsebin0 -> 38721 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/responsebin0 -> 370024 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/responsebin0 -> 121705 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/responsebin0 -> 55142 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/responsebin0 -> 152423 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/responsebin0 -> 13633 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/responsebin0 -> 1425 bytes
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/request7
-rw-r--r--spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/responsebin0 -> 3248225 bytes
-rw-r--r--spec/bundler/support/artifice/windows.rb1
-rw-r--r--spec/bundler/support/builders.rb30
-rw-r--r--spec/bundler/support/code_climate.rb1
-rw-r--r--spec/bundler/support/command_execution.rb57
-rw-r--r--spec/bundler/support/hax.rb14
-rw-r--r--spec/bundler/support/helpers.rb146
-rw-r--r--spec/bundler/support/indexes.rb70
-rw-r--r--spec/bundler/support/less_than_proc.rb1
-rw-r--r--spec/bundler/support/manpages.rb14
-rw-r--r--spec/bundler/support/matchers.rb34
-rw-r--r--spec/bundler/support/path.rb10
-rw-r--r--spec/bundler/support/permissions.rb1
-rw-r--r--spec/bundler/support/platforms.rb18
-rw-r--r--spec/bundler/support/rubygems_ext.rb6
-rw-r--r--spec/bundler/support/silent_logger.rb1
-rw-r--r--spec/bundler/support/sometimes.rb1
-rw-r--r--spec/bundler/support/streams.rb1
-rw-r--r--spec/bundler/support/sudo.rb1
-rw-r--r--spec/bundler/support/the_bundle.rb1
-rw-r--r--spec/bundler/update/gems/post_install_spec.rb5
-rw-r--r--spec/bundler/update/git_spec.rb75
-rw-r--r--spec/bundler/update/path_spec.rb1
1025 files changed, 13886 insertions, 3164 deletions
diff --git a/bin/bundle b/bin/bundle
index cf03a523ab..aaf773745d 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -23,7 +23,7 @@ Bundler.with_friendly_errors do
require "bundler/cli"
# Allow any command to use --help flag to show help for that command
- help_flags = %w(--help -h)
+ help_flags = %w[--help -h]
help_flag_used = ARGV.any? {|a| help_flags.include? a }
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
diff --git a/common.mk b/common.mk
index d09a583d2f..8114ed2ec0 100644
--- a/common.mk
+++ b/common.mk
@@ -1185,7 +1185,7 @@ test-bundler: $(TEST_RUNNABLE)-test-bundler
yes-test-bundler: yes-test-bundler-prepare
$(gnumake_recursive)$(Q) \
$(XRUBY) -C $(srcdir) -Ispec/bundler .bundle/bin/rspec \
- $(RSPECOPTS) spec/bundler/$(BUNDLER_SPECS)
+ --require spec_helper $(RSPECOPTS) spec/bundler/$(BUNDLER_SPECS)
no-test-bundler:
UNICODE_FILES = $(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
diff --git a/lib/bundler.gemspec b/lib/bundler.gemspec
index 49f82ba3cb..b3dff1ef14 100644
--- a/lib/bundler.gemspec
+++ b/lib/bundler.gemspec
@@ -1,8 +1,8 @@
# coding: utf-8
# frozen_string_literal: true
-lib = File.expand_path("../lib/", __FILE__)
-$:.unshift lib unless $:.include?(lib)
-require "bundler/version"
+
+require File.expand_path("../bundler/version", __FILE__)
+require "shellwords"
Gem::Specification.new do |s|
s.name = "bundler"
@@ -27,225 +27,315 @@ Gem::Specification.new do |s|
}
end
- s.required_ruby_version = ">= 1.8.7"
- s.required_rubygems_version = ">= 1.3.6"
+ if s.version >= Gem::Version.new("2.a".dup)
+ s.required_ruby_version = ">= 2.3.0"
+ s.required_rubygems_version = ">= 2.5.0"
+ else
+ s.required_ruby_version = ">= 1.8.7"
+ s.required_rubygems_version = ">= 1.3.6"
+ end
s.add_development_dependency "automatiek", "~> 0.1.0"
s.add_development_dependency "mustache", "0.99.6"
s.add_development_dependency "rake", "~> 10.0"
s.add_development_dependency "rdiscount", "~> 2.2"
s.add_development_dependency "ronn", "~> 0.7.3"
- s.add_development_dependency "rspec", "~> 3.5"
+ s.add_development_dependency "rspec", "~> 3.6"
- s.files = [
- "lib/bundler.gemspec",
- "bin/bundle",
- "bin/bundle_ruby",
- "bin/bundler",
- "lib/bundler.rb",
- "lib/bundler/capistrano.rb",
- "lib/bundler/cli.rb",
- "lib/bundler/cli/add.rb",
- "lib/bundler/cli/binstubs.rb",
- "lib/bundler/cli/cache.rb",
- "lib/bundler/cli/check.rb",
- "lib/bundler/cli/clean.rb",
- "lib/bundler/cli/common.rb",
- "lib/bundler/cli/config.rb",
- "lib/bundler/cli/console.rb",
- "lib/bundler/cli/doctor.rb",
- "lib/bundler/cli/exec.rb",
- "lib/bundler/cli/gem.rb",
- "lib/bundler/cli/info.rb",
- "lib/bundler/cli/init.rb",
- "lib/bundler/cli/inject.rb",
- "lib/bundler/cli/install.rb",
- "lib/bundler/cli/issue.rb",
- "lib/bundler/cli/lock.rb",
- "lib/bundler/cli/open.rb",
- "lib/bundler/cli/outdated.rb",
- "lib/bundler/cli/package.rb",
- "lib/bundler/cli/platform.rb",
- "lib/bundler/cli/plugin.rb",
- "lib/bundler/cli/pristine.rb",
- "lib/bundler/cli/show.rb",
- "lib/bundler/cli/update.rb",
- "lib/bundler/cli/viz.rb",
- "lib/bundler/compact_index_client.rb",
- "lib/bundler/compact_index_client/cache.rb",
- "lib/bundler/compact_index_client/updater.rb",
- "lib/bundler/constants.rb",
- "lib/bundler/current_ruby.rb",
- "lib/bundler/definition.rb",
- "lib/bundler/dep_proxy.rb",
- "lib/bundler/dependency.rb",
- "lib/bundler/deployment.rb",
- "lib/bundler/deprecate.rb",
- "lib/bundler/dsl.rb",
- "lib/bundler/endpoint_specification.rb",
- "lib/bundler/env.rb",
- "lib/bundler/environment_preserver.rb",
- "lib/bundler/errors.rb",
- "lib/bundler/feature_flag.rb",
- "lib/bundler/fetcher.rb",
- "lib/bundler/fetcher/base.rb",
- "lib/bundler/fetcher/compact_index.rb",
- "lib/bundler/fetcher/dependency.rb",
- "lib/bundler/fetcher/downloader.rb",
- "lib/bundler/fetcher/index.rb",
- "lib/bundler/friendly_errors.rb",
- "lib/bundler/gem_helper.rb",
- "lib/bundler/gem_helpers.rb",
- "lib/bundler/gem_remote_fetcher.rb",
- "lib/bundler/gem_tasks.rb",
- "lib/bundler/gem_version_promoter.rb",
- "lib/bundler/gemdeps.rb",
- "lib/bundler/graph.rb",
- "lib/bundler/index.rb",
- "lib/bundler/injector.rb",
- "lib/bundler/inline.rb",
- "lib/bundler/installer.rb",
- "lib/bundler/installer/gem_installer.rb",
- "lib/bundler/installer/parallel_installer.rb",
- "lib/bundler/installer/standalone.rb",
- "lib/bundler/lazy_specification.rb",
- "lib/bundler/lockfile_parser.rb",
- "lib/bundler/match_platform.rb",
- "lib/bundler/mirror.rb",
- "lib/bundler/plugin.rb",
- "lib/bundler/plugin/api.rb",
- "lib/bundler/plugin/api/source.rb",
- "lib/bundler/plugin/dsl.rb",
- "lib/bundler/plugin/index.rb",
- "lib/bundler/plugin/installer.rb",
- "lib/bundler/plugin/installer/git.rb",
- "lib/bundler/plugin/installer/rubygems.rb",
- "lib/bundler/plugin/source_list.rb",
- "lib/bundler/psyched_yaml.rb",
- "lib/bundler/remote_specification.rb",
- "lib/bundler/resolver.rb",
- "lib/bundler/retry.rb",
- "lib/bundler/ruby_dsl.rb",
- "lib/bundler/ruby_version.rb",
- "lib/bundler/rubygems_ext.rb",
- "lib/bundler/rubygems_gem_installer.rb",
- "lib/bundler/rubygems_integration.rb",
- "lib/bundler/runtime.rb",
- "lib/bundler/settings.rb",
- "lib/bundler/setup.rb",
- "lib/bundler/shared_helpers.rb",
- "lib/bundler/similarity_detector.rb",
- "lib/bundler/source.rb",
- "lib/bundler/source/gemspec.rb",
- "lib/bundler/source/git.rb",
- "lib/bundler/source/git/git_proxy.rb",
- "lib/bundler/source/path.rb",
- "lib/bundler/source/path/installer.rb",
- "lib/bundler/source/rubygems.rb",
- "lib/bundler/source/rubygems/remote.rb",
- "lib/bundler/source_list.rb",
- "lib/bundler/spec_set.rb",
- "lib/bundler/ssl_certs/.document",
- "lib/bundler/ssl_certs/certificate_manager.rb",
- "lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem",
- "lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem",
- "lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem",
- "lib/bundler/stub_specification.rb",
- "lib/bundler/templates/Executable",
- "lib/bundler/templates/Executable.standalone",
- "lib/bundler/templates/Gemfile",
- "lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt",
- "lib/bundler/templates/newgem/Gemfile.tt",
- "lib/bundler/templates/newgem/LICENSE.txt.tt",
- "lib/bundler/templates/newgem/README.md.tt",
- "lib/bundler/templates/newgem/Rakefile.tt",
- "lib/bundler/templates/newgem/bin/console.tt",
- "lib/bundler/templates/newgem/bin/setup.tt",
- "lib/bundler/templates/newgem/exe/newgem.tt",
- "lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt",
- "lib/bundler/templates/newgem/ext/newgem/newgem.c.tt",
- "lib/bundler/templates/newgem/ext/newgem/newgem.h.tt",
- "lib/bundler/templates/newgem/gitignore.tt",
- "lib/bundler/templates/newgem/lib/newgem.rb.tt",
- "lib/bundler/templates/newgem/lib/newgem/version.rb.tt",
- "lib/bundler/templates/newgem/newgem.gemspec.tt",
- "lib/bundler/templates/newgem/rspec.tt",
- "lib/bundler/templates/newgem/spec/newgem_spec.rb.tt",
- "lib/bundler/templates/newgem/spec/spec_helper.rb.tt",
- "lib/bundler/templates/newgem/test/newgem_test.rb.tt",
- "lib/bundler/templates/newgem/test/test_helper.rb.tt",
- "lib/bundler/templates/newgem/travis.yml.tt",
- "lib/bundler/ui.rb",
- "lib/bundler/ui/rg_proxy.rb",
- "lib/bundler/ui/shell.rb",
- "lib/bundler/ui/silent.rb",
- "lib/bundler/uri_credentials_filter.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/errors.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb",
- "lib/bundler/vendor/molinillo/lib/molinillo/state.rb",
- "lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb",
- "lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb",
- "lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb",
- "lib/bundler/vendor/thor/lib/thor.rb",
- "lib/bundler/vendor/thor/lib/thor/actions.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/create_file.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/create_link.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/directory.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb",
- "lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb",
- "lib/bundler/vendor/thor/lib/thor/base.rb",
- "lib/bundler/vendor/thor/lib/thor/command.rb",
- "lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb",
- "lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb",
- "lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb",
- "lib/bundler/vendor/thor/lib/thor/error.rb",
- "lib/bundler/vendor/thor/lib/thor/group.rb",
- "lib/bundler/vendor/thor/lib/thor/invocation.rb",
- "lib/bundler/vendor/thor/lib/thor/line_editor.rb",
- "lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb",
- "lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb",
- "lib/bundler/vendor/thor/lib/thor/parser.rb",
- "lib/bundler/vendor/thor/lib/thor/parser/argument.rb",
- "lib/bundler/vendor/thor/lib/thor/parser/arguments.rb",
- "lib/bundler/vendor/thor/lib/thor/parser/option.rb",
- "lib/bundler/vendor/thor/lib/thor/parser/options.rb",
- "lib/bundler/vendor/thor/lib/thor/rake_compat.rb",
- "lib/bundler/vendor/thor/lib/thor/runner.rb",
- "lib/bundler/vendor/thor/lib/thor/shell.rb",
- "lib/bundler/vendor/thor/lib/thor/shell/basic.rb",
- "lib/bundler/vendor/thor/lib/thor/shell/color.rb",
- "lib/bundler/vendor/thor/lib/thor/shell/html.rb",
- "lib/bundler/vendor/thor/lib/thor/util.rb",
- "lib/bundler/vendor/thor/lib/thor/version.rb",
- "lib/bundler/vendored_molinillo.rb",
- "lib/bundler/vendored_persistent.rb",
- "lib/bundler/vendored_thor.rb",
- "lib/bundler/version.rb",
- "lib/bundler/version_ranges.rb",
- "lib/bundler/vlad.rb",
- "lib/bundler/worker.rb",
- "lib/bundler/yaml_serializer.rb"
+ s.files = %w[
+ exe/bundle
+ exe/bundle_ruby
+ exe/bundler
+ lib/bundler.rb
+ lib/bundler/build_metadata.rb
+ lib/bundler/capistrano.rb
+ lib/bundler/cli.rb
+ lib/bundler/cli/add.rb
+ lib/bundler/cli/binstubs.rb
+ lib/bundler/cli/cache.rb
+ lib/bundler/cli/check.rb
+ lib/bundler/cli/clean.rb
+ lib/bundler/cli/common.rb
+ lib/bundler/cli/config.rb
+ lib/bundler/cli/console.rb
+ lib/bundler/cli/doctor.rb
+ lib/bundler/cli/exec.rb
+ lib/bundler/cli/gem.rb
+ lib/bundler/cli/info.rb
+ lib/bundler/cli/init.rb
+ lib/bundler/cli/inject.rb
+ lib/bundler/cli/install.rb
+ lib/bundler/cli/issue.rb
+ lib/bundler/cli/list.rb
+ lib/bundler/cli/lock.rb
+ lib/bundler/cli/open.rb
+ lib/bundler/cli/outdated.rb
+ lib/bundler/cli/package.rb
+ lib/bundler/cli/platform.rb
+ lib/bundler/cli/plugin.rb
+ lib/bundler/cli/pristine.rb
+ lib/bundler/cli/show.rb
+ lib/bundler/cli/update.rb
+ lib/bundler/cli/viz.rb
+ lib/bundler/compact_index_client.rb
+ lib/bundler/compact_index_client/cache.rb
+ lib/bundler/compact_index_client/updater.rb
+ lib/bundler/compatibility_guard.rb
+ lib/bundler/constants.rb
+ lib/bundler/current_ruby.rb
+ lib/bundler/definition.rb
+ lib/bundler/dep_proxy.rb
+ lib/bundler/dependency.rb
+ lib/bundler/deployment.rb
+ lib/bundler/deprecate.rb
+ lib/bundler/dsl.rb
+ lib/bundler/endpoint_specification.rb
+ lib/bundler/env.rb
+ lib/bundler/environment_preserver.rb
+ lib/bundler/errors.rb
+ lib/bundler/feature_flag.rb
+ lib/bundler/fetcher.rb
+ lib/bundler/fetcher/base.rb
+ lib/bundler/fetcher/compact_index.rb
+ lib/bundler/fetcher/dependency.rb
+ lib/bundler/fetcher/downloader.rb
+ lib/bundler/fetcher/index.rb
+ lib/bundler/friendly_errors.rb
+ lib/bundler/gem_helper.rb
+ lib/bundler/gem_helpers.rb
+ lib/bundler/gem_remote_fetcher.rb
+ lib/bundler/gem_tasks.rb
+ lib/bundler/gem_version_promoter.rb
+ lib/bundler/gemdeps.rb
+ lib/bundler/graph.rb
+ lib/bundler/index.rb
+ lib/bundler/injector.rb
+ lib/bundler/inline.rb
+ lib/bundler/installer.rb
+ lib/bundler/installer/gem_installer.rb
+ lib/bundler/installer/parallel_installer.rb
+ lib/bundler/installer/standalone.rb
+ lib/bundler/lazy_specification.rb
+ lib/bundler/lockfile_generator.rb
+ lib/bundler/lockfile_parser.rb
+ lib/bundler/match_platform.rb
+ lib/bundler/mirror.rb
+ lib/bundler/plugin.rb
+ lib/bundler/plugin/api.rb
+ lib/bundler/plugin/api/source.rb
+ lib/bundler/plugin/dsl.rb
+ lib/bundler/plugin/index.rb
+ lib/bundler/plugin/installer.rb
+ lib/bundler/plugin/installer/git.rb
+ lib/bundler/plugin/installer/rubygems.rb
+ lib/bundler/plugin/source_list.rb
+ lib/bundler/process_lock.rb
+ lib/bundler/psyched_yaml.rb
+ lib/bundler/remote_specification.rb
+ lib/bundler/resolver.rb
+ lib/bundler/resolver/spec_group.rb
+ lib/bundler/retry.rb
+ lib/bundler/ruby_dsl.rb
+ lib/bundler/ruby_version.rb
+ lib/bundler/rubygems_ext.rb
+ lib/bundler/rubygems_gem_installer.rb
+ lib/bundler/rubygems_integration.rb
+ lib/bundler/runtime.rb
+ lib/bundler/settings.rb
+ lib/bundler/settings/validator.rb
+ lib/bundler/setup.rb
+ lib/bundler/shared_helpers.rb
+ lib/bundler/similarity_detector.rb
+ lib/bundler/source.rb
+ lib/bundler/source/gemspec.rb
+ lib/bundler/source/git.rb
+ lib/bundler/source/git/git_proxy.rb
+ lib/bundler/source/metadata.rb
+ lib/bundler/source/path.rb
+ lib/bundler/source/path/installer.rb
+ lib/bundler/source/rubygems.rb
+ lib/bundler/source/rubygems/remote.rb
+ lib/bundler/source_list.rb
+ lib/bundler/spec_set.rb
+ lib/bundler/ssl_certs/.document
+ lib/bundler/ssl_certs/certificate_manager.rb
+ lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem
+ lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem
+ lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem
+ lib/bundler/stub_specification.rb
+ lib/bundler/templates/Executable
+ lib/bundler/templates/Executable.bundler
+ lib/bundler/templates/Executable.standalone
+ lib/bundler/templates/Gemfile
+ lib/bundler/templates/gems.rb
+ lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
+ lib/bundler/templates/newgem/Gemfile.tt
+ lib/bundler/templates/newgem/LICENSE.txt.tt
+ lib/bundler/templates/newgem/README.md.tt
+ lib/bundler/templates/newgem/Rakefile.tt
+ lib/bundler/templates/newgem/bin/console.tt
+ lib/bundler/templates/newgem/bin/setup.tt
+ lib/bundler/templates/newgem/exe/newgem.tt
+ lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt
+ lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
+ lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
+ lib/bundler/templates/newgem/gitignore.tt
+ lib/bundler/templates/newgem/lib/newgem.rb.tt
+ lib/bundler/templates/newgem/lib/newgem/version.rb.tt
+ lib/bundler/templates/newgem/newgem.gemspec.tt
+ lib/bundler/templates/newgem/rspec.tt
+ lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
+ lib/bundler/templates/newgem/spec/spec_helper.rb.tt
+ lib/bundler/templates/newgem/test/newgem_test.rb.tt
+ lib/bundler/templates/newgem/test/test_helper.rb.tt
+ lib/bundler/templates/newgem/travis.yml.tt
+ lib/bundler/ui.rb
+ lib/bundler/ui/rg_proxy.rb
+ lib/bundler/ui/shell.rb
+ lib/bundler/ui/silent.rb
+ lib/bundler/uri_credentials_filter.rb
+ lib/bundler/vendor/fileutils/lib/fileutils.rb
+ lib/bundler/vendor/molinillo/lib/molinillo.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
+ lib/bundler/vendor/molinillo/lib/molinillo/state.rb
+ lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb
+ lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
+ lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb
+ lib/bundler/vendor/thor/lib/thor.rb
+ lib/bundler/vendor/thor/lib/thor/actions.rb
+ lib/bundler/vendor/thor/lib/thor/actions/create_file.rb
+ lib/bundler/vendor/thor/lib/thor/actions/create_link.rb
+ lib/bundler/vendor/thor/lib/thor/actions/directory.rb
+ lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb
+ lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb
+ lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
+ lib/bundler/vendor/thor/lib/thor/base.rb
+ lib/bundler/vendor/thor/lib/thor/command.rb
+ lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
+ lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
+ lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb
+ lib/bundler/vendor/thor/lib/thor/error.rb
+ lib/bundler/vendor/thor/lib/thor/group.rb
+ lib/bundler/vendor/thor/lib/thor/invocation.rb
+ lib/bundler/vendor/thor/lib/thor/line_editor.rb
+ lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
+ lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb
+ lib/bundler/vendor/thor/lib/thor/parser.rb
+ lib/bundler/vendor/thor/lib/thor/parser/argument.rb
+ lib/bundler/vendor/thor/lib/thor/parser/arguments.rb
+ lib/bundler/vendor/thor/lib/thor/parser/option.rb
+ lib/bundler/vendor/thor/lib/thor/parser/options.rb
+ lib/bundler/vendor/thor/lib/thor/rake_compat.rb
+ lib/bundler/vendor/thor/lib/thor/runner.rb
+ lib/bundler/vendor/thor/lib/thor/shell.rb
+ lib/bundler/vendor/thor/lib/thor/shell/basic.rb
+ lib/bundler/vendor/thor/lib/thor/shell/color.rb
+ lib/bundler/vendor/thor/lib/thor/shell/html.rb
+ lib/bundler/vendor/thor/lib/thor/util.rb
+ lib/bundler/vendor/thor/lib/thor/version.rb
+ lib/bundler/vendored_fileutils.rb
+ lib/bundler/vendored_molinillo.rb
+ lib/bundler/vendored_persistent.rb
+ lib/bundler/vendored_thor.rb
+ lib/bundler/version.rb
+ lib/bundler/version_ranges.rb
+ lib/bundler/vlad.rb
+ lib/bundler/worker.rb
+ lib/bundler/yaml_serializer.rb
+ man/bundle-platform.1
+ man/bundle-update.1
+ man/bundle-init.1.txt
+ man/bundle-info.ronn
+ man/bundle-gem.ronn
+ man/bundle-add.1.txt
+ man/bundle-list.ronn
+ man/bundle-info.1
+ man/bundle-init.1
+ man/bundle-outdated.ronn
+ man/bundle-init.ronn
+ man/bundle.1
+ man/bundle-show.1.txt
+ man/bundle-exec.1
+ man/bundle-install.1.txt
+ man/bundle-binstubs.1.txt
+ man/bundle-open.1.txt
+ man/index.txt
+ man/bundle-pristine.ronn
+ man/bundle-install.1
+ man/bundle-inject.ronn
+ man/bundle-list.1
+ man/bundle-outdated.1.txt
+ man/bundle-list.1.txt
+ man/bundle-update.ronn
+ man/bundle-clean.1.txt
+ man/bundle-show.ronn
+ man/bundle-pristine.1.txt
+ man/bundle-outdated.1
+ man/bundle-check.1
+ man/bundle-show.1
+ man/gemfile.5
+ man/bundle-gem.1
+ man/bundle-install.ronn
+ man/bundle-gem.1.txt
+ man/bundle-open.1
+ man/bundle-add.ronn
+ man/bundle-lock.1.txt
+ man/bundle-open.ronn
+ man/bundle-lock.1
+ man/bundle-exec.ronn
+ man/bundle-check.ronn
+ man/bundle-info.1.txt
+ man/bundle-lock.ronn
+ man/bundle-pristine.1
+ man/bundle-viz.1.txt
+ man/bundle.ronn
+ man/bundle-platform.ronn
+ man/bundle-binstubs.ronn
+ man/bundle-exec.1.txt
+ man/bundle.1.txt
+ man/bundle-config.1.txt
+ man/bundle-package.1.txt
+ man/bundle-platform.1.txt
+ man/bundle-binstubs.1
+ man/bundle-viz.1
+ man/bundle-clean.ronn
+ man/bundle-package.1
+ man/bundle-add.1
+ man/bundle-config.1
+ man/bundle-package.ronn
+ man/bundle-viz.ronn
+ man/bundle-check.1.txt
+ man/bundle-clean.1
+ man/gemfile.5.txt
+ man/bundle-inject.1
+ man/gemfile.5.ronn
+ man/bundle-config.ronn
+ man/bundle-inject.1.txt
+ man/bundle-update.1.txt
+ CHANGELOG.md
+ LICENSE.md
+ README.md
]
s.bindir = "exe"
- s.executables = %w(bundle bundler)
+ s.executables = %w[bundle bundler]
s.require_paths = ["lib"]
end
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 88822f8f1a..bef2caabcf 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -1,9 +1,11 @@
# frozen_string_literal: true
-require "fileutils"
+
+require "bundler/compatibility_guard"
+
+require "bundler/vendored_fileutils"
require "pathname"
require "rbconfig"
require "thread"
-require "tmpdir"
require "bundler/errors"
require "bundler/environment_preserver"
@@ -13,9 +15,10 @@ require "bundler/rubygems_integration"
require "bundler/version"
require "bundler/constants"
require "bundler/current_ruby"
+require "bundler/build_metadata"
module Bundler
- environment_preserver = EnvironmentPreserver.new(ENV, %w(PATH GEM_PATH))
+ environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
ORIGINAL_ENV = environment_preserver.restore
ENV.replace(environment_preserver.backup)
SUDO_MUTEX = Mutex.new
@@ -40,6 +43,7 @@ module Bundler
autoload :LazySpecification, "bundler/lazy_specification"
autoload :LockfileParser, "bundler/lockfile_parser"
autoload :MatchPlatform, "bundler/match_platform"
+ autoload :ProcessLock, "bundler/process_lock"
autoload :RemoteSpecification, "bundler/remote_specification"
autoload :Resolver, "bundler/resolver"
autoload :Retry, "bundler/retry"
@@ -58,8 +62,6 @@ module Bundler
autoload :VersionRanges, "bundler/version_ranges"
class << self
- attr_writer :bundle_path
-
def configure
@configured ||= configure_gem_home_and_path
end
@@ -75,7 +77,11 @@ module Bundler
# Returns absolute path of where gems are installed on the filesystem.
def bundle_path
- @bundle_path ||= Pathname.new(settings.path).expand_path(root)
+ @bundle_path ||= Pathname.new(configured_bundle_path.path).expand_path(root)
+ end
+
+ def configured_bundle_path
+ @configured_bundle_path ||= settings.path.tap(&:validate!)
end
# Returns absolute location of where binstubs are installed to.
@@ -113,7 +119,7 @@ module Bundler
end
def environment
- SharedHelpers.major_deprecation "Bundler.environment has been removed in favor of Bundler.load"
+ SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
load
end
@@ -130,6 +136,12 @@ module Bundler
end
end
+ def frozen?
+ frozen = settings[:deployment]
+ frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
+ frozen
+ end
+
def locked_gems
@locked_gems ||=
if defined?(@definition) && @definition
@@ -168,6 +180,7 @@ module Bundler
def tmp_home_path(login, warning)
login ||= "unknown"
+ Kernel.send(:require, "tmpdir")
path = Pathname.new(Dir.tmpdir).join("bundler", "home")
SharedHelpers.filesystem_access(path) do |tmp_home_path|
unless tmp_home_path.exist?
@@ -196,17 +209,13 @@ module Bundler
bundle_path.join("specifications")
end
- def cache
- bundle_path.join("cache/bundler")
- end
-
def user_cache
user_bundle_path.join("cache")
end
def root
@root ||= begin
- default_gemfile.dirname.expand_path
+ SharedHelpers.root
rescue GemfileNotFound
bundle_dir = default_bundle_dir
raise GemfileNotFound, "Could not locate Gemfile or .bundle/ directory" unless bundle_dir
@@ -215,8 +224,8 @@ module Bundler
end
def app_config_path
- if ENV["BUNDLE_APP_CONFIG"]
- Pathname.new(ENV["BUNDLE_APP_CONFIG"]).expand_path(root)
+ if app_config = ENV["BUNDLE_APP_CONFIG"]
+ Pathname.new(app_config).expand_path(root)
else
root.join(".bundle")
end
@@ -224,10 +233,11 @@ module Bundler
def app_cache(custom_path = nil)
path = custom_path || root
- path.join(settings.app_cache_path)
+ Pathname.new(path).join(settings.app_cache_path)
end
def tmp(name = Process.pid.to_s)
+ Kernel.send(:require, "tmpdir")
Pathname.new(Dir.mktmpdir(["bundler", name]))
end
@@ -257,7 +267,7 @@ EOF
# @deprecated Use `original_env` instead
# @return [Hash] Environment with all bundler-related variables removed
def clean_env
- Bundler::SharedHelpers.major_deprecation("`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
+ Bundler::SharedHelpers.major_deprecation(2, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
env = original_env
if env.key?("BUNDLER_ORIG_MANPATH")
@@ -313,21 +323,25 @@ EOF
end
def system_bindir
- # Gem.bindir doesn't always return the location that Rubygems will install
- # system binaries. If you put '-n foo' in your .gemrc, Rubygems will
- # install binstubs there instead. Unfortunately, Rubygems doesn't expose
+ # Gem.bindir doesn't always return the location that RubyGems will install
+ # system binaries. If you put '-n foo' in your .gemrc, RubyGems will
+ # install binstubs there instead. Unfortunately, RubyGems doesn't expose
# that directory at all, so rather than parse .gemrc ourselves, we allow
# the directory to be set as well, via `bundle config bindir foo`.
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
end
+ def use_system_gems?
+ configured_bundle_path.use_system_gems?
+ end
+
def requires_sudo?
return @requires_sudo if defined?(@requires_sudo_ran)
sudo_present = which "sudo" if settings.allow_sudo?
if sudo_present
- # the bundle path and subdirectories need to be writable for Rubygems
+ # the bundle path and subdirectories need to be writable for RubyGems
# to be able to unpack and install gems without exploding
path = bundle_path
path = path.parent until path.exist?
@@ -449,14 +463,17 @@ EOF
end
def reset_paths!
- @root = nil
- @settings = nil
+ @bin_path = nil
+ @bundler_major_version = nil
+ @bundle_path = nil
+ @configured = nil
+ @configured_bundle_path = nil
@definition = nil
- @setup = nil
@load = nil
@locked_gems = nil
- @bundle_path = nil
- @bin_path = nil
+ @root = nil
+ @settings = nil
+ @setup = nil
@user_home = nil
end
@@ -470,6 +487,8 @@ EOF
private
def eval_yaml_gemspec(path, contents)
+ Kernel.send(:require, "bundler/psyched_yaml")
+
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
Gem::Specification.from_yaml(contents)
@@ -478,7 +497,7 @@ EOF
end
def eval_gemspec(path, contents)
- eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s)
+ eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s)
rescue ScriptError, StandardError => e
msg = "There was an error while loading `#{path.basename}`: #{e.message}"
@@ -495,14 +514,14 @@ EOF
bundle_path
end
- def configure_gem_path(env = ENV, settings = self.settings)
+ def configure_gem_path(env = ENV)
blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
- if settings[:disable_shared_gems]
+ if !use_system_gems?
# this needs to be empty string to cause
# PathSupport.split_gem_path to only load up the
# Bundler --path setting as the GEM_PATH.
env["GEM_PATH"] = ""
- elsif blank_home || Bundler.rubygems.gem_dir != bundle_path.to_s
+ elsif blank_home
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
paths = possibles.flatten.compact.uniq.reject(&:empty?)
env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
@@ -510,14 +529,7 @@ EOF
end
def configure_gem_home
- # TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
- begin
- FileUtils.mkdir_p bundle_path.to_s
- rescue
- nil
- end
-
- ENV["GEM_HOME"] = File.expand_path(bundle_path, root)
+ Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
Bundler.rubygems.clear_paths
end
diff --git a/lib/bundler/build_metadata.rb b/lib/bundler/build_metadata.rb
new file mode 100644
index 0000000000..54436f982d
--- /dev/null
+++ b/lib/bundler/build_metadata.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module Bundler
+ # Represents metadata from when the Bundler gem was built.
+ module BuildMetadata
+ # begin ivars
+ @release = false
+ # end ivars
+
+ # A hash representation of the build metadata.
+ def self.to_h
+ {
+ "Built At" => built_at,
+ "Git SHA" => git_commit_sha,
+ "Released Version" => release?,
+ }
+ end
+
+ # A string representing the date the bundler gem was built.
+ def self.built_at
+ @built_at ||= Time.now.utc.strftime("%Y-%m-%d").freeze
+ end
+
+ # The SHA for the git commit the bundler gem was built from.
+ def self.git_commit_sha
+ @git_commit_sha ||= Dir.chdir(File.expand_path("..", __FILE__)) do
+ `git rev-parse --short HEAD`.strip.freeze
+ end
+ end
+
+ # Whether this is an official release build of Bundler.
+ def self.release?
+ @release
+ end
+ end
+end
diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb
index 7b0bbbd6d2..1b7145b72b 100644
--- a/lib/bundler/capistrano.rb
+++ b/lib/bundler/capistrano.rb
@@ -1,4 +1,9 @@
# frozen_string_literal: true
+
+require "bundler/shared_helpers"
+Bundler::SharedHelpers.major_deprecation 2,
+ "The Bundler task for Capistrano. Please use http://github.com/capistrano/bundler"
+
# Capistrano task for Bundler.
#
# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 03e08e25a1..05e1851c18 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -1,13 +1,18 @@
# frozen_string_literal: true
+
require "bundler"
require "bundler/vendored_thor"
module Bundler
class CLI < Thor
- AUTO_INSTALL_CMDS = %w(show binstubs outdated exec open console licenses clean).freeze
- PARSEABLE_COMMANDS = %w(
+ require "bundler/cli/common"
+
+ package_name "Bundler"
+
+ AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
+ PARSEABLE_COMMANDS = %w[
check config help exec platform show version
- ).freeze
+ ].freeze
def self.start(*)
super
@@ -30,11 +35,11 @@ module Bundler
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
if custom_gemfile && !custom_gemfile.empty?
- ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile)
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
Bundler.reset_paths!
end
- Bundler.settings[:retry] = options[:retry] if options[:retry]
+ Bundler.settings.set_command_option_if_given :retry, options[:retry]
current_cmd = args.last[:current_command].name
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
@@ -42,7 +47,6 @@ module Bundler
raise InvalidOption, e.message
ensure
self.options ||= {}
- Bundler.settings.cli_flags_given = !options.empty?
unprinted_warnings = Bundler.ui.unprinted_warnings
Bundler.ui = UI::Shell.new(options)
Bundler.ui.level = "debug" if options["verbose"]
@@ -57,10 +61,41 @@ module Bundler
end
end
+ def self.deprecated_option(*args, &blk)
+ return if Bundler.feature_flag.forget_cli_options?
+ method_option(*args, &blk)
+ end
+
check_unknown_options!(:except => [:config, :exec])
stop_on_unknown_option! :exec
- default_task :install
+ desc "cli_help", "Prints a summary of bundler commands", :hide => true
+ def cli_help
+ version
+ Bundler.ui.info "\n"
+
+ primary_commands = ["install", "update",
+ Bundler.feature_flag.cache_command_is_package? ? "cache" : "package",
+ "exec", "config", "help"]
+
+ list = self.class.printable_commands(true)
+ by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
+ utilities = by_name.keys.sort - primary_commands
+ primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
+ utilities.map! {|name| by_name[name].first }
+
+ shell.say "Bundler commands:\n\n"
+
+ shell.say " Primary commands:\n"
+ shell.print_table(primary_commands, :indent => 4, :truncate => true)
+ shell.say
+ shell.say " Utilities:\n"
+ shell.print_table(utilities, :indent => 4, :truncate => true)
+ shell.say
+ self.class.send(:class_options_help, shell)
+ end
+ default_task(Bundler.feature_flag.default_cli_command)
+
class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
:desc => "Specify the number of times you wish to attempt network commands"
@@ -107,7 +142,7 @@ module Bundler
Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
dependency listed in the gemspec file to the newly created Gemfile.
D
- method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
+ deprecated_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
def init
require "bundler/cli/init"
Init.new(options.dup).run
@@ -124,7 +159,7 @@ module Bundler
method_option "gemfile", :type => :string, :banner =>
"Use the specified gemfile instead of Gemfile"
method_option "path", :type => :string, :banner =>
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
+ "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
map "c" => "check"
def check
require "bundler/cli/check"
@@ -142,13 +177,13 @@ module Bundler
If the bundle has already been installed, bundler will tell you so and then exit.
D
- method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
+ deprecated_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
"Generate bin stubs for bundled gems to ./bin"
- method_option "clean", :type => :boolean, :banner =>
+ deprecated_option "clean", :type => :boolean, :banner =>
"Run bundle clean automatically after install"
- method_option "deployment", :type => :boolean, :banner =>
+ deprecated_option "deployment", :type => :boolean, :banner =>
"Install using defaults tuned for deployment environments"
- method_option "frozen", :type => :boolean, :banner =>
+ deprecated_option "frozen", :type => :boolean, :banner =>
"Do not allow the Gemfile.lock to be updated after this install"
method_option "full-index", :type => :boolean, :banner =>
"Fall back to using the single-file index of all gems"
@@ -158,28 +193,29 @@ module Bundler
"Specify the number of jobs to run in parallel"
method_option "local", :type => :boolean, :banner =>
"Do not attempt to fetch gems remotely and use the gem cache instead"
- method_option "no-cache", :type => :boolean, :banner =>
+ deprecated_option "no-cache", :type => :boolean, :banner =>
"Don't update the existing gem cache."
- method_option "force", :type => :boolean, :banner =>
+ method_option "redownload", :type => :boolean, :aliases =>
+ [Bundler.feature_flag.forget_cli_options? ? nil : "--force"].compact, :banner =>
"Force downloading every gem."
- method_option "no-prune", :type => :boolean, :banner =>
+ deprecated_option "no-prune", :type => :boolean, :banner =>
"Don't remove stale gems from the cache."
- method_option "path", :type => :string, :banner =>
+ deprecated_option "path", :type => :string, :banner =>
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
method_option "quiet", :type => :boolean, :banner =>
"Only output warnings and errors."
- method_option "shebang", :type => :string, :banner =>
+ deprecated_option "shebang", :type => :string, :banner =>
"Specify a different shebang executable name than the default (usually 'ruby')"
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
"Make a bundle that can work without the Bundler runtime"
- method_option "system", :type => :boolean, :banner =>
+ deprecated_option "system", :type => :boolean, :banner =>
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
method_option "trust-policy", :alias => "P", :type => :string, :banner =>
"Gem trust policy (like gem install -P). Must be one of " +
Bundler.rubygems.security_policy_keys.join("|")
- method_option "without", :type => :array, :banner =>
+ deprecated_option "without", :type => :array, :banner =>
"Exclude gems that are part of the specified named group."
- method_option "with", :type => :array, :banner =>
+ deprecated_option "with", :type => :array, :banner =>
"Include gems that are part of the specified named group."
map "i" => "install"
def install
@@ -189,7 +225,7 @@ module Bundler
end
end
- desc "update [OPTIONS]", "update the current environment"
+ desc "update [OPTIONS]", "Update the current environment"
long_desc <<-D
Update will install the newest versions of the gems listed in the Gemfile. Use
update when you have changed the Gemfile, or if you want to get the newest
@@ -223,6 +259,8 @@ module Bundler
"Do not allow any gem to be updated past latest --patch | --minor | --major"
method_option "conservative", :type => :boolean, :banner =>
"Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
+ method_option "all", :type => :boolean, :banner =>
+ "Update everything."
def update(*gems)
require "bundler/cli/update"
Update.new(options, gems).run
@@ -238,12 +276,24 @@ module Bundler
method_option "outdated", :type => :boolean,
:banner => "Show verbose output including whether gems are outdated."
def show(gem_name = nil)
- Bundler::SharedHelpers.major_deprecation("use `bundle show` instead of `bundle list`") if ARGV[0] == "list"
+ Bundler::SharedHelpers.major_deprecation(2, "use `bundle list` instead of `bundle show`") if ARGV[0] == "show"
require "bundler/cli/show"
Show.new(options, gem_name).run
end
- # TODO: 2.0 remove `bundle list`
- map %w(list) => "show"
+ # TODO: 2.0 remove `bundle show`
+
+ if Bundler.feature_flag.list_command?
+ desc "list", "List all gems in the bundle"
+ method_option "name-only", :type => :boolean, :banner => "print only the gem names"
+ def list
+ require "bundler/cli/list"
+ List.new(options).run
+ end
+
+ map %w[ls] => "list"
+ else
+ map %w[list] => "show"
+ end
desc "info GEM [OPTIONS]", "Show information for the given gem"
method_option "path", :type => :boolean, :banner => "Print full path to gem"
@@ -262,6 +312,8 @@ module Bundler
"Overwrite existing binstubs if they exist"
method_option "path", :type => :string, :lazy_default => "bin", :banner =>
"Binstub destination directory (default bin)"
+ method_option "shebang", :type => :string, :banner =>
+ "Specify a different shebang executable name than the default (usually 'ruby')"
method_option "standalone", :type => :boolean, :banner =>
"Make binstubs that can work without the Bundler runtime"
def binstubs(*gems)
@@ -282,7 +334,7 @@ module Bundler
Add.new(options.dup, gem_name).run
end
- desc "outdated GEM [OPTIONS]", "list installed gems with newer versions available"
+ desc "outdated GEM [OPTIONS]", "List installed gems with newer versions available"
long_desc <<-D
Outdated lists the names and versions of gems that have a newer version available
in the given source. Calling outdated with [GEM [GEM]] will only check for newer
@@ -292,8 +344,8 @@ module Bundler
For more information on patch level options (--major, --minor, --patch,
--update-strict) see documentation on the same options on the update command.
D
- method_option "group", :aliases => "--group", :type => :string, :banner => "List gems from a specific group"
- method_option "groups", :aliases => "--groups", :type => :boolean, :banner => "List gems organized by groups"
+ method_option "group", :type => :string, :banner => "List gems from a specific group"
+ method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
method_option "local", :type => :boolean, :banner =>
"Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
@@ -315,17 +367,27 @@ module Bundler
Outdated.new(options, gems).run
end
- desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
- method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
- method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
- def cache
- require "bundler/cli/cache"
- Cache.new(options).run
+ if Bundler.feature_flag.cache_command_is_package?
+ map %w[cache] => :package
+ else
+ desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
+ unless Bundler.feature_flag.cache_command_is_package?
+ method_option "all", :type => :boolean,
+ :banner => "Include all sources (including path and git)."
+ end
+ method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
+ method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
+ def cache
+ require "bundler/cli/cache"
+ Cache.new(options).run
+ end
end
- desc "package [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
- method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
+ desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
+ unless Bundler.feature_flag.cache_command_is_package?
+ method_option "all", :type => :boolean,
+ :banner => "Include all sources (including path and git)."
+ end
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
method_option "cache-path", :type => :string, :banner =>
"Specify a different cache path than the default (vendor/cache)."
@@ -347,14 +409,14 @@ module Bundler
require "bundler/cli/package"
Package.new(options).run
end
- map %w(pack) => :package
+ map %w[pack] => :package
desc "exec [OPTIONS]", "Run the command in context of the bundle"
method_option :keep_file_descriptors, :type => :boolean, :default => false
long_desc <<-D
Exec runs a command, providing it access to the gems in the bundle. While using
bundle exec you can require and call the bundled gems as if they were installed
- into the system wide Rubygems repository.
+ into the system wide RubyGems repository.
D
map "e" => "exec"
def exec(*args)
@@ -362,7 +424,7 @@ module Bundler
Exec.new(options, args).run
end
- desc "config NAME [VALUE]", "retrieve or set a configuration value"
+ desc "config NAME [VALUE]", "Retrieve or set a configuration value"
long_desc <<-D
Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
existing value with the newly provided one.
@@ -386,18 +448,28 @@ module Bundler
Open.new(options, name).run
end
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
- def console(group = nil)
- # TODO: Remove for 2.0
- require "bundler/cli/console"
- Console.new(options, group).run
+ if Bundler.feature_flag.console_command?
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
+ def console(group = nil)
+ require "bundler/cli/console"
+ Console.new(options, group).run
+ end
end
desc "version", "Prints the bundler's version information"
def version
- Bundler.ui.info "Bundler version #{Bundler::VERSION}"
+ cli_help = current_command.name == "cli_help"
+ if cli_help || ARGV.include?("version")
+ build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
+ end
+
+ if !cli_help && Bundler.feature_flag.print_only_version_number?
+ Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
+ else
+ Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
+ end
end
- map %w(-v --version) => :version
+ map %w[-v --version] => :version
desc "licenses", "Prints the license of all gems in the bundle"
def licenses
@@ -413,7 +485,7 @@ module Bundler
end
end
- desc "viz [OPTIONS]", "Generates a visual dependency graph"
+ desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
long_desc <<-D
Viz generates a PNG file of the current Gemfile as a dependency graph.
Viz requires the ruby-graphviz gem (and its dependencies).
@@ -431,7 +503,7 @@ module Bundler
old_gem = instance_method(:gem)
- desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem"
+ desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
@@ -470,7 +542,7 @@ module Bundler
File.expand_path(File.join(File.dirname(__FILE__), "templates"))
end
- desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
+ desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
method_option "dry-run", :type => :boolean, :default => false, :banner =>
"Only print out changes, do not clean gems"
method_option "force", :type => :boolean, :default => false, :banner =>
@@ -488,13 +560,13 @@ module Bundler
Platform.new(options).run
end
- desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile"
+ desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true
method_option "source", :type => :string, :banner =>
"Install gem from the given source"
method_option "group", :type => :string, :banner =>
"Install gem into a bundler group"
def inject(name, version)
- SharedHelpers.major_deprecation "The `inject` command has been replaced by the `add` command"
+ SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
require "bundler/cli/inject"
Inject.new(options.dup, name, version).run
end
@@ -531,7 +603,7 @@ module Bundler
desc "env", "Print information about the environment Bundler is running under"
def env
- Env.new.write($stdout)
+ Env.write($stdout)
end
desc "doctor [OPTIONS]", "Checks the bundle for common problems"
@@ -555,15 +627,20 @@ module Bundler
Issue.new.run
end
- desc "pristine", "Restores installed gems to pristine condition from files located in the gem cache. Gem installed from a git repository will be issued `git checkout --force`."
- def pristine
+ desc "pristine [GEMS...]", "Restores installed gems to pristine condition"
+ long_desc <<-D
+ Restores installed gems to pristine condition from files located in the
+ gem cache. Gems installed from a git repository will be issued `git
+ checkout --force`.
+ D
+ def pristine(*gems)
require "bundler/cli/pristine"
- Pristine.new.run
+ Pristine.new(gems).run
end
if Bundler.feature_flag.plugins?
require "bundler/cli/plugin"
- desc "plugin SUBCOMMAND ...ARGS", "manage the bundler plugins"
+ desc "plugin", "Manage the bundler plugins"
subcommand "plugin", Plugin
end
@@ -571,14 +648,14 @@ module Bundler
# into the corresponding `bundle help #{command}` call
def self.reformatted_help_args(args)
bundler_commands = all_commands.keys
- help_flags = %w(--help -h)
- exec_commands = %w(e ex exe exec)
+ help_flags = %w[--help -h]
+ exec_commands = %w[e ex exe exec]
help_used = args.index {|a| help_flags.include? a }
exec_used = args.index {|a| exec_commands.include? a }
command = args.find {|a| bundler_commands.include? a }
if exec_used && help_used
if exec_used + help_used == 1
- %w(help exec)
+ %w[help exec]
else
args
end
@@ -613,16 +690,20 @@ module Bundler
end
end
+ def current_command
+ _, _, config = @_initializer
+ config[:current_command]
+ end
+
def print_command
return unless Bundler.ui.debug?
- _, _, config = @_initializer
- current_command = config[:current_command]
- command_name = current_command.name
+ cmd = current_command
+ command_name = cmd.name
return if PARSEABLE_COMMANDS.include?(command_name)
command = ["bundle", command_name] + args
options_to_print = options.dup
options_to_print.delete_if do |k, v|
- next unless o = current_command.options[k]
+ next unless o = cmd.options[k]
o.default == v
end
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
@@ -633,8 +714,6 @@ module Bundler
def warn_on_outdated_bundler
return if Bundler.settings[:disable_version_check]
- _, _, config = @_initializer
- current_command = config[:current_command]
command_name = current_command.name
return if PARSEABLE_COMMANDS.include?(command_name)
@@ -649,8 +728,17 @@ module Bundler
current = Gem::Version.new(VERSION)
return if current >= latest
+ latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
+
+ installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
+ if latest_installed && latest_installed > current
+ suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
+ suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
+ else
+ suggestion = installation
+ end
- Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\nTo update, run `gem install bundler#{" --pre" if latest.prerelease?}`"
+ Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
rescue
nil
end
diff --git a/lib/bundler/cli/add.rb b/lib/bundler/cli/add.rb
index e80c775433..1fcbd22f28 100644
--- a/lib/bundler/cli/add.rb
+++ b/lib/bundler/cli/add.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Add
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
index 95103b7dd8..449204d821 100644
--- a/lib/bundler/cli/binstubs.rb
+++ b/lib/bundler/cli/binstubs.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Binstubs
@@ -11,8 +10,10 @@ module Bundler
def run
Bundler.definition.validate_runtime!
- Bundler.settings[:bin] = options["path"] if options["path"]
- Bundler.settings[:bin] = nil if options["path"] && options["path"].empty?
+ path_option = options["path"]
+ path_option = nil if path_option && path_option.empty?
+ Bundler.settings.set_command_option :bin, path_option if options["path"]
+ Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
installer = Installer.new(Bundler.root, Bundler.definition)
if gems.empty?
@@ -28,10 +29,11 @@ module Bundler
)
end
- if spec.name == "bundler"
- Bundler.ui.warn "Sorry, Bundler can only be run via Rubygems."
- elsif options[:standalone]
- installer.generate_standalone_bundler_executable_stubs(spec)
+ if options[:standalone]
+ next Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") if gem_name == "bundler"
+ Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do
+ installer.generate_standalone_bundler_executable_stubs(spec)
+ end
else
installer.generate_bundler_executable_stubs(spec, :force => options[:force], :binstubs_cmd => true)
end
diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb
index 5ba105a31d..9d2ba87d34 100644
--- a/lib/bundler/cli/cache.rb
+++ b/lib/bundler/cli/cache.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Cache
attr_reader :options
@@ -10,9 +11,9 @@ module Bundler
Bundler.definition.validate_runtime!
Bundler.definition.resolve_with_cache!
setup_cache_all
- Bundler.settings[:cache_all_platforms] = options["all-platforms"] if options.key?("all-platforms")
+ Bundler.settings.set_command_option_if_given :cache_all_platforms, options["all-platforms"]
Bundler.load.cache
- Bundler.settings[:no_prune] = true if options["no-prune"]
+ Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
Bundler.load.lock
rescue GemNotFound => e
Bundler.ui.error(e.message)
@@ -23,9 +24,9 @@ module Bundler
private
def setup_cache_all
- Bundler.settings[:cache_all] = options[:all] if options.key?("all")
+ Bundler.settings.set_command_option_if_given :cache_all, options[:all]
- if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all]
+ if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
"to package them as well, please pass the --all flag. This will be the default " \
"on Bundler 2.0."
diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb
index 057a7e5695..e572787dc4 100644
--- a/lib/bundler/cli/check.rb
+++ b/lib/bundler/cli/check.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Check
attr_reader :options
@@ -8,10 +9,7 @@ module Bundler
end
def run
- if options[:path]
- Bundler.settings[:path] = File.expand_path(options[:path])
- Bundler.settings[:disable_shared_gems] = true
- end
+ Bundler.settings.set_command_option_if_given :path, options[:path]
begin
definition = Bundler.definition
@@ -28,7 +26,7 @@ module Bundler
not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
Bundler.ui.warn "Install missing gems with `bundle install`"
exit 1
- elsif !Bundler.default_lockfile.file? && Bundler.settings[:frozen]
+ elsif !Bundler.default_lockfile.file? && Bundler.frozen?
Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
exit 1
else
diff --git a/lib/bundler/cli/clean.rb b/lib/bundler/cli/clean.rb
index 5eba09c6bc..4a407fbae7 100644
--- a/lib/bundler/cli/clean.rb
+++ b/lib/bundler/cli/clean.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Clean
attr_reader :options
@@ -15,12 +16,10 @@ module Bundler
protected
def require_path_or_force
- if !Bundler.settings[:path] && !options[:force]
- Bundler.ui.error "Cleaning all the gems on your system is dangerous! " \
- "If you're sure you want to remove every system gem not in this " \
- "bundle, run `bundle clean --force`."
- exit 1
- end
+ return unless Bundler.use_system_gems? && !options[:force]
+ raise InvalidOption, "Cleaning all the gems on your system is dangerous! " \
+ "If you're sure you want to remove every system gem not in this " \
+ "bundle, run `bundle clean --force`."
end
end
end
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb
index bacbb2edc5..9d40ee9dfd 100644
--- a/lib/bundler/cli/common.rb
+++ b/lib/bundler/cli/common.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module CLI::Common
def self.output_post_install_messages(messages)
@@ -14,12 +15,12 @@ module Bundler
end
def self.output_without_groups_message
- return unless Bundler.settings.without.any?
+ return if Bundler.settings[:without].empty?
Bundler.ui.confirm without_groups_message
end
def self.without_groups_message
- groups = Bundler.settings.without
+ groups = Bundler.settings[:without]
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
reject {|s| s.to_s.empty? }.join(" and ")
group_str = (groups.size == 1) ? "group" : "groups"
@@ -89,5 +90,13 @@ module Bundler
def self.patch_level_options(options)
[:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
end
+
+ def self.clean_after_install?
+ clean = Bundler.settings[:clean]
+ return clean unless clean.nil?
+ clean ||= Bundler.feature_flag.auto_clean_without_path? && Bundler.settings[:path].nil?
+ clean &&= !Bundler.use_system_gems?
+ clean
+ end
end
end
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index e8f13620ec..12f71ea8fe 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Config
attr_reader :name, :options, :scope, :thor
@@ -112,7 +113,7 @@ module Bundler
end
def valid_scope?(scope)
- %w(delete local global).include?(scope)
+ %w[delete local global].include?(scope)
end
end
end
diff --git a/lib/bundler/cli/console.rb b/lib/bundler/cli/console.rb
index 715abf2554..853eca8358 100644
--- a/lib/bundler/cli/console.rb
+++ b/lib/bundler/cli/console.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Console
attr_reader :options, :group
@@ -8,7 +9,7 @@ module Bundler
end
def run
- Bundler::SharedHelpers.major_deprecation "bundle console will be replaced " \
+ Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
"by `bin/console` generated by `bundle gem <name>`"
group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
index ae27983240..7f28a5eb13 100644
--- a/lib/bundler/cli/doctor.rb
+++ b/lib/bundler/cli/doctor.rb
@@ -62,6 +62,7 @@ module Bundler
def run
Bundler.ui.level = "error" if options[:quiet]
+ Bundler.settings.validate!
check!
definition = Bundler.definition
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
index 62f7bc26cb..2fdc614fbb 100644
--- a/lib/bundler/cli/exec.rb
+++ b/lib/bundler/cli/exec.rb
@@ -1,11 +1,12 @@
# frozen_string_literal: true
+
require "bundler/current_ruby"
module Bundler
class CLI::Exec
attr_reader :options, :args, :cmd
- RESERVED_SIGNALS = %w(SEGV BUS ILL FPE VTALRM KILL STOP).freeze
+ RESERVED_SIGNALS = %w[SEGV BUS ILL FPE VTALRM KILL STOP].freeze
def initialize(options, args)
@options = options
@@ -72,7 +73,7 @@ module Bundler
signals = Signal.list.keys - RESERVED_SIGNALS
signals.each {|s| trap(s, "DEFAULT") }
Kernel.load(file)
- rescue SystemExit
+ rescue SystemExit, SignalException
raise
rescue Exception => e # rubocop:disable Lint/RescueException
Bundler.ui = ui
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index fed904e9aa..885578e819 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "pathname"
module Bundler
@@ -71,10 +72,10 @@ module Bundler
"bin/setup.tt" => "bin/setup"
}
- executables = %w(
+ executables = %w[
bin/console
bin/setup
- )
+ ]
templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present?
diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
index 4465fba9d4..958b525067 100644
--- a/lib/bundler/cli/info.rb
+++ b/lib/bundler/cli/info.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Info
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
index 8ffd1db41a..50e01f54fb 100644
--- a/lib/bundler/cli/init.rb
+++ b/lib/bundler/cli/init.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Init
attr_reader :options
@@ -7,8 +8,8 @@ module Bundler
end
def run
- if File.exist?("Gemfile")
- Bundler.ui.error "Gemfile already exists at #{SharedHelpers.pwd}/Gemfile"
+ if File.exist?(gemfile)
+ Bundler.ui.error "#{gemfile} already exists at #{File.expand_path(gemfile)}"
exit 1
end
@@ -21,14 +22,24 @@ module Bundler
spec = Bundler.load_gemspec_uncached(gemspec)
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
- File.open("Gemfile", "wb") do |file|
+ File.open(gemfile, "wb") do |file|
file << "# Generated from #{gemspec}\n"
file << spec.to_gemfile
end
else
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
- FileUtils.cp(File.expand_path("../../templates/Gemfile", __FILE__), "Gemfile")
+ FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
+ end
+
+ puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
+ end
+
+ private
+
+ def gemfile
+ @gemfile ||= begin
+ Bundler.default_gemfile
+ rescue GemfileNotFound
+ Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
end
end
end
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
index b17292643f..b00675d348 100644
--- a/lib/bundler/cli/inject.rb
+++ b/lib/bundler/cli/inject.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Inject
attr_reader :options, :name, :version, :group, :source, :gems
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
index ff6bedd9fd..f0b821ed84 100644
--- a/lib/bundler/cli/install.rb
+++ b/lib/bundler/cli/install.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Install
@@ -13,17 +12,9 @@ module Bundler
warn_if_root
- [:with, :without].each do |option|
- if options[option]
- options[option] = options[option].join(":").tr(" ", ":").split(":")
- end
- end
-
- check_for_group_conflicts
-
normalize_groups
- ENV["RB_USER_INSTALL"] = "1" if Bundler::FREEBSD
+ Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
# Disable color in deployment mode
Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
@@ -32,22 +23,28 @@ module Bundler
check_trust_policy
- if options[:deployment] || options[:frozen]
+ if options[:deployment] || options[:frozen] || Bundler.frozen?
unless Bundler.default_lockfile.exist?
- flag = options[:deployment] ? "--deployment" : "--frozen"
- raise ProductionError, "The #{flag} flag requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
+ flag = "--deployment flag" if options[:deployment]
+ flag ||= "--frozen flag" if options[:frozen]
+ flag ||= "deployment setting"
+ raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
"sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
"before deploying."
end
options[:local] = true if Bundler.app_cache.exist?
- Bundler.settings[:frozen] = "1"
+ if Bundler.feature_flag.deployment_means_frozen?
+ Bundler.settings.set_command_option :deployment, true
+ else
+ Bundler.settings.set_command_option :frozen, true
+ end
end
# When install is called with --no-deployment, disable deployment mode
if options[:deployment] == false
- Bundler.settings.delete(:frozen)
+ Bundler.settings.set_command_option :frozen, nil
options[:system] = true
end
@@ -56,7 +53,7 @@ module Bundler
Bundler::Fetcher.disable_endpoint = options["full-index"]
if options["binstubs"]
- Bundler::SharedHelpers.major_deprecation \
+ Bundler::SharedHelpers.major_deprecation 2,
"The --binstubs option will be removed in favor of `bundle binstubs`"
end
@@ -66,24 +63,24 @@ module Bundler
definition.validate_runtime!
installer = Installer.install(Bundler.root, definition, options)
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.settings[:frozen]
+ Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen?
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
Bundler::CLI::Common.output_without_groups_message
- if Bundler.settings[:path]
- absolute_path = File.expand_path(Bundler.settings[:path])
- relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
- Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
- else
+ if Bundler.use_system_gems?
Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
+ else
+ absolute_path = File.expand_path(Bundler.configured_bundle_path.base_path)
+ relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
+ Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
end
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
warn_ambiguous_gems
- if Bundler.settings[:clean] && Bundler.settings[:path]
+ if CLI::Common.clean_after_install?
require "bundler/cli/clean"
Bundler::CLI::Clean.new(options).run
end
@@ -124,15 +121,11 @@ module Bundler
"#{count} #{count == 1 ? "gem" : "gems"} now installed"
end
- def check_for_group_conflicts
- if options[:without] && options[:with]
- conflicting_groups = options[:without] & options[:with]
- unless conflicting_groups.empty?
- Bundler.ui.error "You can't list a group in both, --with and --without." \
- " The offending groups are: #{conflicting_groups.join(", ")}."
- exit 1
- end
- end
+ def check_for_group_conflicts_in_cli_options
+ conflicting_groups = Array(options[:without]) & Array(options[:with])
+ return if conflicting_groups.empty?
+ raise InvalidOption, "You can't list a group in both with and without." \
+ " The offending groups are: #{conflicting_groups.join(", ")}."
end
def check_for_options_conflicts
@@ -145,28 +138,29 @@ module Bundler
end
def check_trust_policy
- if options["trust-policy"]
- unless Bundler.rubygems.security_policies.keys.include?(options["trust-policy"])
- Bundler.ui.error "Rubygems doesn't know about trust policy '#{options["trust-policy"]}'. " \
- "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
- exit 1
- end
- Bundler.settings["trust-policy"] = options["trust-policy"]
- else
- Bundler.settings["trust-policy"] = nil if Bundler.settings["trust-policy"]
+ trust_policy = options["trust-policy"]
+ unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
+ raise InvalidOption, "RubyGems doesn't know about trust policy '#{trust_policy}'. " \
+ "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
end
+ Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
end
def normalize_groups
- Bundler.settings.with = [] if options[:with] && options[:with].empty?
- Bundler.settings.without = [] if options[:without] && options[:without].empty?
+ options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
+ options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
+
+ check_for_group_conflicts_in_cli_options
- with = options.fetch("with", [])
- with |= Bundler.settings.with.map(&:to_s)
+ Bundler.settings.set_command_option :with, nil if options[:with] == []
+ Bundler.settings.set_command_option :without, nil if options[:without] == []
+
+ with = options.fetch(:with, [])
+ with |= Bundler.settings[:with].map(&:to_s)
with -= options[:without] if options[:without]
- without = options.fetch("without", [])
- without |= Bundler.settings.without.map(&:to_s)
+ without = options.fetch(:without, [])
+ without |= Bundler.settings[:without].map(&:to_s)
without -= options[:with] if options[:with]
options[:with] = with
@@ -174,28 +168,34 @@ module Bundler
end
def normalize_settings
- Bundler.settings[:path] = nil if options[:system]
- Bundler.settings[:path] = "vendor/bundle" if options[:deployment]
- Bundler.settings[:path] = options["path"] if options["path"]
- Bundler.settings[:path] ||= "bundle" if options["standalone"]
+ Bundler.settings.set_command_option :path, nil if options[:system]
+ Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
+ Bundler.settings.set_command_option_if_given :path, options["path"]
+ Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
- Bundler.settings[:bin] = options["binstubs"] if options["binstubs"]
- Bundler.settings[:bin] = nil if options["binstubs"] && options["binstubs"].empty?
+ bin_option = options["binstubs"]
+ bin_option = nil if bin_option && bin_option.empty?
+ Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
- Bundler.settings[:shebang] = options["shebang"] if options["shebang"]
+ Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
- Bundler.settings[:jobs] = options["jobs"] if options["jobs"]
+ Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
- Bundler.settings[:no_prune] = true if options["no-prune"]
+ Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
- Bundler.settings[:no_install] = true if options["no-install"]
+ Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
- Bundler.settings[:clean] = options["clean"] if options["clean"]
+ Bundler.settings.set_command_option_if_given :clean, options["clean"]
- Bundler.settings.without = options[:without]
- Bundler.settings.with = options[:with]
+ unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
+ # need to nil them out first to get around validation for backwards compatibility
+ Bundler.settings.set_command_option :without, nil
+ Bundler.settings.set_command_option :with, nil
+ Bundler.settings.set_command_option :without, options[:without] - options[:with]
+ Bundler.settings.set_command_option :with, options[:with]
+ end
- Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? true : nil
+ options[:force] = options[:redownload]
end
def warn_ambiguous_gems
diff --git a/lib/bundler/cli/issue.rb b/lib/bundler/cli/issue.rb
index ace0f985a9..91f827ea99 100644
--- a/lib/bundler/cli/issue.rb
+++ b/lib/bundler/cli/issue.rb
@@ -26,7 +26,7 @@ module Bundler
EOS
- Bundler.ui.info Bundler::Env.new.report
+ Bundler.ui.info Bundler::Env.report
Bundler.ui.info "\n## Bundle Doctor"
doctor
diff --git a/lib/bundler/cli/list.rb b/lib/bundler/cli/list.rb
new file mode 100644
index 0000000000..b5e7c1e650
--- /dev/null
+++ b/lib/bundler/cli/list.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Bundler
+ class CLI::List
+ def initialize(options)
+ @options = options
+ end
+
+ def run
+ specs = Bundler.load.specs.reject {|s| s.name == "bundler" }.sort_by(&:name)
+ return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
+
+ return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
+ Bundler.ui.info "Gems included by the bundle:"
+ specs.each do |s|
+ Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})"
+ end
+
+ Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
+ end
+ end
+end
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index 223db9419f..7dd078b1ef 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Lock
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb
index 9a21f6811c..552fe6f128 100644
--- a/lib/bundler/cli/open.rb
+++ b/lib/bundler/cli/open.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "bundler/cli/common"
+
require "shellwords"
module Bundler
@@ -17,7 +17,7 @@ module Bundler
path = spec.full_gem_path
Dir.chdir(path) do
command = Shellwords.split(editor) + [path]
- Bundler.with_clean_env do
+ Bundler.with_original_env do
system(*command)
end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
end
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 863d0dd388..5125cc710b 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Outdated
@@ -46,7 +45,7 @@ module Bundler
Bundler::CLI::Common.patch_level_options(options).any?
filter_options_patch = options.keys &
- %w(filter-major filter-minor filter-patch)
+ %w[filter-major filter-minor filter-patch]
definition_resolution = proc do
options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
@@ -214,13 +213,19 @@ module Bundler
end
def check_for_deployment_mode
- if Bundler.settings[:frozen]
- raise ProductionError, "You are trying to check outdated gems in " \
- "deployment mode. Run `bundle outdated` elsewhere.\n" \
- "\nIf this is a development machine, remove the " \
- "#{Bundler.default_gemfile} freeze" \
- "\nby running `bundle install --no-deployment`."
+ return unless Bundler.frozen?
+ suggested_command = if Bundler.settings.locations("frozen")[:global]
+ "bundle config --delete frozen"
+ elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
+ "bundle config --delete deployment"
+ else
+ "bundle install --no-deployment"
end
+ raise ProductionError, "You are trying to check outdated gems in " \
+ "deployment mode. Run `bundle outdated` elsewhere.\n" \
+ "\nIf this is a development machine, remove the " \
+ "#{Bundler.default_gemfile} freeze" \
+ "\nby running `#{suggested_command}`."
end
def update_present_via_semver_portions(current_spec, active_spec, options)
diff --git a/lib/bundler/cli/package.rb b/lib/bundler/cli/package.rb
index cf65e8a68c..2dcd0e1e29 100644
--- a/lib/bundler/cli/package.rb
+++ b/lib/bundler/cli/package.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Package
attr_reader :options
@@ -9,15 +10,15 @@ module Bundler
def run
Bundler.ui.level = "error" if options[:quiet]
- Bundler.settings[:path] = File.expand_path(options[:path]) if options[:path]
- Bundler.settings[:cache_all_platforms] = options["all-platforms"] if options.key?("all-platforms")
- Bundler.settings[:cache_path] = options["cache-path"] if options.key?("cache-path")
+ Bundler.settings.set_command_option_if_given :path, options[:path]
+ Bundler.settings.set_command_option_if_given :cache_all_platforms, options["all-platforms"]
+ Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
setup_cache_all
install
# TODO: move cache contents here now that all bundles are locked
- custom_path = Pathname.new(options[:path]) if options[:path]
+ custom_path = Bundler.settings[:path] if options[:path]
Bundler.load.cache(custom_path)
end
@@ -34,9 +35,11 @@ module Bundler
end
def setup_cache_all
- Bundler.settings[:cache_all] = options[:all] if options.key?("all")
+ all = options.fetch(:all, Bundler.feature_flag.cache_command_is_package? || nil)
+
+ Bundler.settings.set_command_option_if_given :cache_all, all
- if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all]
+ if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
"to package them as well, please pass the --all flag. This will be the default " \
"on Bundler 2.0."
diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb
index 9fdab0a53c..e97cad49a4 100644
--- a/lib/bundler/cli/platform.rb
+++ b/lib/bundler/cli/platform.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Platform
attr_reader :options
diff --git a/lib/bundler/cli/plugin.rb b/lib/bundler/cli/plugin.rb
index 277822dafc..5488a9f28d 100644
--- a/lib/bundler/cli/plugin.rb
+++ b/lib/bundler/cli/plugin.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/vendored_thor"
module Bundler
class CLI::Plugin < Thor
diff --git a/lib/bundler/cli/pristine.rb b/lib/bundler/cli/pristine.rb
index 10d03b4b41..9b9cdaa9b3 100644
--- a/lib/bundler/cli/pristine.rb
+++ b/lib/bundler/cli/pristine.rb
@@ -1,15 +1,20 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Pristine
+ def initialize(gems)
+ @gems = gems
+ end
+
def run
+ CLI::Common.ensure_all_gems_in_lockfile!(@gems)
definition = Bundler.definition
definition.validate_runtime!
installer = Bundler::Installer.new(Bundler.root, definition)
Bundler.load.specs.each do |spec|
next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
+ next if !@gems.empty? && !@gems.include?(spec.name)
gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
@@ -21,13 +26,15 @@ module Bundler
Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
next
end
+
+ FileUtils.rm_rf spec.full_gem_path
when Source::Git
source.remote!
+ FileUtils.rm_rf spec.full_gem_path
else
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
next
end
- FileUtils.rm_rf spec.full_gem_path
Bundler::GemInstaller.new(spec, installer, false, 0, true).install_from_spec
end
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
index 47d4470aec..61756801b2 100644
--- a/lib/bundler/cli/show.rb
+++ b/lib/bundler/cli/show.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Show
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
index df7524f004..5de11e84e4 100644
--- a/lib/bundler/cli/update.rb
+++ b/lib/bundler/cli/update.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "bundler/cli/common"
module Bundler
class CLI::Update
@@ -17,7 +16,18 @@ module Bundler
sources = Array(options[:source])
groups = Array(options[:group]).map(&:to_sym)
- if gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !options[:bundler]
+ full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !options[:bundler]
+
+ if full_update && !options[:all]
+ if Bundler.feature_flag.update_requires_all_flag?
+ raise InvalidOption, "To update everything, pass the `--all` flag."
+ end
+ SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything"
+ elsif !full_update && options[:all]
+ raise InvalidOption, "Cannot specify --all along with specific options."
+ end
+
+ if full_update
# We're doing a full update
Bundler.definition(true)
else
@@ -33,7 +43,8 @@ module Bundler
end
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
- :lock_shared_dependencies => options[:conservative])
+ :lock_shared_dependencies => options[:conservative],
+ :bundler => options[:bundler])
end
Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
@@ -44,17 +55,32 @@ module Bundler
opts["update"] = true
opts["local"] = options[:local]
- Bundler.settings[:jobs] = opts["jobs"] if opts["jobs"]
+ Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
Bundler.definition.validate_runtime!
installer = Installer.install Bundler.root, Bundler.definition, opts
Bundler.load.cache if Bundler.app_cache.exist?
- if Bundler.settings[:clean] && Bundler.settings[:path]
+ if CLI::Common.clean_after_install?
require "bundler/cli/clean"
Bundler::CLI::Clean.new(options).run
end
+ if locked_gems = Bundler.definition.locked_gems
+ gems.each do |name|
+ locked_version = locked_gems.specs.find {|s| s.name == name }.version
+ new_version = Bundler.definition.specs[name].first
+ new_version &&= new_version.version
+ if !new_version
+ Bundler.ui.warn "Bundler attempted to update #{name} but it was removed from the bundle"
+ elsif new_version < locked_version
+ Bundler.ui.warn "Bundler attempted to update #{name} but its version regressed from #{locked_version} to #{new_version}"
+ elsif new_version == locked_version
+ Bundler.ui.warn "Bundler attempted to update #{name} but its version stayed the same"
+ end
+ end
+ end
+
Bundler.ui.confirm "Bundle updated!"
Bundler::CLI::Common.output_without_groups_message
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb
index 767fe8f3de..644f9b25cf 100644
--- a/lib/bundler/cli/viz.rb
+++ b/lib/bundler/cli/viz.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class CLI::Viz
attr_reader :options, :gem_name
diff --git a/lib/bundler/compact_index_client.rb b/lib/bundler/compact_index_client.rb
index 3ed05ca484..6c241ca07a 100644
--- a/lib/bundler/compact_index_client.rb
+++ b/lib/bundler/compact_index_client.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "pathname"
require "set"
diff --git a/lib/bundler/compact_index_client/cache.rb b/lib/bundler/compact_index_client/cache.rb
index e44f05dc7e..f6105d3bb3 100644
--- a/lib/bundler/compact_index_client/cache.rb
+++ b/lib/bundler/compact_index_client/cache.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "digest/md5"
module Bundler
class CompactIndexClient
@@ -68,7 +67,7 @@ module Bundler
def info_path(name)
name = name.to_s
if name =~ /[^a-z0-9_-]/
- name += "-#{Digest::MD5.hexdigest(name).downcase}"
+ name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
info_roots.last.join(name)
else
info_roots.first.join(name)
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
index dc26095040..3a4e4441ca 100644
--- a/lib/bundler/compact_index_client/updater.rb
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require "fileutils"
+
+require "bundler/vendored_fileutils"
require "stringio"
-require "tmpdir"
require "zlib"
module Bundler
@@ -22,6 +22,7 @@ module Bundler
def initialize(fetcher)
@fetcher = fetcher
+ require "tmpdir"
end
def update(local_path, remote_path, retrying = nil)
@@ -98,7 +99,7 @@ module Bundler
# because we need to preserve \n line endings on windows when calculating
# the checksum
SharedHelpers.filesystem_access(path, :read) do
- Digest::MD5.hexdigest(IO.read(path))
+ SharedHelpers.digest(:MD5).hexdigest(IO.read(path))
end
end
end
diff --git a/lib/bundler/compatibility_guard.rb b/lib/bundler/compatibility_guard.rb
new file mode 100644
index 0000000000..750a1db04f
--- /dev/null
+++ b/lib/bundler/compatibility_guard.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: false
+
+require "rubygems"
+require "bundler/version"
+
+if Bundler::VERSION.split(".").first.to_i >= 2
+ if Gem::Version.new(Object::RUBY_VERSION.dup) < Gem::Version.new("2.3")
+ abort "Bundler 2 requires Ruby 2.3 or later. Either install bundler 1 or update to a supported Ruby version."
+ end
+
+ if Gem::Version.new(Gem::VERSION.dup) < Gem::Version.new("2.5")
+ abort "Bundler 2 requires RubyGems 2.5 or later. Either install bundler 1 or update to a supported RubyGems version."
+ end
+end
diff --git a/lib/bundler/constants.rb b/lib/bundler/constants.rb
index 5b1c0a8cb1..2e4ebb37ee 100644
--- a/lib/bundler/constants.rb
+++ b/lib/bundler/constants.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/
FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index cca40100ad..31532d108d 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
# Returns current version of Ruby
#
@@ -8,7 +9,7 @@ module Bundler
end
class CurrentRuby
- KNOWN_MINOR_VERSIONS = %w(
+ KNOWN_MINOR_VERSIONS = %w[
1.8
1.9
2.0
@@ -17,11 +18,11 @@ module Bundler
2.3
2.4
2.5
- ).freeze
+ ].freeze
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
- KNOWN_PLATFORMS = %w(
+ KNOWN_PLATFORMS = %w[
jruby
maglev
mingw
@@ -31,7 +32,7 @@ module Bundler
rbx
ruby
x64_mingw
- ).freeze
+ ].freeze
def ruby?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 3e5b1bc447..f93ed76226 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
+
require "bundler/lockfile_parser"
-require "digest/sha1"
require "set"
module Bundler
@@ -14,7 +14,9 @@ module Bundler
:locked_gems,
:platforms,
:requires,
- :ruby_version
+ :ruby_version,
+ :lockfile,
+ :gemfiles
)
# Given a gemfile and lockfile creates a Bundler definition
@@ -51,8 +53,16 @@ module Bundler
# to be updated or true if all gems should be updated
# @param ruby_version [Bundler::RubyVersion, nil] Requested Ruby Version
# @param optional_groups [Array(String)] A list of optional groups
- def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [])
- @unlocking = unlock == true || !unlock.empty?
+ def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
+ if [true, false].include?(unlock)
+ @unlocking_bundler = false
+ @unlocking = unlock
+ else
+ unlock = unlock.dup
+ @unlocking_bundler = unlock.delete(:bundler)
+ unlock.delete_if {|_k, v| Array(v).empty? }
+ @unlocking = !unlock.empty?
+ end
@dependencies = dependencies
@sources = sources
@@ -61,6 +71,7 @@ module Bundler
@remote = false
@specs = nil
@ruby_version = ruby_version
+ @gemfiles = gemfiles
@lockfile = lockfile
@lockfile_contents = String.new
@@ -102,7 +113,7 @@ module Bundler
end
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
- add_current_platform unless Bundler.settings[:frozen]
+ add_current_platform unless Bundler.frozen?
converge_path_sources_to_gemspec_sources
@path_changes = converge_paths
@@ -167,9 +178,8 @@ module Bundler
"to a different version of #{locked_gem} that hasn't been removed in order to install."
end
unless specs["bundler"].any?
- local = Bundler.settings[:frozen] ? rubygems_index : index
- bundler = local.search(Gem::Dependency.new("bundler", VERSION)).last
- specs["bundler"] = bundler if bundler
+ bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
+ specs["bundler"] = bundler
end
specs
@@ -194,10 +204,19 @@ module Bundler
missing
end
- def missing_dependencies
- missing = []
- resolve.materialize(current_dependencies, missing)
- missing
+ def missing_specs?
+ missing = missing_specs
+ return false if missing.empty?
+ Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
+ true
+ rescue BundlerError => e
+ @index = nil
+ @resolve = nil
+ @specs = nil
+ @gem_version_promoter = create_gem_version_promoter
+
+ Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
+ true
end
def requested_specs
@@ -226,7 +245,10 @@ module Bundler
def resolve
@resolve ||= begin
last_resolve = converge_locked_specs
- if Bundler.settings[:frozen] || (!unlocking? && nothing_changed?)
+ if Bundler.frozen?
+ Bundler.ui.debug "Frozen, using resolution from the lockfile"
+ last_resolve
+ elsif !unlocking? && nothing_changed?
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
last_resolve
else
@@ -242,25 +264,44 @@ module Bundler
dependency_names = @dependencies.map(&:name)
sources.all_sources.each do |source|
- source.dependency_names = dependency_names.dup
+ source.dependency_names = dependency_names - pinned_spec_names(source)
idx.add_source source.specs
- dependency_names -= pinned_spec_names(source.specs)
dependency_names.concat(source.unmet_deps).uniq!
end
- idx << Gem::Specification.new("ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
- idx << Gem::Specification.new("rubygems\0", Gem::VERSION)
- end
- end
- # used when frozen is enabled so we can find the bundler
- # spec, even if (say) a git gem is not checked out.
- def rubygems_index
- @rubygems_index ||= Index.build do |idx|
- sources.rubygems_sources.each do |rubygems|
- idx.add_source rubygems.specs
+ double_check_for_index(idx, dependency_names)
+ end
+ end
+
+ # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
+ # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
+ # but will not have found any versions of Bar from source B, which is a problem if the requested version
+ # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
+ # each spec we found, we add all possible versions from all sources to the index.
+ def double_check_for_index(idx, dependency_names)
+ pinned_names = pinned_spec_names
+ loop do
+ idxcount = idx.size
+
+ names = :names # do this so we only have to traverse to get dependency_names from the index once
+ unmet_dependency_names = lambda do
+ return names unless names == :names
+ new_names = sources.all_sources.map(&:dependency_names_to_double_check)
+ return names = nil if new_names.compact!
+ names = new_names.flatten(1).concat(dependency_names)
+ names.uniq!
+ names -= pinned_names
+ names
end
+
+ sources.all_sources.each do |source|
+ source.double_check_for(unmet_dependency_names, :override_dupes)
+ end
+
+ break if idxcount == idx.size
end
end
+ private :double_check_for_index
def has_rubygems_remotes?
sources.rubygems_sources.any? {|s| s.remotes.any? }
@@ -295,10 +336,10 @@ module Bundler
end
end
- preserve_unknown_sections ||= !updating_major && (Bundler.settings[:frozen] || !unlocking?)
+ preserve_unknown_sections ||= !updating_major && (Bundler.frozen? || !(unlocking? || @unlocking_bundler))
return if lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
- if Bundler.settings[:frozen]
+ if Bundler.frozen?
Bundler.ui.error "Cannot write a changed lockfile while frozen."
return
end
@@ -338,51 +379,8 @@ module Bundler
end
def to_lock
- out = String.new
-
- sources.lock_sources.each do |source|
- # Add the source header
- out << source.to_lock
- # Find all specs for this source
- resolve.
- select {|s| source.can_lock?(s) }.
- # This needs to be sorted by full name so that
- # gems with the same name, but different platform
- # are ordered consistently
- sort_by(&:full_name).
- each do |spec|
- next if spec.name == "bundler"
- out << spec.to_lock
- end
- out << "\n"
- end
-
- out << "PLATFORMS\n"
-
- platforms.map(&:to_s).sort.each do |p|
- out << " #{p}\n"
- end
-
- out << "\n"
- out << "DEPENDENCIES\n"
-
- handled = []
- dependencies.sort_by(&:to_s).each do |dep|
- next if handled.include?(dep.name)
- out << dep.to_lock
- handled << dep.name
- end
-
- if locked_ruby_version
- out << "\nRUBY VERSION\n"
- out << " #{locked_ruby_version}\n"
- end
-
- # Record the version of Bundler that was used to create the lockfile
- out << "\nBUNDLED WITH\n"
- out << " #{locked_bundler_version}\n"
-
- out
+ require "bundler/lockfile_generator"
+ LockfileGenerator.generate(self)
end
def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
@@ -392,8 +390,13 @@ module Bundler
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
unless explicit_flag
-
- suggested_command = Bundler.settings.locations("frozen")[:global] == "1" ? "bundle config --delete frozen" : "bundle install --no-deployment"
+ suggested_command = if Bundler.settings.locations("frozen")[:global]
+ "bundle config --delete frozen"
+ elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
+ "bundle config --delete deployment"
+ else
+ "bundle install --no-deployment"
+ end
msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
"freeze \nby running `#{suggested_command}`."
end
@@ -417,8 +420,8 @@ module Bundler
# Check if it is possible that the source is only changed thing
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
- new_sources.reject! {|source| source.is_a_path? && source.path.exist? }
- deleted_sources.reject! {|source| source.is_a_path? && source.path.exist? }
+ new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
+ deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
end
if @locked_sources != gemfile_sources
@@ -511,7 +514,7 @@ module Bundler
def add_current_platform
current_platform = Bundler.local_platform
- add_platform(current_platform) if Bundler.settings[:specific_platform]
+ add_platform(current_platform) if Bundler.feature_flag.specific_platform?
add_platform(generic(current_platform))
end
@@ -558,10 +561,7 @@ module Bundler
end
def pretty_dep(dep, source = false)
- msg = String.new(dep.name)
- msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
- msg << " from the `#{dep.source}` source" if source && dep.source
- msg
+ SharedHelpers.pretty_dependency(dep, source)
end
# Check if the specs of the given source changed
@@ -585,6 +585,9 @@ module Bundler
# order here matters, since Index#== is checking source.specs.include?(locked_index)
locked_index != source.specs
+ rescue PathError, GitError => e
+ Bundler.ui.debug "Assuming that #{source} has not changed since fetching its specs errored (#{e})"
+ false
end
# Get all locals and override their matching sources.
@@ -632,22 +635,32 @@ module Bundler
end
end
- def converge_sources
+ def converge_rubygems_sources
+ return false if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+
changes = false
- # Get the Rubygems sources from the Gemfile.lock
+ # Get the RubyGems sources from the Gemfile.lock
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
- # Get the Rubygems remotes from the Gemfile
+ # Get the RubyGems remotes from the Gemfile
actual_remotes = sources.rubygems_remotes
- # If there is a Rubygems source in both
+ # If there is a RubyGems source in both
if !locked_gem_sources.empty? && !actual_remotes.empty?
locked_gem_sources.each do |locked_gem|
# Merge the remotes from the Gemfile into the Gemfile.lock
- changes |= locked_gem.replace_remotes(actual_remotes)
+ changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
end
end
+ changes
+ end
+
+ def converge_sources
+ changes = false
+
+ changes |= converge_rubygems_sources
+
# Replace the sources from the Gemfile with the sources from the Gemfile.lock,
# if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
# source in the Gemfile.lock, use the one from the Gemfile.
@@ -669,7 +682,7 @@ module Bundler
end
def converge_dependencies
- frozen = Bundler.settings[:frozen]
+ frozen = Bundler.frozen?
(@dependencies + @locked_deps.values).each do |dep|
locked_source = @locked_deps[dep.name]
# This is to make sure that if bundler is installing in deployment mode and
@@ -739,6 +752,8 @@ module Bundler
end
end
+ unlock_source_unlocks_spec = Bundler.feature_flag.unlock_source_unlocks_spec?
+
converged = []
@locked_specs.each do |s|
# Replace the locked dependency's source with the equivalent source from the Gemfile
@@ -746,21 +761,33 @@ module Bundler
s.source = (dep && dep.source) || sources.get(s.source)
# Don't add a spec to the list if its source is expired. For example,
- # if you change a Git gem to Rubygems.
+ # if you change a Git gem to RubyGems.
next if s.source.nil?
next if @unlock[:sources].include?(s.source.name)
# XXX This is a backwards-compatibility fix to preserve the ability to
# unlock a single gem by passing its name via `--source`. See issue #3759
# TODO: delete in Bundler 2
- next if @unlock[:sources].include?(s.name)
+ next if unlock_source_unlocks_spec && @unlock[:sources].include?(s.name)
# If the spec is from a path source and it doesn't exist anymore
# then we unlock it.
# Path sources have special logic
if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
- other = s.source.specs[s].first
+ other_sources_specs = begin
+ s.source.specs
+ rescue PathError, GitError
+ # if we won't need the source (according to the lockfile),
+ # don't error if the path/git source isn't available
+ next if @locked_specs.
+ for(requested_dependencies, [], false, true, false).
+ none? {|locked_spec| locked_spec.source == s.source }
+
+ raise
+ end
+
+ other = other_sources_specs[s].first
# If the spec is no longer in the path source, unlock it. This
# commonly happens if the version changed in the gemspec
@@ -807,17 +834,21 @@ module Bundler
# the metadata dependencies here
def expanded_dependencies
@expanded_dependencies ||= begin
+ expand_dependencies(dependencies + metadata_dependencies, @remote)
+ end
+ end
+
+ def metadata_dependencies
+ @metadata_dependencies ||= begin
ruby_versions = concat_ruby_version_requirements(@ruby_version)
if ruby_versions.empty? || !@ruby_version.exact?
concat_ruby_version_requirements(RubyVersion.system)
concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
end
-
- metadata_dependencies = [
+ [
Dependency.new("ruby\0", ruby_versions),
Dependency.new("rubygems\0", Gem::VERSION),
]
- expand_dependencies(dependencies + metadata_dependencies, @remote)
end
end
@@ -838,11 +869,12 @@ module Bundler
end
def expand_dependencies(dependencies, remote = false)
+ sorted_platforms = Resolver.sort_platforms(@platforms)
deps = []
dependencies.each do |dep|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
next if !remote && !dep.current_platform?
- platforms = dep.gem_platforms(@platforms)
+ platforms = dep.gem_platforms(sorted_platforms)
if platforms.empty?
mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }
Bundler.ui.warn \
@@ -872,30 +904,33 @@ module Bundler
# Record the specs available in each gem's source, so that those
# specs will be available later when the resolver knows where to
# look for that gemspec (or its dependencies)
- source_requirements = {}
+ default = sources.default_source
+ source_requirements = { :default => default }
+ default = nil unless Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
dependencies.each do |dep|
- next unless dep.source
- source_requirements[dep.name] = dep.source.specs
+ next unless source = dep.source || default
+ source_requirements[dep.name] = source
end
+ metadata_dependencies.each do |dep|
+ source_requirements[dep.name] = sources.metadata_source
+ end
+ source_requirements["bundler"] = sources.metadata_source # needs to come last to override
source_requirements
end
- def pinned_spec_names(specs)
- names = []
- specs.each do |s|
- # TODO: when two sources without blocks is an error, we can change
- # this check to !s.source.is_a?(Source::LocalRubygems). For now,
- # we need to ask every Rubygems for every gem name.
- if s.source.is_a?(Source::Git) || s.source.is_a?(Source::Path)
- names << s.name
- end
+ def pinned_spec_names(skip = nil)
+ pinned_names = []
+ default = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources? && sources.default_source
+ @dependencies.each do |dep|
+ next unless dep_source = dep.source || default
+ next if dep_source == skip
+ pinned_names << dep.name
end
- names.uniq!
- names
+ pinned_names
end
def requested_groups
- groups - Bundler.settings.without - @optional_groups + Bundler.settings.with
+ groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
end
def lockfiles_equal?(current, proposed, preserve_unknown_sections)
@@ -930,11 +965,20 @@ module Bundler
def additional_base_requirements_for_resolve
return [] unless @locked_gems && Bundler.feature_flag.only_update_to_newer_versions?
+ dependencies_by_name = dependencies.group_by(&:name)
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
- dep = Gem::Dependency.new(locked_spec.name, ">= #{locked_spec.version}")
- requirements[locked_spec.name] = DepProxy.new(dep, locked_spec.platform)
+ name = locked_spec.name
+ next requirements if @locked_deps[name] != dependencies_by_name[name]
+ dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
+ requirements[name] = DepProxy.new(dep, locked_spec.platform)
requirements
end.values
end
+
+ def equivalent_rubygems_remotes?(source)
+ return false unless source.is_a?(Source::Rubygems)
+
+ Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
+ end
end
end
diff --git a/lib/bundler/dep_proxy.rb b/lib/bundler/dep_proxy.rb
index 998975bbaf..7a9423b14a 100644
--- a/lib/bundler/dep_proxy.rb
+++ b/lib/bundler/dep_proxy.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class DepProxy
attr_reader :__platform, :dep
@@ -13,6 +14,7 @@ module Bundler
end
def ==(other)
+ return if other.nil?
dep == other.dep && __platform == other.__platform
end
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index d2bac66cdb..24257bc113 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "rubygems/dependency"
require "bundler/shared_helpers"
require "bundler/rubygems_ext"
@@ -90,16 +91,14 @@ module Bundler
@autorequire = Array(options["require"] || []) if options.key?("require")
end
+ # Returns the platforms this dependency is valid for, in the same order as
+ # passed in the `valid_platforms` parameter
def gem_platforms(valid_platforms)
return valid_platforms if @platforms.empty?
- platforms = []
- @platforms.each do |p|
- platform = PLATFORM_MAP[p]
- next unless valid_platforms.include?(platform)
- platforms |= [platform]
- end
- platforms
+ @gem_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
+
+ valid_platforms & @gem_platforms
end
def should_include?
diff --git a/lib/bundler/deployment.rb b/lib/bundler/deployment.rb
index 94f2fac620..291e158ca0 100644
--- a/lib/bundler/deployment.rb
+++ b/lib/bundler/deployment.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require "bundler/shared_helpers"
-Bundler::SharedHelpers.major_deprecation "Bundler no longer integrates with " \
+Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \
"Capistrano, but Capistrano provides its own integration with " \
"Bundler via the capistrano-bundler gem. Use it instead."
diff --git a/lib/bundler/deprecate.rb b/lib/bundler/deprecate.rb
index b978c0df6c..387f632a39 100644
--- a/lib/bundler/deprecate.rb
+++ b/lib/bundler/deprecate.rb
@@ -1,11 +1,22 @@
# frozen_string_literal: true
+
+begin
+ require "rubygems/deprecate"
+rescue LoadError
+ # it's fine if it doesn't exist on the current RubyGems...
+ nil
+end
+
module Bundler
- if defined? ::Deprecate
+ if defined? Bundler::Deprecate
+ # nothing to do!
+ elsif defined? ::Deprecate
Deprecate = ::Deprecate
elsif defined? Gem::Deprecate
Deprecate = Gem::Deprecate
else
- class Deprecate; end
+ class Deprecate
+ end
end
unless Deprecate.respond_to?(:skip_during)
@@ -20,7 +31,7 @@ module Bundler
unless Deprecate.respond_to?(:skip)
def Deprecate.skip
- @skip
+ @skip ||= false
end
end
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index e4c257d267..8681163277 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/dependency"
require "bundler/ruby_dsl"
@@ -14,6 +15,9 @@ module Bundler
VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze
+ VALID_KEYS = %w[group groups git path glob name branch ref tag require submodules
+ platform platforms type source install_if].freeze
+
attr_reader :gemspecs
attr_accessor :dependencies
@@ -30,14 +34,16 @@ module Bundler
@ruby_version = nil
@gemspecs = []
@gemfile = nil
+ @gemfiles = []
add_git_sources
end
def eval_gemfile(gemfile, contents = nil)
- expanded_gemfile_path = Pathname.new(gemfile).expand_path
+ expanded_gemfile_path = Pathname.new(gemfile).expand_path(@gemfile && @gemfile.parent)
original_gemfile = @gemfile
@gemfile = expanded_gemfile_path
- contents ||= Bundler.read_file(gemfile.to_s)
+ @gemfiles << expanded_gemfile_path
+ contents ||= Bundler.read_file(@gemfile.to_s)
instance_eval(contents.dup.untaint, gemfile.to_s, 1)
rescue Exception => e
message = "There was an error " \
@@ -95,10 +101,10 @@ module Bundler
# if there's already a dependency with this name we try to prefer one
if current = @dependencies.find {|d| d.name == dep.name }
+ deleted_dep = @dependencies.delete(current) if current.type == :development
+
if current.requirement != dep.requirement
- if current.type == :development
- @dependencies.delete current
- else
+ unless deleted_dep
return if dep.type == :development
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})"
@@ -111,9 +117,7 @@ module Bundler
end
if current.source != dep.source
- if current.type == :development
- @dependencies.delete current
- else
+ unless deleted_dep
return if dep.type == :development
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
@@ -128,10 +132,12 @@ module Bundler
def source(source, *args, &blk)
options = args.last.is_a?(Hash) ? args.pop.dup : {}
options = normalize_hash(options)
+ source = normalize_source(source)
+
if options.key?("type")
options["type"] = options["type"].to_s
unless Plugin.source?(options["type"])
- raise "No sources available for #{options["type"]}"
+ raise InvalidOption, "No plugin sources available for #{options["type"]}"
end
unless block_given?
@@ -141,12 +147,10 @@ module Bundler
source_opts = options.merge("uri" => source)
with_source(@sources.add_plugin_source(options["type"], source_opts), &blk)
elsif block_given?
- source = normalize_source(source)
with_source(@sources.add_rubygems_source("remotes" => source), &blk)
else
- source = normalize_source(source)
check_primary_source_safety(@sources)
- @sources.add_rubygems_remote(source)
+ @sources.global_rubygems_source = source
end
end
@@ -164,6 +168,19 @@ module Bundler
end
def path(path, options = {}, &blk)
+ unless block_given?
+ msg = "You can no longer specify a path source by itself. Instead, \n" \
+ "either use the :path option on a gem, or specify the gems that \n" \
+ "bundler should find in the path source by passing a block to \n" \
+ "the path method, like: \n\n" \
+ " path 'dir/containing/rails' do\n" \
+ " gem 'rails'\n" \
+ " end\n\n"
+
+ raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
+ SharedHelpers.major_deprecation(2, msg.strip)
+ end
+
source_options = normalize_hash(options).merge(
"path" => Pathname.new(path),
"root_path" => gemfile_root,
@@ -190,6 +207,7 @@ module Bundler
def github(repo, options = {})
raise ArgumentError, "GitHub sources require a block" unless block_given?
+ raise DeprecatedError, "The #github method has been removed" if Bundler.feature_flag.skip_default_git_sources?
github_uri = @git_sources["github"].call(repo)
git_options = normalize_hash(options).merge("uri" => github_uri)
git_source = @sources.add_git_source(git_options)
@@ -197,16 +215,16 @@ module Bundler
end
def to_definition(lockfile, unlock)
- Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups)
+ Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
end
def group(*args, &blk)
- opts = Hash === args.last ? args.pop.dup : {}
- normalize_group_options(opts, args)
+ options = args.last.is_a?(Hash) ? args.pop.dup : {}
+ normalize_group_options(options, args)
@groups.concat args
- if opts["optional"]
+ if options["optional"]
optional_groups = args - @optional_groups
@optional_groups.concat optional_groups
end
@@ -216,9 +234,9 @@ module Bundler
args.each { @groups.pop }
end
- def install_if(*args, &blk)
+ def install_if(*args)
@install_conditionals.concat args
- blk.call
+ yield
ensure
args.each { @install_conditionals.pop }
end
@@ -250,7 +268,12 @@ module Bundler
private
def add_git_sources
+ return if Bundler.feature_flag.skip_default_git_sources?
+
git_source(:github) do |repo_name|
+ warn_deprecated_git_source(:github, <<-'RUBY'.strip, 'Change any "reponame" :github sources to "username/reponame".')
+"https://github.com/#{repo_name}.git"
+ RUBY
# It would be better to use https instead of the git protocol, but this
# can break deployment of existing locked bundles when switching between
# different versions of Bundler. The change will be made in 2.0, which
@@ -267,23 +290,29 @@ module Bundler
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
# TODO: 2.0 upgrade this setting to the default
if Bundler.settings["github.https"]
+ Bundler::SharedHelpers.major_deprecation 2, "The `github.https` setting will be removed"
"https://github.com/#{repo_name}.git"
else
- warn_github_source_change(repo_name)
"git://github.com/#{repo_name}.git"
end
end
# TODO: 2.0 remove this deprecated git source
git_source(:gist) do |repo_name|
- warn_deprecated_git_source(:gist, 'https://gist.github.com/#{repo_name}.git')
+ warn_deprecated_git_source(:gist, '"https://gist.github.com/#{repo_name}.git"')
+
"https://gist.github.com/#{repo_name}.git"
end
# TODO: 2.0 remove this deprecated git source
git_source(:bitbucket) do |repo_name|
- user_name, repo_name = repo_name.split "/"
- warn_deprecated_git_source(:bitbucket, 'https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git')
+ warn_deprecated_git_source(:bitbucket, <<-'RUBY'.strip)
+user_name, repo_name = repo_name.split("/")
+repo_name ||= user_name
+"https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git"
+ RUBY
+
+ user_name, repo_name = repo_name.split("/")
repo_name ||= user_name
"https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git"
end
@@ -308,7 +337,7 @@ module Bundler
end
def valid_keys
- @valid_keys ||= %w(group groups git path glob name branch ref tag require submodules platform platforms type source install_if)
+ @valid_keys ||= VALID_KEYS
end
def normalize_options(name, version, opts)
@@ -318,6 +347,9 @@ module Bundler
if name =~ /\s/
raise GemfileError, %('#{name}' is not a valid gem name because it contains whitespace)
end
+ if name.empty?
+ raise GemfileError, %(an empty gem name is not valid)
+ end
normalize_hash(opts)
@@ -355,7 +387,7 @@ module Bundler
opts["git"] = @git_sources[git_name].call(opts[git_name])
end
- %w(git path).each do |type|
+ %w[git path].each do |type|
next unless param = opts[type]
if version.first && version.first =~ /^\s*=?\s*(\d[^\s]*)\s*$/
options = opts.merge("name" => name, "version" => $1)
@@ -366,8 +398,8 @@ module Bundler
opts["source"] = source
end
- opts["source"] ||= @source
- opts["env"] ||= @env
+ opts["source"] ||= @source
+ opts["env"] ||= @env
opts["platforms"] = platforms.dup
opts["group"] = groups
opts["should_include"] = install_if
@@ -377,7 +409,7 @@ module Bundler
normalize_hash(opts)
groups = groups.map {|group| ":#{group}" }.join(", ")
- validate_keys("group #{groups}", opts, %w(optional))
+ validate_keys("group #{groups}", opts, %w[optional])
opts["optional"] ||= false
end
@@ -390,25 +422,25 @@ module Bundler
raise GemfileError, %(The `branch` option for `#{command}` is not allowed. Only gems with a git source can specify a branch)
end
- if invalid_keys.any?
- message = String.new
- message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} "
- message << if invalid_keys.size > 1
- "as options for #{command}, but they are invalid."
- else
- "as an option for #{command}, but it is invalid."
- end
-
- message << " Valid options are: #{valid_keys.join(", ")}."
- message << " You may be able to resolve this by upgrading Bundler to the newest version."
- raise InvalidOption, message
- end
+ return true unless invalid_keys.any?
+
+ message = String.new
+ message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} "
+ message << if invalid_keys.size > 1
+ "as options for #{command}, but they are invalid."
+ else
+ "as an option for #{command}, but it is invalid."
+ end
+
+ message << " Valid options are: #{valid_keys.join(", ")}."
+ message << " You may be able to resolve this by upgrading Bundler to the newest version."
+ raise InvalidOption, message
end
def normalize_source(source)
case source
when :gemcutter, :rubygems, :rubyforge
- Bundler::SharedHelpers.major_deprecation "The source :#{source} is deprecated because HTTP " \
+ Bundler::SharedHelpers.major_deprecation 2, "The source :#{source} is deprecated because HTTP " \
"requests are insecure.\nPlease change your source to 'https://" \
"rubygems.org' if possible, or 'http://rubygems.org' if not."
"http://rubygems.org"
@@ -419,17 +451,20 @@ module Bundler
end
end
- def check_primary_source_safety(source)
- return unless source.rubygems_primary_remotes.any?
+ def check_primary_source_safety(source_list)
+ return if source_list.rubygems_primary_remotes.empty? && source_list.global_rubygems_source.nil?
- # TODO: 2.0 upgrade from setting to default
- if Bundler.settings[:disable_multisource]
- raise GemfileError, "Warning: this Gemfile contains multiple primary sources. " \
+ if Bundler.feature_flag.disable_multisource?
+ msg = "This Gemfile contains multiple primary sources. " \
"Each source after the first must include a block to indicate which gems " \
- "should come from that source. To downgrade this error to a warning, run " \
- "`bundle config --delete disable_multisource`"
+ "should come from that source"
+ unless Bundler.feature_flag.bundler_2_mode?
+ msg += ". To downgrade this error to a warning, run " \
+ "`bundle config --delete disable_multisource`"
+ end
+ raise GemfileEvalError, msg
else
- Bundler::SharedHelpers.major_deprecation "Your Gemfile contains multiple primary sources. " \
+ Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \
"Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \
@@ -438,20 +473,20 @@ module Bundler
end
end
- def warn_github_source_change(repo_name)
+ def warn_deprecated_git_source(name, replacement, additional_message = nil)
# TODO: 2.0 remove deprecation
- Bundler::SharedHelpers.major_deprecation "The :github option uses the git: protocol, which is not secure. " \
- "Bundler 2.0 will use the https: protocol, which is secure. Enable this change now by " \
- "running `bundle config github.https true`."
- end
+ additional_message &&= " #{additional_message}"
+ replacement = if replacement.count("\n").zero?
+ "{|repo_name| #{replacement} }"
+ else
+ "do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end"
+ end
+
+ Bundler::SharedHelpers.major_deprecation 2, <<-EOS
+The :#{name} git source is deprecated, and will be removed in Bundler 2.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
+
+ git_source(:#{name}) #{replacement}
- def warn_deprecated_git_source(name, repo_string)
- # TODO: 2.0 remove deprecation
- Bundler::SharedHelpers.major_deprecation <<-EOS
-The :#{name} git source is deprecated, and will be removed in Bundler 2.0. Add this code to your Gemfile to ensure it continues to work:
- git_source(:#{name}) do |repo_name|
- "#{repo_string}"
- end
EOS
end
@@ -530,7 +565,7 @@ The :#{name} git source is deprecated, and will be removed in Bundler 2.0. Add t
lines = contents.lines.to_a
indent = " # "
indicator = indent.tr("#", ">")
- first_line = (line_numer.zero?)
+ first_line = line_numer.zero?
last_line = (line_numer == (lines.count - 1))
m << "\n"
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index 5a1deeea47..8668c4ea7f 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
# used for Creating Specifications from the Gemcutter Endpoint
class EndpointSpecification < Gem::Specification
@@ -9,11 +10,15 @@ module Bundler
attr_accessor :source, :remote, :dependencies
def initialize(name, version, platform, dependencies, metadata = nil)
+ super()
@name = name
@version = Gem::Version.create version
@platform = platform
@dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) }
+ @loaded_from = nil
+ @remote_specification = nil
+
parse_metadata(metadata)
end
@@ -71,6 +76,8 @@ module Bundler
@remote_specification.post_install_message
elsif _local_specification
_local_specification.post_install_message
+ else
+ super
end
end
@@ -80,6 +87,8 @@ module Bundler
@remote_specification.extensions
elsif _local_specification
_local_specification.extensions
+ else
+ super
end
end
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 8b990baf40..58fe20dbe7 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -1,33 +1,21 @@
# frozen_string_literal: true
+
require "bundler/rubygems_integration"
require "bundler/source/git/git_proxy"
module Bundler
class Env
- def write(io)
+ def self.write(io)
io.write report
end
- def report(options = {})
+ def self.report(options = {})
print_gemfile = options.delete(:print_gemfile) { true }
print_gemspecs = options.delete(:print_gemspecs) { true }
- out = String.new("## Environment\n\n```\n")
- out << "Bundler #{Bundler::VERSION}\n"
- out << "Rubygems #{Gem::VERSION}\n"
- out << "Ruby #{ruby_version}"
- out << "GEM_HOME #{ENV["GEM_HOME"]}\n" unless ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
- out << "GEM_PATH #{ENV["GEM_PATH"]}\n" unless ENV["GEM_PATH"] == ENV["GEM_HOME"]
- out << "RVM #{ENV["rvm_version"]}\n" if ENV["rvm_version"]
- out << "Git #{git_version}\n"
- out << "Platform #{Gem::Platform.local}\n"
- out << "OpenSSL #{OpenSSL::OPENSSL_VERSION}\n" if defined?(OpenSSL::OPENSSL_VERSION)
- %w(rubygems-bundler open_gem).each do |name|
- specs = Bundler.rubygems.find_name(name)
- out << "#{name} (#{specs.map(&:version).join(",")})\n" unless specs.empty?
- end
-
- out << "```\n"
+ out = String.new
+ append_formatted_table("Environment", environment, out)
+ append_formatted_table("Bundler Build Metadata", BuildMetadata.to_h, out)
unless Bundler.settings.all.empty?
out << "\n## Bundler settings\n\n```\n"
@@ -43,9 +31,18 @@ module Bundler
return out unless SharedHelpers.in_bundle?
if print_gemfile
+ gemfiles = [Bundler.default_gemfile]
+ begin
+ gemfiles = Bundler.definition.gemfiles
+ rescue GemfileNotFound
+ nil
+ end
+
out << "\n## Gemfile\n"
- out << "\n### #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n"
- out << "```ruby\n" << read_file(Bundler.default_gemfile).chomp << "\n```\n"
+ gemfiles.each do |gemfile|
+ out << "\n### #{Pathname.new(gemfile).relative_path_from(SharedHelpers.pwd)}\n\n"
+ out << "```ruby\n" << read_file(gemfile).chomp << "\n```\n"
+ end
out << "\n### #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
out << "```\n" << read_file(Bundler.default_lockfile).chomp << "\n```\n"
@@ -63,9 +60,7 @@ module Bundler
out
end
- private
-
- def read_file(filename)
+ def self.read_file(filename)
File.read(filename.to_s).strip
rescue Errno::ENOENT
"<No #{filename} found>"
@@ -73,22 +68,86 @@ module Bundler
"#{e.class}: #{e.message}"
end
- def ruby_version
+ def self.ruby_version
str = String.new("#{RUBY_VERSION}")
if RUBY_VERSION < "1.9"
str << " (#{RUBY_RELEASE_DATE}"
str << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- str << ") [#{RUBY_PLATFORM}]\n"
+ str << ") [#{RUBY_PLATFORM}]"
else
str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]\n"
+ str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
end
end
- def git_version
+ def self.git_version
Bundler::Source::Git::GitProxy.new(nil, nil, nil).full_version
rescue Bundler::Source::Git::GitNotInstalledError
"not installed"
end
+
+ def self.version_of(script)
+ return "not installed" unless Bundler.which(script)
+ `#{script} --version`
+ end
+
+ def self.chruby_version
+ return "not installed" unless Bundler.which("chruby-exec")
+ `chruby-exec -- chruby --version`.
+ sub(/.*^chruby: (#{Gem::Version::VERSION_PATTERN}).*/m, '\1')
+ end
+
+ def self.environment
+ out = []
+
+ out << ["Bundler", Bundler::VERSION]
+ out << [" Platforms", Gem.platforms.join(", ")]
+ out << ["Ruby", ruby_version]
+ out << [" Full Path", Gem.ruby]
+ out << [" Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname]
+ out << ["RubyGems", Gem::VERSION]
+ out << [" Gem Home", ENV.fetch("GEM_HOME") { Gem.dir }]
+ out << [" Gem Path", ENV.fetch("GEM_PATH") { Gem.path.join(File::PATH_SEPARATOR) }]
+ out << [" User Path", Gem.user_dir]
+ out << [" Bin Dir", Gem.bindir]
+ out << ["OpenSSL"] if defined?(OpenSSL)
+ out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
+ out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
+ out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
+ out << [" Cert Dir", OpenSSL::X509::DEFAULT_CERT_DIR] if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
+ out << ["Tools"]
+ out << [" Git", git_version]
+ out << [" RVM", ENV.fetch("rvm_version") { version_of("rvm") }]
+ out << [" rbenv", version_of("rbenv")]
+ out << [" chruby", chruby_version]
+
+ %w[rubygems-bundler open_gem].each do |name|
+ specs = Bundler.rubygems.find_name(name)
+ out << [" #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
+ end
+ if (exe = caller.last.split(":").first) && exe =~ %r{(exe|bin)/bundler?\z}
+ shebang = File.read(exe).lines.first
+ shebang.sub!(/^#!\s*/, "")
+ unless shebang.start_with?(Gem.ruby, "/usr/bin/env ruby")
+ out << ["Gem.ruby", Gem.ruby]
+ out << ["bundle #!", shebang]
+ end
+ end
+
+ out
+ end
+
+ def self.append_formatted_table(title, pairs, out)
+ return if pairs.empty?
+ out << "\n" unless out.empty?
+ out << "## #{title}\n\n```\n"
+ ljust = pairs.map {|k, _v| k.to_s.length }.max
+ pairs.each do |k, v|
+ out << "#{k.to_s.ljust(ljust)} #{v}\n"
+ end
+ out << "```\n"
+ end
+
+ private_class_method :read_file, :ruby_version, :git_version, :append_formatted_table, :version_of, :chruby_version
end
end
diff --git a/lib/bundler/environment_preserver.rb b/lib/bundler/environment_preserver.rb
index a891f4854d..af7c1ef0a4 100644
--- a/lib/bundler/environment_preserver.rb
+++ b/lib/bundler/environment_preserver.rb
@@ -1,12 +1,29 @@
# frozen_string_literal: true
+
module Bundler
class EnvironmentPreserver
+ INTENTIONALLY_NIL = "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL".freeze
+ BUNDLER_KEYS = %w[
+ BUNDLE_BIN_PATH
+ BUNDLE_GEMFILE
+ BUNDLER_ORIG_MANPATH
+ BUNDLER_VERSION
+ GEM_HOME
+ GEM_PATH
+ MANPATH
+ PATH
+ RB_USER_INSTALL
+ RUBYLIB
+ RUBYOPT
+ ].map(&:freeze).freeze
+ BUNDLER_PREFIX = "BUNDLER_ORIG_".freeze
+
# @param env [ENV]
# @param keys [Array<String>]
def initialize(env, keys)
@original = env.to_hash
@keys = keys
- @prefix = "BUNDLER_ORIG_"
+ @prefix = BUNDLER_PREFIX
end
# @return [Hash]
@@ -14,9 +31,10 @@ module Bundler
env = @original.clone
@keys.each do |key|
value = env[key]
- original_value = env[@prefix + key]
- if !value.nil? && !value.empty? && original_value.nil?
- env[@prefix + key] = value
+ if !value.nil? && !value.empty?
+ env[@prefix + key] ||= value
+ elsif value.nil?
+ env[@prefix + key] ||= INTENTIONALLY_NIL
end
end
env
@@ -27,10 +45,13 @@ module Bundler
env = @original.clone
@keys.each do |key|
value_original = env[@prefix + key]
- unless value_original.nil? || value_original.empty?
+ next if value_original.nil? || value_original.empty?
+ if value_original == INTENTIONALLY_NIL
+ env.delete(key)
+ else
env[key] = value_original
- env.delete(@prefix + key)
end
+ env.delete(@prefix + key)
end
env
end
diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb
index 6ce8493ea7..e471bce0b6 100644
--- a/lib/bundler/errors.rb
+++ b/lib/bundler/errors.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class BundlerError < StandardError
def self.status_code(code)
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 150cac1e67..6a1809cd40 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -1,22 +1,59 @@
# frozen_string_literal: true
+
module Bundler
class FeatureFlag
def self.settings_flag(flag, &default)
unless Bundler::Settings::BOOL_KEYS.include?(flag.to_s)
raise "Cannot use `#{flag}` as a settings feature flag since it isn't a bool key"
end
- define_method("#{flag}?") do
- value = Bundler.settings[flag]
+
+ settings_method("#{flag}?", flag, &default)
+ end
+ private_class_method :settings_flag
+
+ def self.settings_option(key, &default)
+ settings_method(key, key, &default)
+ end
+ private_class_method :settings_option
+
+ def self.settings_method(name, key, &default)
+ define_method(name) do
+ value = Bundler.settings[key]
value = instance_eval(&default) if value.nil? && !default.nil?
value
end
end
+ private_class_method :settings_method
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
+ settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? }
settings_flag(:allow_offline_install) { bundler_2_mode? }
+ settings_flag(:auto_clean_without_path) { bundler_2_mode? }
+ settings_flag(:cache_all) { bundler_2_mode? }
+ settings_flag(:cache_command_is_package) { bundler_2_mode? }
+ settings_flag(:console_command) { !bundler_2_mode? }
+ settings_flag(:default_install_uses_path) { bundler_2_mode? }
+ settings_flag(:deployment_means_frozen) { bundler_2_mode? }
+ settings_flag(:disable_multisource) { bundler_2_mode? }
+ settings_flag(:error_on_stderr) { bundler_2_mode? }
+ settings_flag(:forget_cli_options) { bundler_2_mode? }
+ settings_flag(:global_gem_cache) { bundler_2_mode? }
+ settings_flag(:init_gems_rb) { bundler_2_mode? }
+ settings_flag(:list_command) { bundler_2_mode? }
+ settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
+ settings_flag(:prefer_gems_rb) { bundler_2_mode? }
+ settings_flag(:print_only_version_number) { bundler_2_mode? }
+ settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? }
+ settings_flag(:skip_default_git_sources) { bundler_2_mode? }
+ settings_flag(:specific_platform) { bundler_2_mode? }
+ settings_flag(:suppress_install_using_messages) { bundler_2_mode? }
+ settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
+ settings_flag(:update_requires_all_flag) { bundler_2_mode? }
+
+ settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install }
def initialize(bundler_version)
@bundler_version = Gem::Version.create(bundler_version)
@@ -26,7 +63,5 @@ module Bundler
@bundler_version.segments.first
end
private :major_version
-
- class << self; private :settings_flag; end
end
end
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 9e208e4957..03ff528826 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/vendored_persistent"
require "cgi"
require "securerandom"
@@ -237,7 +238,7 @@ module Bundler
Bundler.settings[:ssl_client_cert]
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
- con = Bundler::Persistent::Net::HTTP::Persistent.new "bundler", :ENV
+ con = PersistentHTTP.new "bundler", :ENV
if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
end
@@ -248,8 +249,11 @@ module Bundler
con.cert_store = bundler_cert_store
end
- if Bundler.settings[:ssl_client_cert]
- pem = File.read(Bundler.settings[:ssl_client_cert])
+ ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
+ (Bundler.rubygems.configuration.ssl_client_cert if
+ Bundler.rubygems.configuration.respond_to?(:ssl_client_cert))
+ if ssl_client_cert
+ pem = File.read(ssl_client_cert)
con.cert = OpenSSL::X509::Certificate.new(pem)
con.key = OpenSSL::PKey::RSA.new(pem)
end
@@ -273,16 +277,19 @@ module Bundler
Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
- Bundler::Persistent::Net::HTTP::Persistent::Error, Zlib::BufError, Errno::EHOSTUNREACH
+ PersistentHTTP::Error, Zlib::BufError, Errno::EHOSTUNREACH
].freeze
def bundler_cert_store
store = OpenSSL::X509::Store.new
- if Bundler.settings[:ssl_ca_cert]
- if File.directory? Bundler.settings[:ssl_ca_cert]
- store.add_path Bundler.settings[:ssl_ca_cert]
+ ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
+ (Bundler.rubygems.configuration.ssl_ca_cert if
+ Bundler.rubygems.configuration.respond_to?(:ssl_ca_cert))
+ if ssl_ca_cert
+ if File.directory? ssl_ca_cert
+ store.add_path ssl_ca_cert
else
- store.add_file Bundler.settings[:ssl_ca_cert]
+ store.add_file ssl_ca_cert
end
else
store.set_default_paths
diff --git a/lib/bundler/fetcher/base.rb b/lib/bundler/fetcher/base.rb
index 271729a534..27987f670a 100644
--- a/lib/bundler/fetcher/base.rb
+++ b/lib/bundler/fetcher/base.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Fetcher
class Base
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 97de88101b..cfc74d642c 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/fetcher/base"
require "bundler/worker"
@@ -61,7 +62,7 @@ module Bundler
compact_index_request :fetch_spec
def available?
- return nil unless md5_available?
+ return nil unless SharedHelpers.md5_available?
user_home = Bundler.user_home
return nil unless user_home.directory? && user_home.writable?
# Read info file checksums out of /versions, so we can know if gems are up to date
@@ -120,16 +121,6 @@ module Bundler
Net::HTTPNotModified.new(nil, nil, nil)
end
end
-
- def md5_available?
- require "openssl"
- OpenSSL::Digest::MD5.digest("")
- true
- rescue LoadError
- true
- rescue OpenSSL::Digest::DigestError
- false
- end
end
end
end
diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb
index 445b0f2332..1430d1ebeb 100644
--- a/lib/bundler/fetcher/dependency.rb
+++ b/lib/bundler/fetcher/dependency.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/fetcher/base"
require "cgi"
@@ -6,7 +7,7 @@ module Bundler
class Fetcher
class Dependency < Base
def available?
- fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri)
+ @available ||= fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri)
rescue NetworkDownError => e
raise HTTPError, e.message
rescue AuthenticationRequiredError
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index 453e4645eb..cbc5e220bd 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Fetcher
class Downloader
diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb
index d8e212989e..9529944391 100644
--- a/lib/bundler/fetcher/index.rb
+++ b/lib/bundler/fetcher/index.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/fetcher/base"
require "rubygems/remote_fetcher"
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index 3ba3dcdd91..f624185773 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -1,5 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true
+
require "cgi"
require "bundler/vendored_thor"
@@ -92,7 +93,7 @@ module Bundler
#{e.backtrace && e.backtrace.join("\n ").chomp}
```
- #{Bundler::Env.new.report}
+ #{Bundler::Env.report}
--- TEMPLATE END ----------------------------------------------------------------
EOS
@@ -119,6 +120,8 @@ module Bundler
def self.with_friendly_errors
yield
+ rescue SignalException
+ raise
rescue Exception => e
FriendlyErrors.log_error(e)
exit FriendlyErrors.exit_status(e)
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 936d1361fa..1d7fc508d5 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/vendored_thor" unless defined?(Thor)
require "bundler"
@@ -50,8 +51,8 @@ module Bundler
install_gem(built_gem_path, :local)
end
- desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to Rubygems\n" \
- "To prevent publishing in Rubygems use `gem_push=no rake release`"
+ desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{gem_push_host}\n" \
+ "To prevent publishing in RubyGems use `gem_push=no rake release`"
task "release", [:remote] => ["build", "release:guard_clean",
"release:source_control_push", "release:rubygem_push"] do
end
@@ -92,18 +93,14 @@ module Bundler
protected
def rubygem_push(path)
- allowed_push_host = nil
gem_command = "gem push '#{path}'"
gem_command += " --key #{gem_key}" if gem_key
- if @gemspec.respond_to?(:metadata)
- allowed_push_host = @gemspec.metadata["allowed_push_host"]
- gem_command += " --host #{allowed_push_host}" if allowed_push_host
- end
+ gem_command += " --host #{allowed_push_host}" if allowed_push_host
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
end
sh(gem_command)
- Bundler.ui.confirm "Pushed #{name} #{version} to #{allowed_push_host ? allowed_push_host : "rubygems.org."}"
+ Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
end
def built_gem_path
@@ -116,6 +113,18 @@ module Bundler
Bundler.ui.confirm "Pushed git commits and tags."
end
+ def allowed_push_host
+ @gemspec.metadata["allowed_push_host"] if @gemspec.respond_to?(:metadata)
+ end
+
+ def gem_push_host
+ env_rubygems_host = ENV["RUBYGEMS_HOST"]
+ env_rubygems_host = nil if
+ env_rubygems_host && env_rubygems_host.empty?
+
+ allowed_push_host || env_rubygems_host || "rubygems.org"
+ end
+
def perform_git_push(options = "")
cmd = "git push #{options}"
out, code = sh_with_code(cmd)
@@ -187,7 +196,7 @@ module Bundler
end
def gem_push?
- !%w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase)
+ !%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
end
end
end
diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb
index 955834ff01..019ae10c66 100644
--- a/lib/bundler/gem_helpers.rb
+++ b/lib/bundler/gem_helpers.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module GemHelpers
GENERIC_CACHE = {} # rubocop:disable MutableConstant
diff --git a/lib/bundler/gem_remote_fetcher.rb b/lib/bundler/gem_remote_fetcher.rb
index 481838a5e2..9577535d63 100644
--- a/lib/bundler/gem_remote_fetcher.rb
+++ b/lib/bundler/gem_remote_fetcher.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "rubygems/remote_fetcher"
module Bundler
diff --git a/lib/bundler/gem_tasks.rb b/lib/bundler/gem_tasks.rb
index 230e7f28f2..f736517bd7 100644
--- a/lib/bundler/gem_tasks.rb
+++ b/lib/bundler/gem_tasks.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "rake/clean"
CLOBBER.include "pkg"
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb
index d60d823d9c..52b5386045 100644
--- a/lib/bundler/gem_version_promoter.rb
+++ b/lib/bundler/gem_version_promoter.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
# This class contains all of the logic for determining the next version of a
# Gem to update to based on the requested level (patch, minor, major).
diff --git a/lib/bundler/gemdeps.rb b/lib/bundler/gemdeps.rb
index 8595b8c7ea..cd4b25d0e6 100644
--- a/lib/bundler/gemdeps.rb
+++ b/lib/bundler/gemdeps.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Gemdeps
def initialize(runtime)
diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb
index e145590430..de6bba0214 100644
--- a/lib/bundler/graph.rb
+++ b/lib/bundler/graph.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "set"
module Bundler
class Graph
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index 5f54796fa2..9166a92738 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "set"
module Bundler
@@ -111,6 +112,13 @@ module Bundler
spec_sets.values.each(&blk)
end
sources.each {|s| s.each(&blk) }
+ self
+ end
+
+ def spec_names
+ names = specs.keys + sources.map(&:spec_names)
+ names.uniq!
+ names
end
# returns a list of the dependencies
@@ -191,14 +199,6 @@ module Bundler
end
end
- wants_prerelease = dependency.requirement.prerelease?
- wants_prerelease ||= base && base.any? {|base_spec| base_spec.version.prerelease? }
- only_prerelease = specs.all? {|spec| spec.version.prerelease? }
-
- unless wants_prerelease || only_prerelease
- found.reject! {|spec| spec.version.prerelease? }
- end
-
found
end
end
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb
index cba1b3d5e5..7fe6a91ddd 100644
--- a/lib/bundler/injector.rb
+++ b/lib/bundler/injector.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Injector
def self.inject(new_deps, options = {})
@@ -12,38 +13,40 @@ module Bundler
end
def inject(gemfile_path, lockfile_path)
- if Bundler.settings[:frozen]
+ if Bundler.frozen?
# ensure the lock and Gemfile are synced
Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
- # temporarily remove frozen while we inject
- frozen = Bundler.settings.delete(:frozen)
end
- # evaluate the Gemfile we have now
- builder = Dsl.new
- builder.eval_gemfile(gemfile_path)
+ # temporarily unfreeze
+ Bundler.settings.temporary(:deployment => false, :frozen => false) do
+ # evaluate the Gemfile we have now
+ builder = Dsl.new
+ builder.eval_gemfile(gemfile_path)
+
+ # don't inject any gems that are already in the Gemfile
+ @new_deps -= builder.dependencies
- # don't inject any gems that are already in the Gemfile
- @new_deps -= builder.dependencies
+ # add new deps to the end of the in-memory Gemfile
+ # Set conservative versioning to false because we want to let the resolver resolve the version first
+ builder.eval_gemfile("injected gems", build_gem_lines(false)) if @new_deps.any?
- # add new deps to the end of the in-memory Gemfile
- # Set conservative versioining to false because we want to let the resolver resolve the version first
- builder.eval_gemfile("injected gems", build_gem_lines(false)) if @new_deps.any?
+ # resolve to see if the new deps broke anything
+ @definition = builder.to_definition(lockfile_path, {})
+ @definition.resolve_remotely!
- # resolve to see if the new deps broke anything
- @definition = builder.to_definition(lockfile_path, {})
- @definition.resolve_remotely!
+ # since nothing broke, we can add those gems to the gemfile
+ append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @new_deps.any?
- # since nothing broke, we can add those gems to the gemfile
- append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @new_deps.any?
+ # since we resolved successfully, write out the lockfile
+ @definition.lock(Bundler.default_lockfile)
- # since we resolved successfully, write out the lockfile
- @definition.lock(Bundler.default_lockfile)
+ # invalidate the cached Bundler.definition
+ Bundler.reset_paths!
- # return an array of the deps that we added
- return @new_deps
- ensure
- Bundler.settings[:frozen] = "1" if frozen
+ # return an array of the deps that we added
+ @new_deps
+ end
end
private
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index 38dcda6b5b..9d25f3261a 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -1,4 +1,7 @@
# frozen_string_literal: true
+
+require "bundler/compatibility_guard"
+
# Allows for declaring a Gemfile inline in a ruby script, optionally installing
# any gems that aren't already installed on the user's system.
#
@@ -39,7 +42,7 @@ def gemfile(install = false, options = {}, &gemfile)
def Bundler.root
Bundler::SharedHelpers.pwd.expand_path
end
- ENV["BUNDLE_GEMFILE"] = "Gemfile"
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
builder = Bundler::Dsl.new
@@ -50,12 +53,7 @@ def gemfile(install = false, options = {}, &gemfile)
definition.validate_runtime!
missing_specs = proc do
- begin
- !definition.missing_specs.empty?
- rescue Bundler::GemNotFound, Bundler::GitError
- definition.instance_variable_set(:@index, nil)
- true
- end
+ definition.missing_specs?
end
Bundler.ui = ui if install
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index bce0e46393..d1066c9c19 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "erb"
require "rubygems/dependency_installer"
require "bundler/worker"
@@ -33,25 +34,26 @@ module Bundler
# Runs the install procedures for a specific Gemfile.
#
- # Firstly, this method will check to see if Bundler.bundle_path exists
- # and if not then will create it. This is usually the location of gems
- # on the system, be it RVM or at a system path.
+ # Firstly, this method will check to see if `Bundler.bundle_path` exists
+ # and if not then Bundler will create the directory. This is usually the same
+ # location as RubyGems which typically is the `~/.gem` directory
+ # unless other specified.
#
- # Secondly, it checks if Bundler has been configured to be "frozen"
+ # Secondly, it checks if Bundler has been configured to be "frozen".
# Frozen ensures that the Gemfile and the Gemfile.lock file are matching.
# This stops a situation where a developer may update the Gemfile but may not run
# `bundle install`, which leads to the Gemfile.lock file not being correctly updated.
# If this file is not correctly updated then any other developer running
# `bundle install` will potentially not install the correct gems.
#
- # Thirdly, Bundler checks if there are any dependencies specified in the Gemfile using
- # Bundler::Environment#dependencies. If there are no dependencies specified then
- # Bundler returns a warning message stating so and this method returns.
+ # Thirdly, Bundler checks if there are any dependencies specified in the Gemfile.
+ # If there are no dependencies specified then Bundler returns a warning message stating
+ # so and this method returns.
#
- # Fourthly, Bundler checks if the default lockfile (Gemfile.lock) exists, and if so
- # then proceeds to set up a definition based on the default gemfile (Gemfile) and the
- # default lock file (Gemfile.lock). However, this is not the case if the platform is different
- # to that which is specified in Gemfile.lock, or if there are any missing specs for the gems.
+ # Fourthly, Bundler checks if the Gemfile.lock exists, and if so
+ # then proceeds to set up a definition based on the Gemfile and the Gemfile.lock.
+ # During this step Bundler will also download information about any new gems
+ # that are not in the Gemfile.lock and resolve any dependencies if needed.
#
# Fifthly, Bundler resolves the dependencies either through a cache of gems or by remote.
# This then leads into the gems being installed, along with stubs for their executables,
@@ -61,26 +63,36 @@ module Bundler
# Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time
# that a user runs `bundle install` they will receive any updates from this process.
#
- # Finally: TODO add documentation for how the standalone process works.
+ # Finally, if the user has specified the standalone flag, Bundler will generate the needed
+ # require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
+ # information.
def run(options)
create_bundle_path
- if Bundler.settings[:frozen]
- @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
- end
+ ProcessLock.lock do
+ if Bundler.frozen?
+ @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
+ end
- if @definition.dependencies.empty?
- Bundler.ui.warn "The Gemfile specifies no dependencies"
- lock
- return
- end
+ if @definition.dependencies.empty?
+ Bundler.ui.warn "The Gemfile specifies no dependencies"
+ lock
+ return
+ end
- resolve_if_need(options)
- ensure_specs_are_compatible!
- install(options)
+ if resolve_if_needed(options)
+ ensure_specs_are_compatible!
+ warn_on_incompatible_bundler_deps
+ load_plugins
+ options.delete(:jobs)
+ else
+ options[:jobs] = 1 # to avoid the overhead of Bundler::Worker
+ end
+ install(options)
- lock unless Bundler.settings[:frozen]
- Standalone.new(options[:standalone], @definition).generate if options[:standalone]
+ lock unless Bundler.frozen?
+ Standalone.new(options[:standalone], @definition).generate if options[:standalone]
+ end
end
def generate_bundler_executable_stubs(spec, options = {})
@@ -101,15 +113,21 @@ module Bundler
end
# double-assignment to avoid warnings about variables that will be used by ERB
- bin_path = bin_path = Bundler.bin_path
- template = template = File.read(File.expand_path("../templates/Executable", __FILE__))
- relative_gemfile_path = relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
- ruby_command = ruby_command = Thor::Util.ruby_command
+ bin_path = Bundler.bin_path
+ bin_path = bin_path
+ relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
+ relative_gemfile_path = relative_gemfile_path
+ ruby_command = Thor::Util.ruby_command
+ ruby_command = ruby_command
+ template_path = File.expand_path("../templates/Executable", __FILE__)
+ if spec.name == "bundler"
+ template_path += ".bundler"
+ spec.executables = %(bundle)
+ end
+ template = File.read(template_path)
exists = []
spec.executables.each do |executable|
- next if executable == "bundle"
-
binstub_path = "#{bin_path}/#{executable}"
if File.exist?(binstub_path) && !options[:force]
exists << executable
@@ -139,13 +157,19 @@ module Bundler
def generate_standalone_bundler_executable_stubs(spec)
# double-assignment to avoid warnings about variables that will be used by ERB
bin_path = Bundler.bin_path
- standalone_path = standalone_path = Bundler.root.join(Bundler.settings[:path]).relative_path_from(bin_path)
+ unless path = Bundler.settings[:path]
+ raise "Can't standalone without an explicit path set"
+ end
+ standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
+ standalone_path = standalone_path
template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
- ruby_command = ruby_command = Thor::Util.ruby_command
+ ruby_command = Thor::Util.ruby_command
+ ruby_command = ruby_command
spec.executables.each do |executable|
next if executable == "bundle"
- executable_path = executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
+ executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
+ executable_path = executable_path
File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
f.puts ERB.new(template, nil, "-").result(binding)
end
@@ -159,13 +183,32 @@ module Bundler
# that said, it's a rare situation (other than rake), and parallel
# installation is SO MUCH FASTER. so we let people opt in.
def install(options)
- Bundler.rubygems.load_plugins
force = options["force"]
- jobs = 1
- jobs = [Bundler.settings[:jobs].to_i - 1, 1].max if can_install_in_parallel?
+ jobs = options.delete(:jobs) do
+ if can_install_in_parallel?
+ [Bundler.settings[:jobs].to_i - 1, 1].max
+ else
+ 1
+ end
+ end
install_in_parallel jobs, options[:standalone], force
end
+ def load_plugins
+ Bundler.rubygems.load_plugins
+
+ requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
+ path_plugin_files = requested_path_gems.map do |spec|
+ begin
+ Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
+ rescue TypeError
+ error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
+ raise Gem::InvalidSpecificationException, error_message
+ end
+ end.flatten
+ Bundler.rubygems.load_plugin_files(path_plugin_files)
+ end
+
def ensure_specs_are_compatible!
system_ruby = Bundler::RubyVersion.system
rubygems_version = Gem::Version.create(Gem::VERSION)
@@ -184,12 +227,28 @@ module Bundler
end
end
+ def warn_on_incompatible_bundler_deps
+ bundler_version = Gem::Version.create(Bundler::VERSION)
+ @definition.specs.each do |spec|
+ spec.dependencies.each do |dep|
+ next if dep.type == :development
+ next unless dep.name == "bundler".freeze
+ next if dep.requirement.satisfied_by?(bundler_version)
+
+ Bundler.ui.warn "#{spec.name} (#{spec.version}) has dependency" \
+ " #{SharedHelpers.pretty_dependency(dep)}" \
+ ", which is unsatisfied by the current bundler version #{VERSION}" \
+ ", so the dependency is being ignored"
+ end
+ end
+ end
+
def can_install_in_parallel?
if Bundler.rubygems.provides?(">= 2.1.0")
true
else
- Bundler.ui.warn "Rubygems #{Gem::VERSION} is not threadsafe, so your "\
- "gems will be installed one at a time. Upgrade to Rubygems 2.1.0 " \
+ Bundler.ui.warn "RubyGems #{Gem::VERSION} is not threadsafe, so your "\
+ "gems will be installed one at a time. Upgrade to RubyGems 2.1.0 " \
"or higher to enable parallel gem installation."
false
end
@@ -207,23 +266,18 @@ module Bundler
Bundler.mkdir_p(p)
end unless Bundler.bundle_path.exist?
rescue Errno::EEXIST
- raise PathError, "Could not install to path `#{Bundler.settings[:path]}` " \
+ raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
"because a file already exists at that path. Either remove or rename the file so the directory can be created."
end
- def resolve_if_need(options)
- if !options["update"] && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
- local = Bundler.ui.silence do
- begin
- tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
- true unless tmpdef.new_platform? || tmpdef.missing_dependencies.any?
- rescue BundlerError
- end
- end
+ # returns whether or not a re-resolve was needed
+ def resolve_if_needed(options)
+ if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
+ return false if @definition.nothing_changed? && !@definition.missing_specs?
end
- return if local
options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
+ true
end
def lock(opts = {})
diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb
index a4d9bcaa07..086b763d20 100644
--- a/lib/bundler/installer/gem_installer.rb
+++ b/lib/bundler/installer/gem_installer.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class GemInstaller
attr_reader :spec, :standalone, :worker, :force, :installer
@@ -65,6 +66,7 @@ module Bundler
end
def generate_executable_stubs
+ return if Bundler.feature_flag.forget_cli_options?
return if Bundler.settings[:inline]
if Bundler.settings[:bin] && standalone
installer.generate_standalone_bundler_executable_stubs(spec)
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb
index 97c124e015..95d9575c44 100644
--- a/lib/bundler/installer/parallel_installer.rb
+++ b/lib/bundler/installer/parallel_installer.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/worker"
require "bundler/installer/gem_installer"
@@ -77,11 +78,6 @@ module Bundler
new(*args).call
end
- # Returns max number of threads machine can handle with a min of 1
- def self.max_threads
- [Bundler.settings[:jobs].to_i - 1, 1].max
- end
-
attr_reader :size
def initialize(installer, all_specs, size, standalone, force)
@@ -99,49 +95,19 @@ module Bundler
require "bundler/gem_remote_fetcher" if RUBY_VERSION < "1.9"
check_for_corrupt_lockfile
- enqueue_specs
- process_specs until @specs.all?(&:installed?) || @specs.any?(&:failed?)
+
+ if @size > 1
+ install_with_worker
+ else
+ install_serially
+ end
+
handle_error if @specs.any?(&:failed?)
@specs
ensure
worker_pool && worker_pool.stop
end
- def worker_pool
- @worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda { |spec_install, worker_num|
- gem_installer = Bundler::GemInstaller.new(
- spec_install.spec, @installer, @standalone, worker_num, @force
- )
- success, message = gem_installer.install_from_spec
- if success && !message.nil?
- spec_install.post_install_message = message
- elsif !success
- spec_install.state = :failed
- spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
- end
- spec_install
- }
- end
-
- # Dequeue a spec and save its post-install message and then enqueue the
- # remaining specs.
- # Some specs might've had to wait til this spec was installed to be
- # processed so the call to `enqueue_specs` is important after every
- # dequeue.
- def process_specs
- spec = worker_pool.deq
- spec.state = :installed unless spec.failed?
- enqueue_specs
- end
-
- def handle_error
- errors = @specs.select(&:failed?).map(&:error)
- if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
- raise exception
- end
- raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
- end
-
def check_for_corrupt_lockfile
missing_dependencies = @specs.map do |s|
[
@@ -167,6 +133,71 @@ module Bundler
Bundler.ui.warn(warning.join("\n"))
end
+ private
+
+ def install_with_worker
+ enqueue_specs
+ process_specs until finished_installing?
+ end
+
+ def install_serially
+ until finished_installing?
+ raise "failed to find a spec to enqueue while installing serially" unless spec_install = @specs.find(&:ready_to_enqueue?)
+ spec_install.state = :enqueued
+ do_install(spec_install, 0)
+ end
+ end
+
+ def worker_pool
+ @worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda { |spec_install, worker_num|
+ do_install(spec_install, worker_num)
+ }
+ end
+
+ def do_install(spec_install, worker_num)
+ gem_installer = Bundler::GemInstaller.new(
+ spec_install.spec, @installer, @standalone, worker_num, @force
+ )
+ success, message = begin
+ gem_installer.install_from_spec
+ rescue => e
+ raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}"
+ end
+ if success
+ spec_install.state = :installed
+ spec_install.post_install_message = message unless message.nil?
+ else
+ spec_install.state = :failed
+ spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
+ end
+ spec_install
+ end
+
+ # Dequeue a spec and save its post-install message and then enqueue the
+ # remaining specs.
+ # Some specs might've had to wait til this spec was installed to be
+ # processed so the call to `enqueue_specs` is important after every
+ # dequeue.
+ def process_specs
+ worker_pool.deq
+ enqueue_specs
+ end
+
+ def finished_installing?
+ @specs.all? do |spec|
+ return true if spec.failed?
+ spec.installed?
+ end
+ end
+
+ def handle_error
+ errors = @specs.select(&:failed?).map(&:error)
+ if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
+ raise exception
+ end
+ raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
+ end
+
def require_tree_for_spec(spec)
tree = @spec_set.what_required(spec)
t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb
index 03411d85e2..ce0c9df1eb 100644
--- a/lib/bundler/installer/standalone.rb
+++ b/lib/bundler/installer/standalone.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Standalone
def initialize(groups, definition)
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 8d9a02c2b8..993952c23b 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "uri"
require "bundler/match_platform"
@@ -68,7 +69,7 @@ module Bundler
end
def __materialize__
- search_object = Bundler.settings[:specific_platform] || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
+ search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
source.gemspec.tap {|s| s.source = source }
else
diff --git a/lib/bundler/lockfile_generator.rb b/lib/bundler/lockfile_generator.rb
new file mode 100644
index 0000000000..585077d18d
--- /dev/null
+++ b/lib/bundler/lockfile_generator.rb
@@ -0,0 +1,95 @@
+# frozen_string_literal: true
+
+module Bundler
+ class LockfileGenerator
+ attr_reader :definition
+ attr_reader :out
+
+ # @private
+ def initialize(definition)
+ @definition = definition
+ @out = String.new
+ end
+
+ def self.generate(definition)
+ new(definition).generate!
+ end
+
+ def generate!
+ add_sources
+ add_platforms
+ add_dependencies
+ add_locked_ruby_version
+ add_bundled_with
+
+ out
+ end
+
+ private
+
+ def add_sources
+ definition.send(:sources).lock_sources.each_with_index do |source, idx|
+ out << "\n" unless idx.zero?
+
+ # Add the source header
+ out << source.to_lock
+
+ # Find all specs for this source
+ specs = definition.resolve.select {|s| source.can_lock?(s) }
+ add_specs(specs)
+ end
+ end
+
+ def add_specs(specs)
+ # This needs to be sorted by full name so that
+ # gems with the same name, but different platform
+ # are ordered consistently
+ specs.sort_by(&:full_name).each do |spec|
+ next if spec.name == "bundler".freeze
+ out << spec.to_lock
+ end
+ end
+
+ def add_platforms
+ add_section("PLATFORMS", definition.platforms)
+ end
+
+ def add_dependencies
+ out << "\nDEPENDENCIES\n"
+
+ handled = []
+ definition.dependencies.sort_by(&:to_s).each do |dep|
+ next if handled.include?(dep.name)
+ out << dep.to_lock
+ handled << dep.name
+ end
+ end
+
+ def add_locked_ruby_version
+ return unless locked_ruby_version = definition.locked_ruby_version
+ add_section("RUBY VERSION", locked_ruby_version.to_s)
+ end
+
+ def add_bundled_with
+ add_section("BUNDLED WITH", definition.locked_bundler_version.to_s)
+ end
+
+ def add_section(name, value)
+ out << "\n#{name}\n"
+ case value
+ when Array
+ value.map(&:to_s).sort.each do |val|
+ out << " #{val}\n"
+ end
+ when Hash
+ value.to_a.sort_by {|k, _| k.to_s }.each do |key, val|
+ out << " #{key}: #{val}\n"
+ end
+ when String
+ out << " #{value}\n"
+ else
+ raise ArgumentError, "#{value.inspect} can't be serialized in a lockfile"
+ end
+ end
+ end
+end
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index dbf8926690..ff706fca1d 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -90,7 +90,7 @@ module Bundler
send("parse_#{@state}", line)
end
end
- @sources << @rubygems_aggregate
+ @sources << @rubygems_aggregate unless Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
@specs = @specs.values.sort_by(&:identifier)
warn_for_outdated_bundler_version
rescue ArgumentError => e
@@ -141,10 +141,16 @@ module Bundler
@sources << @current_source
end
when GEM
- Array(@opts["remote"]).each do |url|
- @rubygems_aggregate.add_remote(url)
+ if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ @opts["remotes"] = @opts.delete("remote")
+ @current_source = TYPES[@type].from_lock(@opts)
+ @sources << @current_source
+ else
+ Array(@opts["remote"]).each do |url|
+ @rubygems_aggregate.add_remote(url)
+ end
+ @current_source = @rubygems_aggregate
end
- @current_source = @rubygems_aggregate
when PLUGIN
@current_source = Plugin.source_from_lock(@opts)
@sources << @current_source
diff --git a/lib/bundler/match_platform.rb b/lib/bundler/match_platform.rb
index 050cd0efd3..56cbbfb95d 100644
--- a/lib/bundler/match_platform.rb
+++ b/lib/bundler/match_platform.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/gem_helpers"
module Bundler
diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb
index 97a6776adb..a6fa070eb8 100644
--- a/lib/bundler/mirror.rb
+++ b/lib/bundler/mirror.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "socket"
module Bundler
@@ -37,7 +38,7 @@ module Bundler
mirror = if config.all?
@all
else
- (@mirrors[config.uri] = @mirrors[config.uri] || Mirror.new)
+ @mirrors[config.uri] ||= Mirror.new
end
config.update_mirror(mirror)
end
@@ -45,7 +46,9 @@ module Bundler
private
def fetch_valid_mirror_for(uri)
- mirror = (@mirrors[URI(uri.to_s.downcase)] || @mirrors[URI(uri.to_s).host] || Mirror.new(uri)).validate!(@prober)
+ downcased = uri.to_s.downcase
+ mirror = @mirrors[downcased] || @mirrors[URI(downcased).host] || Mirror.new(uri)
+ mirror.validate!(@prober)
mirror = Mirror.new(uri) unless mirror.valid?
mirror
end
@@ -117,7 +120,7 @@ module Bundler
def initialize(config_line, value)
uri, fallback =
- config_line.match(%r{^mirror\.(all|.+?)(\.fallback_timeout)?\/?$}).captures
+ config_line.match(%r{\Amirror\.(all|.+?)(\.fallback_timeout)?\/?\z}).captures
@fallback = !fallback.nil?
@all = false
if uri == "all"
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 66f485ef8e..99c9a867b0 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/plugin/api"
module Bundler
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb
index 5d3f58df92..586477efb5 100644
--- a/lib/bundler/plugin/api/source.rb
+++ b/lib/bundler/plugin/api/source.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
+
require "uri"
-require "digest/sha1"
module Bundler
module Plugin
@@ -271,7 +271,7 @@ module Bundler
end
def uri_hash
- Digest::SHA1.hexdigest(uri)
+ SharedHelpers.digest(:SHA1).hexdigest(uri)
end
# Note: Do not override if you don't know what you are doing.
@@ -293,6 +293,13 @@ module Bundler
def bundler_plugin_api_source?
true
end
+
+ # @private
+ # This API on source might not be stable, and for now we expect plugins
+ # to download all specs in `#specs`, so we implement the method for
+ # compatibility purposes and leave it undocumented (and don't support)
+ # overriding it)
+ def double_check_for(*); end
end
end
end
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
index a50d0ceedd..5379c38979 100644
--- a/lib/bundler/plugin/installer.rb
+++ b/lib/bundler/plugin/installer.rb
@@ -13,12 +13,13 @@ module Bundler
def install(names, options)
version = options[:version] || [">= 0"]
-
- if options[:git]
- install_git(names, version, options)
- else
- sources = options[:source] || Bundler.rubygems.sources
- install_rubygems(names, version, sources)
+ Bundler.settings.temporary(:lockfile_uses_separate_rubygems_sources => false, :disable_multisource => false) do
+ if options[:git]
+ install_git(names, version, options)
+ else
+ sources = options[:source] || Bundler.rubygems.sources
+ install_rubygems(names, version, sources)
+ end
end
end
diff --git a/lib/bundler/plugin/source_list.rb b/lib/bundler/plugin/source_list.rb
index 33f5e5afbd..f0e212205f 100644
--- a/lib/bundler/plugin/source_list.rb
+++ b/lib/bundler/plugin/source_list.rb
@@ -5,13 +5,6 @@ module Bundler
# approptiate options to be used with Source classes for plugin installation
module Plugin
class SourceList < Bundler::SourceList
- def initialize
- @path_sources = []
- @git_sources = []
- @rubygems_aggregate = Plugin::Installer::Rubygems.new
- @rubygems_sources = []
- end
-
def add_git_source(options = {})
add_source_to_list Plugin::Installer::Git.new(options), git_sources
end
@@ -21,7 +14,13 @@ module Bundler
end
def all_sources
- path_sources + git_sources + rubygems_sources
+ path_sources + git_sources + rubygems_sources + [metadata_source]
+ end
+
+ private
+
+ def rubygems_aggregate_class
+ Plugin::Installer::Rubygems
end
end
end
diff --git a/lib/bundler/process_lock.rb b/lib/bundler/process_lock.rb
new file mode 100644
index 0000000000..4bd6931577
--- /dev/null
+++ b/lib/bundler/process_lock.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+module Bundler
+ class ProcessLock
+ def self.lock(bundle_path = Bundler.bundle_path)
+ lock_file_path = File.join(bundle_path, "bundler.lock")
+ has_lock = false
+
+ File.open(lock_file_path, "w") do |f|
+ f.flock(File::LOCK_EX)
+ has_lock = true
+ yield
+ f.flock(File::LOCK_UN)
+ end
+ rescue Errno::EACCES, Errno::ENOLCK
+ # In the case the user does not have access to
+ # create the lock file or is using NFS where
+ # locks are not available we skip locking.
+ yield
+ ensure
+ FileUtils.rm_f(lock_file_path) if has_lock
+ end
+ end
+end
diff --git a/lib/bundler/psyched_yaml.rb b/lib/bundler/psyched_yaml.rb
index 69d2ae78c5..e654416a5a 100644
--- a/lib/bundler/psyched_yaml.rb
+++ b/lib/bundler/psyched_yaml.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
# Psych could be a gem, so try to ask for it
begin
gem "psych"
@@ -25,3 +26,12 @@ module Bundler
YamlLibrarySyntaxError = ::ArgumentError
end
end
+
+require "bundler/deprecate"
+begin
+ Bundler::Deprecate.skip_during do
+ require "rubygems/safe_yaml"
+ end
+rescue LoadError
+ # it's OK if the file isn't there
+end
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index 208ee1d4b7..23e1234330 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "uri"
module Bundler
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index db2ae496a4..ddc1d702e0 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -1,178 +1,9 @@
# frozen_string_literal: true
+
module Bundler
class Resolver
require "bundler/vendored_molinillo"
-
- class Molinillo::VersionConflict
- def printable_dep(dep)
- if dep.is_a?(Bundler::Dependency)
- DepProxy.new(dep, dep.platforms.join(", ")).to_s.strip
- else
- dep.to_s
- end
- end
-
- def message
- conflicts.sort.reduce(String.new) do |o, (name, conflict)|
- o << %(\nBundler could not find compatible versions for gem "#{name}":\n)
- if conflict.locked_requirement
- o << %( In snapshot (#{Bundler.default_lockfile.basename}):\n)
- o << %( #{printable_dep(conflict.locked_requirement)}\n)
- o << %(\n)
- end
- o << %( In Gemfile:\n)
- trees = conflict.requirement_trees
-
- maximal = 1.upto(trees.size).map do |size|
- trees.map(&:last).flatten(1).combination(size).to_a
- end.flatten(1).select do |deps|
- Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
- end.min_by(&:size)
- trees.reject! {|t| !maximal.include?(t.last) } if maximal
-
- o << trees.sort_by {|t| t.reverse.map(&:name) }.map do |tree|
- t = String.new
- depth = 2
- tree.each do |req|
- t << " " * depth << req.to_s
- unless tree.last == req
- if spec = conflict.activated_by_name[req.name]
- t << %( was resolved to #{spec.version}, which)
- end
- t << %( depends on)
- end
- t << %(\n)
- depth += 1
- end
- t
- end.join("\n")
-
- if name == "bundler"
- o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
- other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new Bundler::VERSION)
- end
-
- if name == "bundler" && other_bundler_required
- o << "\n"
- o << "This Gemfile requires a different version of Bundler.\n"
- o << "Perhaps you need to update Bundler by running `gem install bundler`?\n"
- end
- if conflict.locked_requirement
- o << "\n"
- o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
- o << %(the gems in your Gemfile, which may resolve the conflict.\n)
- elsif !conflict.existing
- o << "\n"
- if conflict.requirement_trees.first.size > 1
- o << "Could not find gem '#{conflict.requirement}', which is required by "
- o << "gem '#{conflict.requirement_trees.first[-2]}', in any of the sources."
- else
- o << "Could not find gem '#{conflict.requirement}' in any of the sources\n"
- end
- end
- o
- end.strip
- end
- end
-
- class SpecGroup < Array
- include GemHelpers
-
- attr_reader :activated
-
- def initialize(a)
- super
- @required_by = []
- @activated_platforms = []
- @dependencies = nil
- @specs = Hash.new do |specs, platform|
- specs[platform] = select_best_platform_match(self, platform)
- end
- end
-
- def initialize_copy(o)
- super
- @activated_platforms = o.activated.dup
- end
-
- def to_specs
- @activated_platforms.map do |p|
- next unless s = @specs[p]
- lazy_spec = LazySpecification.new(name, version, s.platform, source)
- lazy_spec.dependencies.replace s.dependencies
- lazy_spec
- end.compact
- end
-
- def activate_platform!(platform)
- return unless for?(platform)
- return if @activated_platforms.include?(platform)
- @activated_platforms << platform
- end
-
- def name
- @name ||= first.name
- end
-
- def version
- @version ||= first.version
- end
-
- def source
- @source ||= first.source
- end
-
- def for?(platform)
- spec = @specs[platform]
- !spec.nil?
- end
-
- def to_s
- "#{name} (#{version})"
- end
-
- def dependencies_for_activated_platforms
- dependencies = @activated_platforms.map {|p| __dependencies[p] }
- metadata_dependencies = @activated_platforms.map do |platform|
- metadata_dependencies(@specs[platform], platform)
- end
- dependencies.concat(metadata_dependencies).flatten
- end
-
- def platforms_for_dependency_named(dependency)
- __dependencies.select {|_, deps| deps.map(&:name).include? dependency }.keys
- end
-
- private
-
- def __dependencies
- @dependencies = Hash.new do |dependencies, platform|
- dependencies[platform] = []
- if spec = @specs[platform]
- spec.dependencies.each do |dep|
- next if dep.type == :development
- dependencies[platform] << DepProxy.new(dep, platform)
- end
- end
- dependencies[platform]
- end
- end
-
- def metadata_dependencies(spec, platform)
- return [] unless spec
- # Only allow endpoint specifications since they won't hit the network to
- # fetch the full gemspec when calling required_ruby_version
- return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
- dependencies = []
- if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
- dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
- end
- if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
- dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
- end
- dependencies
- end
- end
+ require "bundler/resolver/spec_group"
# Figures out the best possible configuration of gems that satisfies
# the list of passed dependencies and any child dependencies without
@@ -206,16 +37,22 @@ module Bundler
additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
@platforms = platforms
@gem_version_promoter = gem_version_promoter
+ @allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
+ @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
end
def start(requirements)
+ @prerelease_specified = {}
+ requirements.each {|dep| @prerelease_specified[dep.name] ||= dep.prerelease? }
+
verify_gemfile_dependencies_are_found!(requirements)
dg = @resolver.resolve(requirements, @base_dg)
dg.map(&:payload).
reject {|sg| sg.name.end_with?("\0") }.
map(&:to_specs).flatten
rescue Molinillo::VersionConflict => e
- raise VersionConflict.new(e.conflicts.keys.uniq, e.message)
+ message = version_conflict_message(e)
+ raise VersionConflict.new(e.conflicts.keys.uniq, message)
rescue Molinillo::CircularDependencyError => e
names = e.dependencies.sort_by(&:name).map {|d| "gem '#{d.name}'" }
raise CyclicDependencyError, "Your bundle requires gems that depend" \
@@ -266,6 +103,14 @@ module Bundler
search = @search_for[dependency] ||= begin
index = index_for(dependency)
results = index.search(dependency, @base[dependency.name])
+
+ unless @prerelease_specified[dependency.name]
+ # Move prereleases to the beginning of the list, so they're considered
+ # last during resolution.
+ pre, results = results.partition {|spec| spec.version.prerelease? }
+ results = pre + results
+ end
+
if vertex = @base_dg.vertex_named(dependency.name)
locked_requirement = vertex.payload.requirement
end
@@ -281,7 +126,9 @@ module Bundler
end
nested.reduce([]) do |groups, (version, specs)|
next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
- groups << SpecGroup.new(specs)
+ spec_group = SpecGroup.new(specs)
+ spec_group.ignores_bundler_dependencies = @allow_bundler_dependency_conflicts
+ groups << spec_group
end
else
[]
@@ -298,7 +145,20 @@ module Bundler
end
def index_for(dependency)
- @source_requirements[dependency.name] || @index
+ source = @source_requirements[dependency.name]
+ if source
+ source.specs
+ elsif @lockfile_uses_separate_rubygems_sources
+ Index.build do |idx|
+ if dependency.all_sources
+ dependency.all_sources.each {|s| idx.add_source(s.specs) if s }
+ else
+ idx.add_source @source_requirements[:default].specs
+ end
+ end
+ else
+ @index
+ end
end
def name_for(dependency)
@@ -319,23 +179,53 @@ module Bundler
def requirement_satisfied_by?(requirement, activated, spec)
return false unless requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
+ if spec.version.prerelease? && !requirement.prerelease? && search_for(requirement).any? {|sg| !sg.version.prerelease? }
+ vertex = activated.vertex_named(spec.name)
+ return false if vertex.requirements.none?(&:prerelease?)
+ end
spec.activate_platform!(requirement.__platform) if !@platforms || @platforms.include?(requirement.__platform)
true
end
+ def relevant_sources_for_vertex(vertex)
+ if vertex.root?
+ [@source_requirements[vertex.name]]
+ elsif @lockfile_uses_separate_rubygems_sources
+ vertex.recursive_predecessors.map do |v|
+ @source_requirements[v.name]
+ end << @source_requirements[:default]
+ end
+ end
+
def sort_dependencies(dependencies, activated, conflicts)
dependencies.sort_by do |dependency|
+ dependency.all_sources = relevant_sources_for_vertex(activated.vertex_named(dependency.name))
name = name_for(dependency)
+ vertex = activated.vertex_named(name)
[
@base_dg.vertex_named(name) ? 0 : 1,
- activated.vertex_named(name).payload ? 0 : 1,
+ vertex.payload ? 0 : 1,
+ vertex.root? ? 0 : 1,
amount_constrained(dependency),
conflicts[name] ? 0 : 1,
- activated.vertex_named(name).payload ? 0 : search_for(dependency).count,
+ vertex.payload ? 0 : search_for(dependency).count,
+ self.class.platform_sort_key(dependency.__platform),
]
end
end
+ # Sort platforms from most general to most specific
+ def self.sort_platforms(platforms)
+ platforms.sort_by do |platform|
+ platform_sort_key(platform)
+ end
+ end
+
+ def self.platform_sort_key(platform)
+ return ["", "", ""] if Gem::Platform::RUBY == platform
+ platform.to_a.map {|part| part || "" }
+ end
+
private
# returns an integer \in (-\infty, 0]
@@ -364,32 +254,34 @@ module Bundler
def verify_gemfile_dependencies_are_found!(requirements)
requirements.each do |requirement|
- next if requirement.name == "bundler"
+ name = requirement.name
+ next if name == "bundler"
next unless search_for(requirement).empty?
- if (base = @base[requirement.name]) && !base.empty?
+
+ cache_message = begin
+ " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
+ rescue GemfileNotFound
+ nil
+ end
+
+ if (base = @base[name]) && !base.empty?
version = base.first.version
message = "You have requested:\n" \
- " #{requirement.name} #{requirement.requirement}\n\n" \
- "The bundle currently has #{requirement.name} locked at #{version}.\n" \
- "Try running `bundle update #{requirement.name}`\n\n" \
+ " #{name} #{requirement.requirement}\n\n" \
+ "The bundle currently has #{name} locked at #{version}.\n" \
+ "Try running `bundle update #{name}`\n\n" \
"If you are updating multiple gems in your Gemfile at once,\n" \
"try passing them all to `bundle update`"
- elsif requirement.source
- name = requirement.name
- specs = @source_requirements[name][name]
+ elsif source = @source_requirements[name]
+ specs = source.specs[name]
versions_with_platforms = specs.map {|s| [s.version, s.platform] }
- message = String.new("Could not find gem '#{requirement}' in #{requirement.source}.\n")
+ message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
message << if versions_with_platforms.any?
- "Source contains '#{name}' at: #{formatted_versions_with_platforms(versions_with_platforms)}"
+ "The source contains '#{name}' at: #{formatted_versions_with_platforms(versions_with_platforms)}"
else
- "Source does not contain any versions of '#{requirement}'"
+ "The source does not contain any versions of '#{name}'"
end
else
- cache_message = begin
- " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
- rescue GemfileNotFound
- nil
- end
message = "Could not find gem '#{requirement}' in any of the gem sources " \
"listed in your Gemfile#{cache_message}."
end
@@ -402,9 +294,76 @@ module Bundler
version = vwp.first
platform = vwp.last
version_platform_str = String.new(version.to_s)
- version_platform_str << " #{platform}" unless platform.nil?
+ version_platform_str << " #{platform}" unless platform.nil? || platform == Gem::Platform::RUBY
+ version_platform_str
end
version_platform_strs.join(", ")
end
+
+ def version_conflict_message(e)
+ e.message_with_trees(
+ :solver_name => "Bundler",
+ :possibility_type => "gem",
+ :reduce_trees => lambda do |trees|
+ maximal = 1.upto(trees.size).map do |size|
+ trees.map(&:last).flatten(1).combination(size).to_a
+ end.flatten(1).select do |deps|
+ Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
+ end.min_by(&:size)
+ trees.reject! {|t| !maximal.include?(t.last) } if maximal
+
+ trees = trees.sort_by {|t| t.flatten.map(&:to_s) }
+ trees.uniq! {|t| t.flatten.map {|dep| [dep.name, dep.requirement] } }
+
+ trees.sort_by {|t| t.reverse.map(&:name) }
+ end,
+ :printable_requirement => lambda {|req| SharedHelpers.pretty_dependency(req) },
+ :additional_message_for_conflict => lambda do |o, name, conflict|
+ if name == "bundler"
+ o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
+ other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new Bundler::VERSION)
+ end
+
+ if name == "bundler" && other_bundler_required
+ o << "\n"
+ o << "This Gemfile requires a different version of Bundler.\n"
+ o << "Perhaps you need to update Bundler by running `gem install bundler`?\n"
+ end
+ if conflict.locked_requirement
+ o << "\n"
+ o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
+ o << %(the gems in your Gemfile, which may resolve the conflict.\n)
+ elsif !conflict.existing
+ o << "\n"
+
+ relevant_sources = if conflict.requirement.source
+ [conflict.requirement.source]
+ elsif conflict.requirement.all_sources
+ conflict.requirement.all_sources
+ elsif @lockfile_uses_separate_rubygems_sources
+ # every conflict should have an explicit group of sources when we
+ # enforce strict pinning
+ raise "no source set for #{conflict}"
+ else
+ []
+ end.compact.map(&:to_s).uniq.sort
+
+ o << "Could not find gem '#{SharedHelpers.pretty_dependency(conflict.requirement)}'"
+ if conflict.requirement_trees.first.size > 1
+ o << ", which is required by "
+ o << "gem '#{SharedHelpers.pretty_dependency(conflict.requirement_trees.first[-2])}',"
+ end
+ o << " "
+
+ o << if relevant_sources.empty?
+ "in any of the sources.\n"
+ else
+ "in any of the relevant sources:\n #{relevant_sources * "\n "}\n"
+ end
+ end
+ end,
+ :version_for_spec => lambda {|spec| spec.version }
+ )
+ end
end
end
diff --git a/lib/bundler/resolver/spec_group.rb b/lib/bundler/resolver/spec_group.rb
new file mode 100644
index 0000000000..9c10a4b733
--- /dev/null
+++ b/lib/bundler/resolver/spec_group.rb
@@ -0,0 +1,111 @@
+# frozen_string_literal: true
+
+module Bundler
+ class Resolver
+ class SpecGroup
+ include GemHelpers
+
+ attr_accessor :name, :version, :source
+ attr_accessor :ignores_bundler_dependencies
+
+ def initialize(all_specs)
+ raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
+ @name = exemplary_spec.name
+ @version = exemplary_spec.version
+ @source = exemplary_spec.source
+
+ @required_by = []
+ @activated_platforms = []
+ @dependencies = nil
+ @specs = Hash.new do |specs, platform|
+ specs[platform] = select_best_platform_match(all_specs, platform)
+ end
+ @ignores_bundler_dependencies = true
+ end
+
+ def to_specs
+ @activated_platforms.map do |p|
+ next unless s = @specs[p]
+ lazy_spec = LazySpecification.new(name, version, s.platform, source)
+ lazy_spec.dependencies.replace s.dependencies
+ lazy_spec
+ end.compact
+ end
+
+ def activate_platform!(platform)
+ return unless for?(platform)
+ return if @activated_platforms.include?(platform)
+ @activated_platforms << platform
+ end
+
+ def for?(platform)
+ spec = @specs[platform]
+ !spec.nil?
+ end
+
+ def to_s
+ @to_s ||= "#{name} (#{version})"
+ end
+
+ def dependencies_for_activated_platforms
+ dependencies = @activated_platforms.map {|p| __dependencies[p] }
+ metadata_dependencies = @activated_platforms.map do |platform|
+ metadata_dependencies(@specs[platform], platform)
+ end
+ dependencies.concat(metadata_dependencies).flatten
+ end
+
+ def platforms_for_dependency_named(dependency)
+ __dependencies.select {|_, deps| deps.map(&:name).include? dependency }.keys
+ end
+
+ def ==(other)
+ return unless other.is_a?(SpecGroup)
+ name == other.name &&
+ version == other.version &&
+ source == other.source
+ end
+
+ def eql?(other)
+ name.eql?(other.name) &&
+ version.eql?(other.version) &&
+ source.eql?(other.source)
+ end
+
+ def hash
+ to_s.hash ^ source.hash
+ end
+
+ private
+
+ def __dependencies
+ @dependencies = Hash.new do |dependencies, platform|
+ dependencies[platform] = []
+ if spec = @specs[platform]
+ spec.dependencies.each do |dep|
+ next if dep.type == :development
+ next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
+ dependencies[platform] << DepProxy.new(dep, platform)
+ end
+ end
+ dependencies[platform]
+ end
+ end
+
+ def metadata_dependencies(spec, platform)
+ return [] unless spec
+ # Only allow endpoint specifications since they won't hit the network to
+ # fetch the full gemspec when calling required_ruby_version
+ return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
+ dependencies = []
+ if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
+ dependencies << DepProxy.new(Gem::Dependency.new("ruby\0", spec.required_ruby_version), platform)
+ end
+ if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
+ dependencies << DepProxy.new(Gem::Dependency.new("rubygems\0", spec.required_rubygems_version), platform)
+ end
+ dependencies
+ end
+ end
+ end
+end
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb
index 092fb866b3..244606dcc9 100644
--- a/lib/bundler/retry.rb
+++ b/lib/bundler/retry.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
# General purpose class for retrying code that may fail
class Retry
diff --git a/lib/bundler/ruby_dsl.rb b/lib/bundler/ruby_dsl.rb
index a410b7f3d7..f6ba220cd5 100644
--- a/lib/bundler/ruby_dsl.rb
+++ b/lib/bundler/ruby_dsl.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module RubyDsl
def ruby(*ruby_version)
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb
index f0a001d296..d4e1bdbfd5 100644
--- a/lib/bundler/ruby_version.rb
+++ b/lib/bundler/ruby_version.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class RubyVersion
attr_reader :versions,
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index a0f8fa848b..e9f0eac355 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "pathname"
if defined?(Gem::QuickLoader)
@@ -14,7 +15,7 @@ begin
# shouldn't be deferred.
require "rubygems/source"
rescue LoadError
- # Not available before Rubygems 2.0.0, ignore
+ # Not available before RubyGems 2.0.0, ignore
nil
end
@@ -135,7 +136,7 @@ module Gem
end
class Dependency
- attr_accessor :source, :groups
+ attr_accessor :source, :groups, :all_sources
alias_method :eql?, :==
@@ -146,7 +147,7 @@ module Gem
end
def to_yaml_properties
- instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
+ instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
end
def to_lock
@@ -158,7 +159,7 @@ module Gem
out
end
- # Backport of performance enhancement added to Rubygems 1.4
+ # Backport of performance enhancement added to RubyGems 1.4
def matches_spec?(spec)
# name can be a Regexp, so use ===
return false unless name === spec.name
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index 977e13d948..2b7fa8e0f6 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "rubygems/installer"
module Bundler
@@ -17,6 +18,28 @@ module Bundler
super && validate_bundler_checksum(options[:bundler_expected_checksum])
end
+ def build_extensions
+ extension_cache_path = options[:bundler_extension_cache_path]
+ return super unless extension_cache_path && extension_dir = Bundler.rubygems.spec_extension_dir(spec)
+
+ extension_dir = Pathname.new(extension_dir)
+ build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
+ if build_complete && !options[:force]
+ SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
+ SharedHelpers.filesystem_access(extension_cache_path) do
+ FileUtils.cp_r extension_cache_path, spec.extension_dir
+ end
+ else
+ super
+ if extension_dir.directory? # not made for gems without extensions
+ SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
+ SharedHelpers.filesystem_access(extension_cache_path) do
+ FileUtils.cp_r extension_dir, extension_cache_path
+ end
+ end
+ end
+ end
+
private
def validate_bundler_checksum(checksum)
@@ -25,7 +48,7 @@ module Bundler
return true unless source = @package.instance_variable_get(:@gem)
return true unless source.respond_to?(:with_read_io)
digest = source.with_read_io do |io|
- digest = Digest::SHA256.new
+ digest = SharedHelpers.digest(:SHA256).new
digest << io.read(16_384) until io.eof?
io.rewind
send(checksum_type(checksum), digest)
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index c3e16e086c..0f16b6231d 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "monitor"
require "rubygems"
require "rubygems/config_file"
@@ -84,6 +85,19 @@ module Bundler
spec.respond_to?(:default_gem?) && spec.default_gem?
end
+ def spec_matches_for_glob(spec, glob)
+ return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
+
+ spec.load_paths.map do |lp|
+ Dir["#{lp}/#{glob}#{suffix_pattern}"]
+ end.flatten(1)
+ end
+
+ def spec_extension_dir(spec)
+ return unless spec.respond_to?(:extension_dir)
+ spec.extension_dir
+ end
+
def stub_set_spec(stub, spec)
stub.instance_variable_set(:@spec, spec)
end
@@ -158,6 +172,10 @@ module Bundler
Gem.post_reset_hooks
end
+ def suffix_pattern
+ Gem.suffix_pattern
+ end
+
def gem_cache
gem_path.map {|p| File.expand_path("cache", p) }
end
@@ -165,7 +183,7 @@ module Bundler
def spec_cache_dirs
@spec_cache_dirs ||= begin
dirs = gem_path.map {|dir| File.join(dir, "specifications") }
- dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in Rubygems 2.0.3 or earlier
+ dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in RubyGems 2.0.3 or earlier
dirs.uniq.select {|dir| File.directory? dir }
end
end
@@ -179,7 +197,7 @@ module Bundler
end
def repository_subdirectories
- %w(cache doc gems specifications)
+ %w[cache doc gems specifications]
end
def clear_paths
@@ -190,8 +208,12 @@ module Bundler
Gem.bin_path(gem, bin, ver)
end
+ def path_separator
+ File::PATH_SEPARATOR
+ end
+
def preserve_paths
- # this is a no-op outside of Rubygems 1.8
+ # this is a no-op outside of RubyGems 1.8
yield
end
@@ -212,6 +234,10 @@ module Bundler
Gem.load_plugins if Gem.respond_to?(:load_plugins)
end
+ def load_plugin_files(files)
+ Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
+ end
+
def ui=(obj)
Gem::DefaultUserInteraction.ui = obj
end
@@ -233,9 +259,9 @@ module Bundler
{} # if we can't download them, there aren't any
end
- # TODO: This is for older versions of Rubygems... should we support the
+ # TODO: This is for older versions of RubyGems... should we support the
# X-Gemfile-Source header on these old versions?
- # Maybe the newer implementation will work on older Rubygems?
+ # Maybe the newer implementation will work on older RubyGems?
# It seems difficult to keep this implementation and still send the header.
def fetch_all_remote_specs(remote)
old_sources = Bundler.rubygems.sources
@@ -273,6 +299,7 @@ module Bundler
def spec_from_gem(path, policy = nil)
require "rubygems/security"
+ require "bundler/psyched_yaml"
gem_from_path(path, security_policies[policy]).spec
rescue Gem::Package::FormatError
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
@@ -306,7 +333,7 @@ module Bundler
end
def security_policy_keys
- %w(High Medium Low AlmostNo No).map {|level| "#{level}Security" }
+ %w[High Medium Low AlmostNo No].map {|level| "#{level}Security" }
end
def security_policies
@@ -377,9 +404,8 @@ module Bundler
raise e
end
- # TODO: delete this in 2.0, it's a backwards compatibility shim
- # see https://github.com/bundler/bundler/issues/5102
- kernel_class.send(:public, :gem)
+ # backwards compatibility shim, see https://github.com/bundler/bundler/issues/5102
+ kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
end
end
@@ -434,9 +460,9 @@ module Bundler
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
- unless spec.name == name
- Bundler::SharedHelpers.major_deprecation \
- "Bundler is using a binstub that was created for a different gem.\n" \
+ unless spec.name == gem_name
+ Bundler::SharedHelpers.major_deprecation 2,
+ "Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
"You should run `bundle binstub #{gem_name}` " \
"to work around a system/bundle conflict."
end
@@ -476,7 +502,7 @@ module Bundler
redefine_method(gem_class, :refresh) {}
end
- # Replace or hook into Rubygems to provide a bundlerized view
+ # Replace or hook into RubyGems to provide a bundlerized view
# of the world.
def replace_entrypoints(specs)
specs_by_name = specs.reduce({}) do |h, s|
@@ -492,8 +518,8 @@ module Bundler
Gem.clear_paths
end
- # This backports the correct segment generation code from Rubygems 1.4+
- # by monkeypatching it into the method in Rubygems 1.3.6 and 1.3.7.
+ # This backports the correct segment generation code from RubyGems 1.4+
+ # by monkeypatching it into the method in RubyGems 1.3.6 and 1.3.7.
def backport_segment_generation
redefine_method(Gem::Version, :segments) do
@segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
@@ -512,7 +538,7 @@ module Bundler
end
# This backports base_dir which replaces installation path
- # Rubygems 1.8+
+ # RubyGems 1.8+
def backport_base_dir
redefine_method(Gem::Specification, :base_dir) do
return Gem.dir unless loaded_from
@@ -581,7 +607,7 @@ module Bundler
end
end
- # Rubygems 1.4 through 1.6
+ # RubyGems 1.4 through 1.6
class Legacy < RubygemsIntegration
def initialize
super
@@ -592,7 +618,7 @@ module Bundler
end
def stub_rubygems(specs)
- # Rubygems versions lower than 1.7 use SourceIndex#from_gems_in
+ # RubyGems versions lower than 1.7 use SourceIndex#from_gems_in
source_index_class = (class << Gem::SourceIndex; self; end)
redefine_method(source_index_class, :from_gems_in) do |*args|
Gem::SourceIndex.new.tap do |source_index|
@@ -624,7 +650,7 @@ module Bundler
end
end
- # Rubygems versions 1.3.6 and 1.3.7
+ # RubyGems versions 1.3.6 and 1.3.7
class Ancient < Legacy
def initialize
super
@@ -632,7 +658,7 @@ module Bundler
end
end
- # Rubygems 1.7
+ # RubyGems 1.7
class Transitional < Legacy
def stub_rubygems(specs)
stub_source_index(specs)
@@ -646,7 +672,7 @@ module Bundler
end
end
- # Rubygems 1.8.5-1.8.19
+ # RubyGems 1.8.5-1.8.19
class Modern < RubygemsIntegration
def stub_rubygems(specs)
Gem::Specification.all = specs
@@ -667,9 +693,9 @@ module Bundler
end
end
- # Rubygems 1.8.0 to 1.8.4
+ # RubyGems 1.8.0 to 1.8.4
class AlmostModern < Modern
- # Rubygems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever
+ # RubyGems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever
# you call Gem::Installer#install with an :install_dir set. We have to
# change it back for our sudo mode to work.
def preserve_paths
@@ -680,9 +706,9 @@ module Bundler
end
end
- # Rubygems 1.8.20+
+ # RubyGems 1.8.20+
class MoreModern < Modern
- # Rubygems 1.8.20 and adds the skip_validation parameter, so that's
+ # RubyGems 1.8.20 and adds the skip_validation parameter, so that's
# when we start passing it through.
def build(spec, skip_validation = false)
require "rubygems/builder"
@@ -690,7 +716,7 @@ module Bundler
end
end
- # Rubygems 2.0
+ # RubyGems 2.0
class Future < RubygemsIntegration
def stub_rubygems(specs)
Gem::Specification.all = specs
@@ -767,6 +793,10 @@ module Bundler
def install_with_build_args(args)
yield
end
+
+ def path_separator
+ Gem.path_separator
+ end
end
# RubyGems 2.1.0
@@ -855,7 +885,7 @@ module Bundler
RubygemsIntegration::Transitional.new
elsif RubygemsIntegration.provides?(">= 1.4.0")
RubygemsIntegration::Legacy.new
- else # Rubygems 1.3.6 and 1.3.7
+ else # RubyGems 1.3.6 and 1.3.7
RubygemsIntegration::Ancient.new
end
end
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 5540509d74..f27597b854 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "digest/sha1"
module Bundler
class Runtime
@@ -11,7 +10,7 @@ module Bundler
end
def setup(*groups)
- @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.settings[:frozen]
+ @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen?
groups.map!(&:to_sym)
@@ -262,9 +261,6 @@ module Bundler
end
def setup_manpath
- # Store original MANPATH for restoration later in with_clean_env()
- ENV["BUNDLER_ORIG_MANPATH"] = ENV["MANPATH"]
-
# Add man/ subdirectories from activated bundles to MANPATH for man(1)
manuals = $LOAD_PATH.map do |path|
man_subdir = path.sub(/lib$/, "man")
@@ -272,7 +268,7 @@ module Bundler
end.compact
return if manuals.empty?
- ENV["MANPATH"] = manuals.concat(
+ Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
).uniq.join(File::PATH_SEPARATOR)
end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 1898738b7c..f33e9453be 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -1,60 +1,89 @@
# frozen_string_literal: true
+
require "uri"
module Bundler
class Settings
autoload :Mirror, "bundler/mirror"
autoload :Mirrors, "bundler/mirror"
+ autoload :Validator, "bundler/settings/validator"
- BOOL_KEYS = %w(
+ BOOL_KEYS = %w[
+ allow_bundler_dependency_conflicts
+ allow_deployment_source_credential_changes
allow_offline_install
+ auto_clean_without_path
auto_install
cache_all
cache_all_platforms
+ cache_command_is_package
+ console_command
+ default_install_uses_path
+ deployment
+ deployment_means_frozen
disable_checksum_validation
disable_exec_load
disable_local_branch_check
+ disable_multisource
disable_shared_gems
disable_version_check
+ error_on_stderr
force_ruby_platform
+ forget_cli_options
frozen
gem.coc
gem.mit
+ global_gem_cache
ignore_messages
+ init_gems_rb
+ list_command
+ lockfile_uses_separate_rubygems_sources
major_deprecations
no_install
no_prune
only_update_to_newer_versions
+ path.system
plugins
+ prefer_gems_rb
+ print_only_version_number
+ setup_makes_kernel_gem_public
silence_root_warning
- ).freeze
-
- NUMBER_KEYS = %w(
+ skip_default_git_sources
+ specific_platform
+ suppress_install_using_messages
+ unlock_source_unlocks_spec
+ update_requires_all_flag
+ ].freeze
+
+ NUMBER_KEYS = %w[
redirect
retry
ssl_verify_mode
timeout
- ).freeze
+ ].freeze
+
+ ARRAY_KEYS = %w[
+ with
+ without
+ ].freeze
DEFAULT_CONFIG = {
+ :disable_version_check => true,
:redirect => 5,
:retry => 3,
:timeout => 10,
}.freeze
- attr_accessor :cli_flags_given
-
def initialize(root = nil)
@root = root
@local_config = load_config(local_config_file)
@global_config = load_config(global_config_file)
- @cli_flags_given = false
@temporary = {}
end
def [](name)
key = key_for(name)
- value = @temporary.fetch(name) do
+ value = @temporary.fetch(key) do
@local_config.fetch(key) do
ENV.fetch(key) do
@global_config.fetch(key) do
@@ -65,48 +94,59 @@ module Bundler
converted_value(value, name)
end
- def []=(key, value)
- if cli_flags_given
+ def set_command_option(key, value)
+ if Bundler.feature_flag.forget_cli_options?
+ temporary(key => value)
+ value
+ else
command = if value.nil?
"bundle config --delete #{key}"
else
"bundle config #{key} #{Array(value).join(":")}"
end
- Bundler::SharedHelpers.major_deprecation \
+ Bundler::SharedHelpers.major_deprecation 2,\
"flags passed to commands " \
"will no longer be automatically remembered. Instead please set flags " \
"you want remembered between commands using `bundle config " \
"<setting name> <setting value>`, i.e. `#{command}`"
+
+ set_local(key, value)
end
+ end
+
+ def set_command_option_if_given(key, value)
+ return if value.nil?
+ set_command_option(key, value)
+ end
+
+ def set_local(key, value)
local_config_file || raise(GemfileNotFound, "Could not locate Gemfile")
+
set_key(key, value, @local_config, local_config_file)
end
- alias_method :set_local, :[]=
def temporary(update)
- existing = Hash[update.map {|k, _| [k, @temporary[k]] }]
- @temporary.update(update)
+ existing = Hash[update.map {|k, _| [k, @temporary[key_for(k)]] }]
+ update.each do |k, v|
+ set_key(k, v, @temporary, nil)
+ end
return unless block_given?
begin
yield
ensure
- existing.each {|k, v| v.nil? ? @temporary.delete(k) : @temporary[k] = v }
+ existing.each {|k, v| set_key(k, v, @temporary, nil) }
end
end
- def delete(key)
- @local_config.delete(key_for(key))
- end
-
def set_global(key, value)
set_key(key, value, @global_config, global_config_file)
end
def all
- env_keys = ENV.keys.select {|k| k =~ /BUNDLE_.*/ }
+ env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
- keys = @global_config.keys | @local_config.keys | env_keys
+ keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
keys.map do |key|
key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
@@ -132,7 +172,7 @@ module Bundler
def gem_mirrors
all.inject(Mirrors.new) do |mirrors, k|
- mirrors.parse(k, self[k]) if k =~ /^mirror\./
+ mirrors.parse(k, self[k]) if k.start_with?("mirror.")
mirrors
end
end
@@ -140,6 +180,7 @@ module Bundler
def locations(key)
key = key_for(key)
locations = {}
+ locations[:temporary] = @temporary[key] if @temporary.key?(key)
locations[:local] = @local_config[key] if @local_config.key?(key)
locations[:env] = ENV[key] if ENV[key]
locations[:global] = @global_config[key] if @global_config.key?(key)
@@ -151,6 +192,11 @@ module Bundler
key = key_for(exposed_key)
locations = []
+
+ if @temporary.key?(key)
+ locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
+ end
+
if @local_config.key?(key)
locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
end
@@ -167,37 +213,56 @@ module Bundler
locations
end
- def without=(array)
- set_array(:without, array)
- end
+ # for legacy reasons, the ruby scope isnt appended when the setting comes from ENV or the global config,
+ # nor do we respect :disable_shared_gems
+ def path
+ key = key_for(:path)
+ path = ENV[key] || @global_config[key]
+ if path && !@temporary.key?(key) && !@local_config.key?(key)
+ return Path.new(path, false, false, false)
+ end
- def with=(array)
- set_array(:with, array)
+ system_path = self["path.system"] || (self[:disable_shared_gems] == false)
+ Path.new(self[:path], true, system_path, Bundler.feature_flag.default_install_uses_path?)
end
- def without
- get_array(:without)
- end
+ Path = Struct.new(:explicit_path, :append_ruby_scope, :system_path, :default_install_uses_path) do
+ def path
+ path = base_path
+ path = File.join(path, Bundler.ruby_scope) if append_ruby_scope && !use_system_gems?
+ path
+ end
- def with
- get_array(:with)
- end
+ def use_system_gems?
+ return true if system_path
+ return false if explicit_path
+ !default_install_uses_path
+ end
- # @local_config["BUNDLE_PATH"] should be prioritized over ENV["BUNDLE_PATH"]
- def path
- key = key_for(:path)
- path = ENV[key] || @global_config[key]
- return path if path && !@local_config.key?(key)
+ def base_path
+ path = explicit_path
+ path ||= ".bundle" unless use_system_gems?
+ path ||= Bundler.rubygems.gem_dir
+ path
+ end
- if path = self[:path]
- "#{path}/#{Bundler.ruby_scope}"
- else
- Bundler.rubygems.gem_dir
+ def validate!
+ return unless explicit_path && system_path
+ path = Bundler.settings.pretty_values_for(:path)
+ path.unshift(nil, "path:") unless path.empty?
+ system_path = Bundler.settings.pretty_values_for("path.system")
+ system_path.unshift(nil, "path.system:") unless system_path.empty?
+ disable_shared_gems = Bundler.settings.pretty_values_for(:disable_shared_gems)
+ disable_shared_gems.unshift(nil, "disable_shared_gems:") unless disable_shared_gems.empty?
+ raise InvalidOption,
+ "Using a custom path while using system gems is unsupported.\n#{path.join("\n")}\n#{system_path.join("\n")}\n#{disable_shared_gems.join("\n")}"
end
end
def allow_sudo?
- !@local_config.key?(key_for(:path))
+ key = key_for(:path)
+ path_configured = @temporary.key?(key) || @local_config.key?(key)
+ !path_configured
end
def ignore_config?
@@ -205,14 +270,17 @@ module Bundler
end
def app_cache_path
- @app_cache_path ||= begin
- path = self[:cache_path] || "vendor/cache"
- raise InvalidOption, "Cache path must be relative to the bundle path" if path.start_with?("/")
- path
- end
+ @app_cache_path ||= self[:cache_path] || "vendor/cache"
end
- private
+ def validate!
+ all.each do |raw_key|
+ [@local_config, ENV, @global_config].each do |settings|
+ value = converted_value(settings[key_for(raw_key)], raw_key)
+ Validator.validate!(raw_key, value, settings.to_hash.dup)
+ end
+ end
+ end
def key_for(key)
key = Settings.normalize_uri(key).to_s if key.is_a?(String) && /https?:/ =~ key
@@ -220,15 +288,17 @@ module Bundler
"BUNDLE_#{key}"
end
+ private
+
def parent_setting_for(name)
- split_specfic_setting_for(name)[0]
+ split_specific_setting_for(name)[0]
end
- def specfic_gem_for(name)
- split_specfic_setting_for(name)[1]
+ def specific_gem_for(name)
+ split_specific_setting_for(name)[1]
end
- def split_specfic_setting_for(name)
+ def split_specific_setting_for(name)
name.split(".")
end
@@ -245,43 +315,57 @@ module Bundler
end
end
- def is_num(value)
- NUMBER_KEYS.include?(value.to_s)
+ def is_num(key)
+ NUMBER_KEYS.include?(key.to_s)
end
- def get_array(key)
- self[key] ? self[key].split(":").map(&:to_sym) : []
+ def is_array(key)
+ ARRAY_KEYS.include?(key.to_s)
end
- def set_array(key, array)
- self[key] = (array.empty? ? nil : array.join(":")) if array
+ def to_array(value)
+ return [] unless value
+ value.split(":").map(&:to_sym)
end
- def set_key(key, value, hash, file)
- key = key_for(key)
+ def array_to_s(array)
+ array = Array(array)
+ return nil if array.empty?
+ array.join(":").tr(" ", ":")
+ end
- unless hash[key] == value
- hash[key] = value
- hash.delete(key) if value.nil?
- SharedHelpers.filesystem_access(file) do |p|
- FileUtils.mkdir_p(p.dirname)
- require "bundler/yaml_serializer"
- p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
- end
- end
+ def set_key(raw_key, value, hash, file)
+ raw_key = raw_key.to_s
+ value = array_to_s(value) if is_array(raw_key)
+
+ key = key_for(raw_key)
+
+ return if hash[key] == value
+
+ hash[key] = value
+ hash.delete(key) if value.nil?
- value
+ Validator.validate!(raw_key, converted_value(value, raw_key), hash)
+
+ return unless file
+ SharedHelpers.filesystem_access(file) do |p|
+ FileUtils.mkdir_p(p.dirname)
+ require "bundler/yaml_serializer"
+ p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
+ end
end
def converted_value(value, key)
- if value.nil?
+ if is_array(key)
+ to_array(value)
+ elsif value.nil?
nil
elsif is_bool(key) || value == "false"
to_bool(value)
elsif is_num(key)
value.to_i
else
- value
+ value.to_s
end
end
@@ -325,16 +409,34 @@ module Bundler
end
end
+ PER_URI_OPTIONS = %w[
+ fallback_timeout
+ ].freeze
+
+ NORMALIZE_URI_OPTIONS_PATTERN =
+ /
+ \A
+ (\w+\.)? # optional prefix key
+ (https?.*?) # URI
+ (\.#{Regexp.union(PER_URI_OPTIONS)})? # optional suffix key
+ \z
+ /ix
+
# TODO: duplicates Rubygems#normalize_uri
# TODO: is this the correct place to validate mirror URIs?
def self.normalize_uri(uri)
uri = uri.to_s
- uri = "#{uri}/" unless uri =~ %r{/\Z}
+ if uri =~ NORMALIZE_URI_OPTIONS_PATTERN
+ prefix = $1
+ uri = $2
+ suffix = $3
+ end
+ uri = "#{uri}/" unless uri.end_with?("/")
uri = URI(uri)
unless uri.absolute?
raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
end
- uri
+ "#{prefix}#{uri}#{suffix}"
end
end
end
diff --git a/lib/bundler/settings/validator.rb b/lib/bundler/settings/validator.rb
new file mode 100644
index 0000000000..9aa1627fb2
--- /dev/null
+++ b/lib/bundler/settings/validator.rb
@@ -0,0 +1,79 @@
+# frozen_string_literal: true
+
+module Bundler
+ class Settings
+ class Validator
+ class Rule
+ attr_reader :description
+
+ def initialize(keys, description, &validate)
+ @keys = keys
+ @description = description
+ @validate = validate
+ end
+
+ def validate!(key, value, settings)
+ instance_exec(key, value, settings, &@validate)
+ end
+
+ def fail!(key, value, *reasons)
+ reasons.unshift @description
+ raise InvalidOption, "Setting `#{key}` to #{value.inspect} failed:\n#{reasons.map {|r| " - #{r}" }.join("\n")}"
+ end
+
+ def set(settings, key, value, *reasons)
+ hash_key = k(key)
+ return if settings[hash_key] == value
+ reasons.unshift @description
+ Bundler.ui.info "Setting `#{key}` to #{value.inspect}, since #{reasons.join(", ")}"
+ if value.nil?
+ settings.delete(hash_key)
+ else
+ settings[hash_key] = value
+ end
+ end
+
+ def k(key)
+ Bundler.settings.key_for(key)
+ end
+ end
+
+ def self.rules
+ @rules ||= Hash.new {|h, k| h[k] = [] }
+ end
+ private_class_method :rules
+
+ def self.rule(keys, description, &blk)
+ rule = Rule.new(keys, description, &blk)
+ keys.each {|k| rules[k] << rule }
+ end
+ private_class_method :rule
+
+ def self.validate!(key, value, settings)
+ rules_to_validate = rules[key]
+ rules_to_validate.each {|rule| rule.validate!(key, value, settings) }
+ end
+
+ rule %w[path path.system], "path and path.system are mutually exclusive" do |key, value, settings|
+ if key == "path" && value
+ set(settings, "path.system", nil)
+ elsif key == "path.system" && value
+ set(settings, :path, nil)
+ end
+ end
+
+ rule %w[with without], "a group cannot be in both `with` & `without` simultaneously" do |key, value, settings|
+ with = settings.fetch(k(:with), "").split(":").map(&:to_sym)
+ without = settings.fetch(k(:without), "").split(":").map(&:to_sym)
+
+ other_key = key == "with" ? :without : :with
+ other_setting = key == "with" ? without : with
+
+ conflicting = with & without
+ if conflicting.any?
+ fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
+ end
+ end
+ end
+ end
+end
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
index 9aae6478cd..ac6a5bf861 100644
--- a/lib/bundler/setup.rb
+++ b/lib/bundler/setup.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/shared_helpers"
if Bundler::SharedHelpers.in_bundle?
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index a9141a1346..5566bc5832 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -1,7 +1,11 @@
# frozen_string_literal: true
+
+require "bundler/compatibility_guard"
+
require "pathname"
require "rubygems"
+require "bundler/version"
require "bundler/constants"
require "bundler/rubygems_integration"
require "bundler/current_ruby"
@@ -19,10 +23,16 @@ end
module Bundler
module SharedHelpers
- def default_gemfile
+ def root
gemfile = find_gemfile
raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
- Pathname.new(gemfile).untaint
+ Pathname.new(gemfile).untaint.expand_path.parent
+ end
+
+ def default_gemfile
+ gemfile = find_gemfile(:order_matters)
+ raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
+ Pathname.new(gemfile).untaint.expand_path
end
def default_lockfile
@@ -63,7 +73,7 @@ module Bundler
end
def with_clean_git_env(&block)
- keys = %w(GIT_DIR GIT_WORK_TREE)
+ keys = %w[GIT_DIR GIT_WORK_TREE]
old_env = keys.inject({}) do |h, k|
h.update(k => ENV[k])
end
@@ -129,20 +139,34 @@ module Bundler
namespace.const_get(constant_name)
end
- def major_deprecation(message)
+ def major_deprecation(major_version, message)
+ if Bundler.bundler_major_version >= major_version
+ require "bundler/errors"
+ raise DeprecatedError, "[REMOVED FROM #{major_version}.0] #{message}"
+ end
+
return unless prints_major_deprecations?
@major_deprecation_ui ||= Bundler::UI::Shell.new("no-color" => true)
ui = Bundler.ui.is_a?(@major_deprecation_ui.class) ? Bundler.ui : @major_deprecation_ui
- ui.warn("[DEPRECATED FOR #{Bundler::VERSION.split(".").first.to_i + 1}.0] #{message}")
+ ui.warn("[DEPRECATED FOR #{major_version}.0] #{message}")
end
def print_major_deprecations!
- deprecate_gemfile(find_gemfile) if find_gemfile == find_file("Gemfile")
+ multiple_gemfiles = search_up(".") do |dir|
+ gemfiles = gemfile_names.select {|gf| File.file? File.expand_path(gf, dir) }
+ next if gemfiles.empty?
+ break false if gemfiles.size == 1
+ end
+ if multiple_gemfiles && Bundler.bundler_major_version == 1
+ Bundler::SharedHelpers.major_deprecation 2, \
+ "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock."
+ end
+
if RUBY_VERSION < "2"
- major_deprecation("Bundler will only support ruby >= 2.0, you are running #{RUBY_VERSION}")
+ major_deprecation(2, "Bundler will only support ruby >= 2.0, you are running #{RUBY_VERSION}")
end
return if Bundler.rubygems.provides?(">= 2")
- major_deprecation("Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}")
+ major_deprecation(2, "Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}")
end
def trap(signal, override = false, &block)
@@ -170,23 +194,59 @@ module Bundler
"\nEither installing with `--full-index` or running `bundle update #{spec.name}` should fix the problem."
end
+ def pretty_dependency(dep, print_source = false)
+ msg = String.new(dep.name)
+ msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
+ if dep.is_a?(Bundler::Dependency)
+ platform_string = dep.platforms.join(", ")
+ msg << " " << platform_string if !platform_string.empty? && platform_string != Gem::Platform::RUBY
+ end
+ msg << " from the `#{dep.source}` source" if print_source && dep.source
+ msg
+ end
+
+ def md5_available?
+ return @md5_available if defined?(@md5_available)
+ @md5_available = begin
+ require "openssl"
+ OpenSSL::Digest::MD5.digest("")
+ true
+ rescue LoadError
+ true
+ rescue OpenSSL::Digest::DigestError
+ false
+ end
+ end
+
+ def digest(name)
+ require "digest"
+ Digest(name)
+ end
+
private
def validate_bundle_path
- return unless Bundler.bundle_path.to_s.include?(File::PATH_SEPARATOR)
- message = "Your bundle path contains a '#{File::PATH_SEPARATOR}', " \
+ path_separator = Bundler.rubygems.path_separator
+ return unless Bundler.bundle_path.to_s.split(path_separator).size > 1
+ message = "Your bundle path contains text matching #{path_separator.inspect}, " \
"which is the path separator for your system. Bundler cannot " \
"function correctly when the Bundle path contains the " \
"system's PATH separator. Please change your " \
- "bundle path to not include '#{File::PATH_SEPARATOR}'." \
+ "bundle path to not match #{path_separator.inspect}." \
"\nYour current bundle path is '#{Bundler.bundle_path}'."
raise Bundler::PathError, message
end
- def find_gemfile
+ def find_gemfile(order_matters = false)
given = ENV["BUNDLE_GEMFILE"]
return given if given && !given.empty?
- find_file("Gemfile", "gems.rb")
+ names = gemfile_names
+ names.reverse! if order_matters && Bundler.feature_flag.prefer_gems_rb?
+ find_file(*names)
+ end
+
+ def gemfile_names
+ ["Gemfile", "gems.rb"]
end
def find_file(*names)
@@ -226,40 +286,51 @@ module Bundler
end
end
+ def set_env(key, value)
+ raise ArgumentError, "new key #{key}" unless EnvironmentPreserver::BUNDLER_KEYS.include?(key)
+ orig_key = "#{EnvironmentPreserver::BUNDLER_PREFIX}#{key}"
+ orig = ENV[key]
+ orig ||= EnvironmentPreserver::INTENTIONALLY_NIL
+ ENV[orig_key] ||= orig
+
+ ENV[key] = value
+ end
+ public :set_env
+
def set_bundle_variables
begin
- ENV["BUNDLE_BIN_PATH"] = Bundler.rubygems.bin_path("bundler", "bundle", VERSION)
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", Bundler.rubygems.bin_path("bundler", "bundle", VERSION)
rescue Gem::GemNotFoundException
if File.exist?(File.expand_path("../../../exe/bundle", __FILE__))
- ENV["BUNDLE_BIN_PATH"] = File.expand_path("../../../exe/bundle", __FILE__)
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../exe/bundle", __FILE__)
else
- ENV["BUNDLE_BIN_PATH"] = File.expand_path("../../../../bin/bundle", __FILE__)
+ Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", File.expand_path("../../../../bin/bundle", __FILE__)
end
end
# Set BUNDLE_GEMFILE
- ENV["BUNDLE_GEMFILE"] = find_gemfile.to_s
- ENV["BUNDLER_VERSION"] = Bundler::VERSION
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile(:order_matters).to_s
+ Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION
end
def set_path
validate_bundle_path
paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR)
paths.unshift "#{Bundler.bundle_path}/bin"
- ENV["PATH"] = paths.uniq.join(File::PATH_SEPARATOR)
+ Bundler::SharedHelpers.set_env "PATH", paths.uniq.join(File::PATH_SEPARATOR)
end
def set_rubyopt
rubyopt = [ENV["RUBYOPT"]].compact
return if !rubyopt.empty? && rubyopt.first =~ %r{-rbundler/setup}
rubyopt.unshift %(-rbundler/setup)
- ENV["RUBYOPT"] = rubyopt.join(" ")
+ Bundler::SharedHelpers.set_env "RUBYOPT", rubyopt.join(" ")
end
def set_rubylib
rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
rubylib.unshift bundler_ruby_lib
- ENV["RUBYLIB"] = rubylib.uniq.join(File::PATH_SEPARATOR)
+ Bundler::SharedHelpers.set_env "RUBYLIB", rubylib.uniq.join(File::PATH_SEPARATOR)
end
def bundler_ruby_lib
@@ -290,12 +361,6 @@ module Bundler
true
end
- def deprecate_gemfile(gemfile)
- return unless gemfile && File.basename(gemfile) == "Gemfile"
- Bundler::SharedHelpers.major_deprecation \
- "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock."
- end
-
extend self
end
end
diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb
index e9c1413ea3..b7f3ee7afa 100644
--- a/lib/bundler/similarity_detector.rb
+++ b/lib/bundler/similarity_detector.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class SimilarityDetector
SimilarityScore = Struct.new(:string, :distance)
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index cf56ed1cc1..5a1f05098b 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -1,8 +1,10 @@
# frozen_string_literal: true
+
module Bundler
class Source
autoload :Gemspec, "bundler/source/gemspec"
autoload :Git, "bundler/source/git"
+ autoload :Metadata, "bundler/source/metadata"
autoload :Path, "bundler/source/path"
autoload :Rubygems, "bundler/source/rubygems"
@@ -31,6 +33,15 @@ module Bundler
spec.source == self
end
+ # it's possible that gems from one source depend on gems from some
+ # other source, so now we download gemspecs and iterate over those
+ # dependencies, looking for gems we don't have info on yet.
+ def double_check_for(*); end
+
+ def dependency_names_to_double_check
+ specs.dependency_names
+ end
+
def include?(other)
other == self
end
@@ -39,6 +50,10 @@ module Bundler
"#<#{self.class}:0x#{object_id} #{self}>"
end
+ def path?
+ instance_of?(Bundler::Source::Path)
+ end
+
private
def version_color(spec_version, locked_spec_version)
@@ -54,5 +69,26 @@ module Bundler
def earlier_version?(spec_version, locked_spec_version)
Gem::Version.new(spec_version) < Gem::Version.new(locked_spec_version)
end
+
+ def print_using_message(message)
+ if !message.include?("(was ") && Bundler.feature_flag.suppress_install_using_messages?
+ Bundler.ui.debug message
+ else
+ Bundler.ui.info message
+ end
+ end
+
+ def extension_cache_path(spec)
+ return unless Bundler.feature_flag.global_gem_cache?
+ return unless source_slug = extension_cache_slug(spec)
+ Bundler.user_cache.join(
+ "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
+ source_slug, spec.full_name
+ )
+ end
+
+ def extension_cache_slug(_)
+ nil
+ end
end
end
diff --git a/lib/bundler/source/gemspec.rb b/lib/bundler/source/gemspec.rb
index 05e613277f..7e3447e776 100644
--- a/lib/bundler/source/gemspec.rb
+++ b/lib/bundler/source/gemspec.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Source
class Gemspec < Path
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index b3e218e390..a1a59ddce5 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require "fileutils"
+
+require "bundler/vendored_fileutils"
require "uri"
-require "digest/sha1"
module Bundler
class Source
@@ -18,7 +18,7 @@ module Bundler
@allow_remote = false
# Stringify options that could be set as symbols
- %w(ref branch tag revision).each {|k| options[k] = options[k].to_s if options[k] }
+ %w[ref branch tag revision].each {|k| options[k] = options[k].to_s if options[k] }
@uri = options["uri"] || ""
@branch = options["branch"]
@@ -39,7 +39,7 @@ module Bundler
out = String.new("GIT\n")
out << " remote: #{@uri}\n"
out << " revision: #{revision}\n"
- %w(ref branch tag submodules).each do |opt|
+ %w[ref branch tag submodules].each do |opt|
out << " #{opt}: #{options[opt]}\n" if options[opt]
end
out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
@@ -169,15 +169,13 @@ module Bundler
def install(spec, options = {})
force = options[:force]
- Bundler.ui.info "Using #{version_message(spec)} from #{self}"
+ print_using_message "Using #{version_message(spec)} from #{self}"
- if requires_checkout? && !@copied && !force
+ if (requires_checkout? && !@copied) || force
Bundler.ui.debug " * Checking out revision: #{ref}"
git_proxy.copy_to(install_path, submodules)
serialize_gemspecs_in(install_path)
@copied = true
- elsif force
- git_proxy.copy_to(install_path, submodules)
end
generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] }
@@ -188,7 +186,7 @@ module Bundler
def cache(spec, custom_path = nil)
app_cache_path = app_cache_path(custom_path)
- return unless Bundler.settings[:cache_all]
+ return unless Bundler.feature_flag.cache_all?
return if path == app_cache_path
cached!
FileUtils.rm_rf(app_cache_path)
@@ -210,13 +208,11 @@ module Bundler
# When using local git repos, this is set to the local repo.
def cache_path
@cache_path ||= begin
- git_scope = "#{base_name}-#{uri_hash}"
-
- if Bundler.requires_sudo?
- Bundler.user_bundle_path.join("cache/git", git_scope)
+ if Bundler.requires_sudo? || Bundler.feature_flag.global_gem_cache?
+ Bundler.user_cache
else
- Bundler.cache.join("git", git_scope)
- end
+ Bundler.bundle_path.join("cache", "bundler")
+ end.join("git", git_scope)
end
end
@@ -287,7 +283,7 @@ module Bundler
# If there is no URI scheme, assume it is an ssh/git URI
input = uri
end
- Digest::SHA1.hexdigest(input)
+ SharedHelpers.digest(:SHA1).hexdigest(input)
end
def cached_revision
@@ -304,9 +300,9 @@ module Bundler
def fetch
git_proxy.checkout
- rescue GitError
+ rescue GitError => e
raise unless Bundler.feature_flag.allow_offline_install?
- Bundler.ui.warn "Using cached git data because of network errors"
+ Bundler.ui.warn "Using cached git data because of network errors:\n#{e}"
end
# no-op, since we validate when re-serializing the gemspec
@@ -319,6 +315,14 @@ module Bundler
StubSpecification.from_stub(stub)
end
end
+
+ def git_scope
+ "#{base_name}-#{uri_hash}"
+ end
+
+ def extension_cache_slug(_)
+ extension_dir_name
+ end
end
end
end
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index c05d7a5afa..c56dda66ea 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "shellwords"
require "tempfile"
module Bundler
@@ -62,7 +63,7 @@ module Bundler
begin
@revision ||= find_local_revision
rescue GitCommandError
- raise MissingGitRevisionError.new(ref, uri)
+ raise MissingGitRevisionError.new(ref, URICredentialsFilter.credential_filtered_uri(uri))
end
@revision
@@ -90,18 +91,21 @@ module Bundler
end
def checkout
- if path.exist?
- return if has_revision_cached?
- Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
- in_path do
- git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*")
- end
- else
- Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
+ return if path.exist? && has_revision_cached?
+ extra_ref = "#{Shellwords.shellescape(ref)}:#{Shellwords.shellescape(ref)}" if ref && ref.start_with?("refs/")
+
+ Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
+
+ unless path.exist?
SharedHelpers.filesystem_access(path.dirname) do |p|
FileUtils.mkdir_p(p)
end
git_retry %(clone #{uri_escaped_with_configured_credentials} "#{path}" --bare --no-hardlinks --quiet)
+ return unless extra_ref
+ end
+
+ in_path do
+ git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref})
end
end
@@ -149,7 +153,7 @@ module Bundler
end
def git_retry(command)
- Bundler::Retry.new("`git #{command}`", GitNotAllowedError).attempts do
+ Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do
git(command)
end
end
@@ -217,6 +221,7 @@ module Bundler
def in_path(&blk)
checkout unless path.exist?
+ _ = URICredentialsFilter # load it before we chdir
SharedHelpers.chdir(path, &blk)
end
diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb
new file mode 100644
index 0000000000..93909002c7
--- /dev/null
+++ b/lib/bundler/source/metadata.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+
+module Bundler
+ class Source
+ class Metadata < Source
+ def specs
+ @specs ||= Index.build do |idx|
+ idx << Gem::Specification.new("ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
+ idx << Gem::Specification.new("rubygems\0", Gem::VERSION)
+
+ idx << Gem::Specification.new do |s|
+ s.name = "bundler"
+ s.version = VERSION
+ s.platform = Gem::Platform::RUBY
+ s.source = self
+ s.authors = ["bundler team"]
+ s.bindir = "exe"
+ s.executables = %w[bundle]
+ # can't point to the actual gemspec or else the require paths will be wrong
+ s.loaded_from = File.expand_path("..", __FILE__)
+ end
+ if loaded_spec = nil && Bundler.rubygems.loaded_specs("bundler")
+ idx << loaded_spec # this has to come after the fake gemspec, to override it
+ elsif local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
+ idx << local_spec
+ end
+
+ idx.each {|s| s.source = self }
+ end
+ end
+
+ def cached!; end
+
+ def remote!; end
+
+ def options
+ {}
+ end
+
+ def install(spec, _opts = {})
+ print_using_message "Using #{version_message(spec)}"
+ nil
+ end
+
+ def to_s
+ "the local ruby installation"
+ end
+
+ def ==(other)
+ self.class == other.class
+ end
+ alias_method :eql?, :==
+
+ def hash
+ self.class.hash
+ end
+
+ def version_message(spec)
+ "#{spec.name} #{spec.version}"
+ end
+ end
+ end
+end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 8dd0763cc1..ed734bf549 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Source
class Path < Source
@@ -35,10 +36,12 @@ module Bundler
end
def remote!
+ @local_specs = nil
@allow_remote = true
end
def cached!
+ @local_specs = nil
@allow_cached = true
end
@@ -74,14 +77,14 @@ module Bundler
end
def install(spec, options = {})
- Bundler.ui.info "Using #{version_message(spec)} from #{self}"
+ print_using_message "Using #{version_message(spec)} from #{self}"
generate_bin(spec, :disable_extensions => true)
nil # no post-install message
end
def cache(spec, custom_path = nil)
app_cache_path = app_cache_path(custom_path)
- return unless Bundler.settings[:cache_all]
+ return unless Bundler.feature_flag.cache_all?
return if expand(@original_path).to_s.index(root_path.to_s + "/") == 0
unless @original_path.exist?
@@ -113,10 +116,6 @@ module Bundler
Bundler.root
end
- def is_a_path?
- instance_of?(Path)
- end
-
def expanded_original_path
@expanded_original_path ||= expand(original_path)
end
@@ -228,7 +227,8 @@ module Bundler
spec,
:env_shebang => false,
:disable_extensions => options[:disable_extensions],
- :build_args => options[:build_args]
+ :build_args => options[:build_args],
+ :bundler_extension_cache_path => extension_cache_path(spec)
)
installer.post_install
rescue Gem::InvalidSpecificationException => e
@@ -242,7 +242,7 @@ module Bundler
"to modify their .gemspec so it can work with `gem build`."
end
- Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}"
+ Bundler.ui.warn "The validation message from RubyGems was:\n #{e.message}"
end
end
end
diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb
index 9c2f74a31b..a0357ffa39 100644
--- a/lib/bundler/source/path/installer.rb
+++ b/lib/bundler/source/path/installer.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Source
class Path
@@ -6,6 +7,7 @@ module Bundler
attr_reader :spec
def initialize(spec, options = {})
+ @options = options
@spec = spec
@gem_dir = Bundler.rubygems.path(spec.full_gem_path)
@wrappers = true
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 353194f53f..6f4157364f 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "uri"
require "rubygems/user_interaction"
@@ -31,6 +32,7 @@ module Bundler
end
def cached!
+ @specs = nil
@allow_cached = true
end
@@ -49,6 +51,7 @@ module Bundler
end
def can_lock?(spec)
+ return super if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
spec.source.is_a?(Rubygems)
end
@@ -69,8 +72,12 @@ module Bundler
end
def to_s
- remote_names = remotes.map(&:to_s).join(", ")
- "rubygems repository #{remote_names}"
+ if remotes.empty?
+ "locally installed gems"
+ else
+ remote_names = remotes.map(&:to_s).join(", ")
+ "rubygems repository #{remote_names} or installed locally"
+ end
end
alias_method :name, :to_s
@@ -99,8 +106,8 @@ module Bundler
end
end
- if installed?(spec) && (!force || spec.name.eql?("bundler"))
- Bundler.ui.info "Using #{version_message(spec)}"
+ if installed?(spec) && !force
+ print_using_message "Using #{version_message(spec)}"
return nil # no post-install message
end
@@ -141,7 +148,8 @@ module Bundler
:wrappers => true,
:env_shebang => true,
:build_args => opts[:build_args],
- :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum
+ :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
+ :bundler_extension_cache_path => extension_cache_path(spec)
).install
end
spec.full_gem_path = installed_spec.full_gem_path
@@ -212,13 +220,21 @@ module Bundler
@remotes.unshift(uri) unless @remotes.include?(uri)
end
- def replace_remotes(other_remotes)
+ def equivalent_remotes?(other_remotes)
+ other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
+ end
+
+ def replace_remotes(other_remotes, allow_equivalent = false)
return false if other_remotes == @remotes
+ equivalent = allow_equivalent && equivalent_remotes?(other_remotes)
+
@remotes = []
other_remotes.reverse_each do |r|
add_remote r.to_s
end
+
+ !equivalent
end
def unmet_deps
@@ -236,6 +252,43 @@ module Bundler
end
end
+ def double_check_for(unmet_dependency_names, override_dupes = false, index = specs)
+ return unless @allow_remote
+ raise ArgumentError, "missing index" unless index
+
+ return unless api_fetchers.any?
+
+ unmet_dependency_names = unmet_dependency_names.call
+ unless unmet_dependency_names.nil?
+ if api_fetchers.size <= 1
+ # can't do this when there are multiple fetchers because then we might not fetch from _all_
+ # of them
+ unmet_dependency_names -= remote_specs.spec_names # avoid re-fetching things we've already gotten
+ end
+ return if unmet_dependency_names.empty?
+ end
+
+ Bundler.ui.debug "Double checking for #{unmet_dependency_names || "all specs (due to the size of the request)"} in #{self}"
+
+ fetch_names(api_fetchers, unmet_dependency_names, index, override_dupes)
+ end
+
+ def dependency_names_to_double_check
+ names = []
+ remote_specs.each do |spec|
+ case spec
+ when EndpointSpecification, Gem::Specification, StubSpecification, LazySpecification
+ names.concat(spec.runtime_dependencies)
+ when RemoteSpecification # from the full index
+ return nil
+ else
+ raise "unhandled spec type (#{spec.inspect})"
+ end
+ end
+ names.map!(&:name) if names
+ names
+ end
+
protected
def credless_remotes
@@ -276,7 +329,7 @@ module Bundler
end
def suppress_configured_credentials(remote)
- remote_nouser = remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
+ remote_nouser = remove_auth(remote)
if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
remote_nouser
else
@@ -284,15 +337,14 @@ module Bundler
end
end
+ def remove_auth(remote)
+ remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
+ end
+
def installed_specs
- @installed_specs ||= begin
- idx = Index.new
- have_bundler = false
+ @installed_specs ||= Index.build do |idx|
Bundler.rubygems.all_specs.reverse_each do |spec|
- if spec.name == "bundler"
- next unless spec.version.to_s == VERSION
- have_bundler = true
- end
+ next if spec.name == "bundler"
spec.source = self
if Bundler.rubygems.spec_missing_extensions?(spec, false)
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
@@ -300,23 +352,6 @@ module Bundler
end
idx << spec
end
-
- # Always have bundler locally
- unless have_bundler
- # We're running bundler directly from the source
- # so, let's create a fake gemspec for it (it's a path)
- # gemspec
- bundler = Gem::Specification.new do |s|
- s.name = "bundler"
- s.version = VERSION
- s.platform = Gem::Platform::RUBY
- s.source = self
- s.authors = ["bundler team"]
- s.loaded_from = File.expand_path("..", __FILE__)
- end
- idx << bundler
- end
- idx
end
end
@@ -334,9 +369,9 @@ module Bundler
end
idx << s
end
- end
- idx
+ idx
+ end
end
def api_fetchers
@@ -348,71 +383,36 @@ module Bundler
index_fetchers = fetchers - api_fetchers
# gather lists from non-api sites
- index_fetchers.each do |f|
- Bundler.ui.info "Fetching source index from #{f.uri}"
- idx.use f.specs_with_retry(nil, self)
- end
+ fetch_names(index_fetchers, nil, idx, false)
# because ensuring we have all the gems we need involves downloading
# the gemspecs of those gems, if the non-api sites contain more than
- # about 100 gems, we treat all sites as non-api for speed.
+ # about 500 gems, we treat all sites as non-api for speed.
allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
" Downloading full index instead..." unless allow_api
- if allow_api
- api_fetchers.each do |f|
- Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
- idx.use f.specs_with_retry(dependency_names, self)
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- end
-
- # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
- # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
- # but will not have found any versions of Bar from source B, which is a problem if the requested version
- # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
- # each spec we found, we add all possible versions from all sources to the index.
- loop do
- idxcount = idx.size
- api_fetchers.each do |f|
- Bundler.ui.info "Fetching version metadata from #{f.uri}", Bundler.ui.debug?
- idx.use f.specs_with_retry(idx.dependency_names, self), true
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- end
- break if idxcount == idx.size
- end
-
- if api_fetchers.any?
- # it's possible that gems from one source depend on gems from some
- # other source, so now we download gemspecs and iterate over those
- # dependencies, looking for gems we don't have info on yet.
- unmet = idx.unmet_dependency_names
-
- # if there are any cross-site gems we missed, get them now
- api_fetchers.each do |f|
- Bundler.ui.info "Fetching dependency metadata from #{f.uri}", Bundler.ui.debug?
- idx.use f.specs_with_retry(unmet, self)
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- end if unmet.any?
- else
- allow_api = false
- end
- end
+ fetch_names(api_fetchers, allow_api && dependency_names, idx, false)
+ end
+ end
- unless allow_api
- api_fetchers.each do |f|
- Bundler.ui.info "Fetching source index from #{f.uri}"
- idx.use f.specs_with_retry(nil, self)
- end
+ def fetch_names(fetchers, dependency_names, index, override_dupes)
+ fetchers.each do |f|
+ if dependency_names
+ Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
+ index.use f.specs_with_retry(dependency_names, self), override_dupes
+ Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
+ else
+ Bundler.ui.info "Fetching source index from #{f.uri}"
+ index.use f.specs_with_retry(nil, self), override_dupes
end
end
end
def fetch_gem(spec)
return false unless spec.remote
- uri = spec.remote.uri
+
spec.fetch_platform
- Bundler.ui.confirm("Fetching #{version_message(spec)}")
download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
@@ -420,7 +420,7 @@ module Bundler
SharedHelpers.filesystem_access("#{download_path}/cache") do |p|
FileUtils.mkdir_p(p)
end
- Bundler.rubygems.download_gem(spec, uri, download_path)
+ download_gem(spec, download_path)
if requires_sudo?
SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
@@ -457,6 +457,76 @@ module Bundler
def cache_path
Bundler.app_cache
end
+
+ private
+
+ # Checks if the requested spec exists in the global cache. If it does,
+ # we copy it to the download path, and if it does not, we download it.
+ #
+ # @param [Specification] spec
+ # the spec we want to download or retrieve from the cache.
+ #
+ # @param [String] download_path
+ # the local directory the .gem will end up in.
+ #
+ def download_gem(spec, download_path)
+ local_path = File.join(download_path, "cache/#{spec.full_name}.gem")
+
+ if (cache_path = download_cache_path(spec)) && cache_path.file?
+ SharedHelpers.filesystem_access(local_path) do
+ FileUtils.cp(cache_path, local_path)
+ end
+ else
+ uri = spec.remote.uri
+ Bundler.ui.confirm("Fetching #{version_message(spec)}")
+ Bundler.rubygems.download_gem(spec, uri, download_path)
+ cache_globally(spec, local_path)
+ end
+ end
+
+ # Checks if the requested spec exists in the global cache. If it does
+ # not, we create the relevant global cache subdirectory if it does not
+ # exist and copy the spec from the local cache to the global cache.
+ #
+ # @param [Specification] spec
+ # the spec we want to copy to the global cache.
+ #
+ # @param [String] local_cache_path
+ # the local directory from which we want to copy the .gem.
+ #
+ def cache_globally(spec, local_cache_path)
+ return unless cache_path = download_cache_path(spec)
+ return if cache_path.exist?
+
+ SharedHelpers.filesystem_access(cache_path.dirname, &:mkpath)
+ SharedHelpers.filesystem_access(cache_path) do
+ FileUtils.cp(local_cache_path, cache_path)
+ end
+ end
+
+ # Returns the global cache path of the calling Rubygems::Source object.
+ #
+ # Note that the Source determines the path's subdirectory. We use this
+ # subdirectory in the global cache path so that gems with the same name
+ # -- and possibly different versions -- from different sources are saved
+ # to their respective subdirectories and do not override one another.
+ #
+ # @param [Gem::Specification] specification
+ #
+ # @return [Pathname] The global cache path.
+ #
+ def download_cache_path(spec)
+ return unless Bundler.feature_flag.global_gem_cache?
+ return unless remote = spec.remote
+ return unless cache_slug = remote.cache_slug
+
+ Bundler.user_cache.join("gems", cache_slug, spec.file_name)
+ end
+
+ def extension_cache_slug(spec)
+ return unless remote = spec.remote
+ remote.cache_slug
+ end
end
end
end
diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb
index b49e645506..e73baaa992 100644
--- a/lib/bundler/source/rubygems/remote.rb
+++ b/lib/bundler/source/rubygems/remote.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
class Source
class Rubygems
@@ -20,10 +21,12 @@ module Bundler
#
def cache_slug
@cache_slug ||= begin
+ return nil unless SharedHelpers.md5_available?
+
cache_uri = original_uri || uri
uri_parts = [cache_uri.host, cache_uri.user, cache_uri.port, cache_uri.path]
- uri_digest = Digest::MD5.hexdigest(uri_parts.compact.join("."))
+ uri_digest = SharedHelpers.digest(:MD5).hexdigest(uri_parts.compact.join("."))
uri_parts[-1] = uri_digest
uri_parts.compact.join(".")
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index b6ce6029c8..ac2adacb3d 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -1,16 +1,21 @@
# frozen_string_literal: true
+
module Bundler
class SourceList
attr_reader :path_sources,
:git_sources,
- :plugin_sources
+ :plugin_sources,
+ :global_rubygems_source,
+ :metadata_source
def initialize
- @path_sources = []
- @git_sources = []
- @plugin_sources = []
- @rubygems_aggregate = Source::Rubygems.new
- @rubygems_sources = []
+ @path_sources = []
+ @git_sources = []
+ @plugin_sources = []
+ @global_rubygems_source = nil
+ @rubygems_aggregate = rubygems_aggregate_class.new
+ @rubygems_sources = []
+ @metadata_source = Source::Metadata.new
end
def add_path_source(options = {})
@@ -35,13 +40,28 @@ module Bundler
add_source_to_list Plugin.source(source).new(options), @plugin_sources
end
+ def global_rubygems_source=(uri)
+ if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
+ end
+ add_rubygems_remote(uri)
+ end
+
def add_rubygems_remote(uri)
+ if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ return if Bundler.feature_flag.disable_multisource?
+ raise InvalidOption, "`lockfile_uses_separate_rubygems_sources` cannot be set without `disable_multisource` being set"
+ end
@rubygems_aggregate.add_remote(uri)
@rubygems_aggregate
end
+ def default_source
+ global_rubygems_source || @rubygems_aggregate
+ end
+
def rubygems_sources
- @rubygems_sources + [@rubygems_aggregate]
+ @rubygems_sources + [default_source]
end
def rubygems_remotes
@@ -49,18 +69,25 @@ module Bundler
end
def all_sources
- path_sources + git_sources + plugin_sources + rubygems_sources
+ path_sources + git_sources + plugin_sources + rubygems_sources + [metadata_source]
end
def get(source)
- source_list_for(source).find {|s| source == s }
+ source_list_for(source).find {|s| equal_source?(source, s) || equivalent_source?(source, s) }
end
def lock_sources
- lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
- lock_sources << combine_rubygems_sources
+ if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ [[default_source], @rubygems_sources, git_sources, path_sources, plugin_sources].map do |sources|
+ sources.sort_by(&:to_s)
+ end.flatten(1)
+ else
+ lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
+ lock_sources << combine_rubygems_sources
+ end
end
+ # Returns true if there are changes
def replace_sources!(replacement_sources)
return true if replacement_sources.empty?
@@ -70,13 +97,14 @@ module Bundler
end
end
- replacement_rubygems =
+ replacement_rubygems = !Bundler.feature_flag.lockfile_uses_separate_rubygems_sources? &&
replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
@rubygems_aggregate = replacement_rubygems if replacement_rubygems
- # Return true if there were changes
- lock_sources.to_set != replacement_sources.to_set ||
- rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
+ return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
+ return true if replacement_rubygems && rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
+
+ false
end
def cached!
@@ -93,6 +121,10 @@ module Bundler
private
+ def rubygems_aggregate_class
+ Source::Rubygems
+ end
+
def add_source_to_list(source, list)
list.unshift(source).uniq!
source
@@ -122,5 +154,33 @@ module Bundler
"protocol to keep your data secure."
end
end
+
+ def equal_sources?(lock_sources, replacement_sources)
+ lock_sources.to_set == replacement_sources.to_set
+ end
+
+ def equal_source?(source, other_source)
+ source == other_source
+ end
+
+ def equivalent_source?(source, other_source)
+ return false unless Bundler.settings[:allow_deployment_source_credential_changes] && source.is_a?(Source::Rubygems)
+
+ equivalent_rubygems_sources?([source], [other_source])
+ end
+
+ def equivalent_sources?(lock_sources, replacement_sources)
+ return false unless Bundler.settings[:allow_deployment_source_credential_changes]
+
+ lock_rubygems_sources, lock_other_sources = lock_sources.partition {|s| s.is_a?(Source::Rubygems) }
+ replacement_rubygems_sources, replacement_other_sources = replacement_sources.partition {|s| s.is_a?(Source::Rubygems) }
+
+ equivalent_rubygems_sources?(lock_rubygems_sources, replacement_rubygems_sources) && equal_sources?(lock_other_sources, replacement_other_sources)
+ end
+
+ def equivalent_rubygems_sources?(lock_sources, replacement_sources)
+ actual_remotes = replacement_sources.map(&:remotes).flatten.uniq
+ lock_sources.all? {|s| s.equivalent_remotes?(actual_remotes) }
+ end
end
end
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index 9642633578..7cd3021997 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "tsort"
require "forwardable"
require "set"
@@ -76,7 +77,7 @@ module Bundler
end
def materialize(deps, missing_specs = nil)
- materialized = self.for(deps, [], false, true, missing_specs).to_a
+ materialized = self.for(deps, [], false, true, !missing_specs).to_a
deps = materialized.map(&:name).uniq
materialized.map! do |s|
next s unless s.is_a?(LazySpecification)
@@ -109,9 +110,10 @@ module Bundler
def merge(set)
arr = sorted.dup
- set.each do |s|
- next if arr.any? {|s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
- arr << s
+ set.each do |set_spec|
+ full_name = set_spec.full_name
+ next if arr.any? {|spec| spec.full_name == full_name }
+ arr << set_spec
end
SpecSet.new(arr)
end
diff --git a/lib/bundler/ssl_certs/certificate_manager.rb b/lib/bundler/ssl_certs/certificate_manager.rb
index a5e5d84b64..26fc38ec18 100644
--- a/lib/bundler/ssl_certs/certificate_manager.rb
+++ b/lib/bundler/ssl_certs/certificate_manager.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
-require "fileutils"
+
+require "bundler/vendored_fileutils"
require "net/https"
require "openssl"
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
index aeacf245a3..0dd024024a 100644
--- a/lib/bundler/stub_specification.rb
+++ b/lib/bundler/stub_specification.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/remote_specification"
module Bundler
diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable
index fe22de0a6d..9289debc26 100755
--- a/lib/bundler/templates/Executable
+++ b/lib/bundler/templates/Executable
@@ -1,5 +1,6 @@
#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
# frozen_string_literal: true
+
#
# This file was generated by Bundler.
#
@@ -7,6 +8,9 @@
# this file is here to facilitate running it.
#
+bundle_binstub = File.expand_path("../bundle", __FILE__)
+load(bundle_binstub) if File.file?(bundle_binstub)
+
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
Pathname.new(__FILE__).realpath)
diff --git a/lib/bundler/templates/Executable.bundler b/lib/bundler/templates/Executable.bundler
new file mode 100644
index 0000000000..eeda90b584
--- /dev/null
+++ b/lib/bundler/templates/Executable.bundler
@@ -0,0 +1,105 @@
+#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
+# frozen_string_literal: true
+
+#
+# This file was generated by Bundler.
+#
+# The application '<%= executable %>' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "rubygems"
+
+m = Module.new do
+ module_function
+
+ def invoked_as_script?
+ File.expand_path($0) == File.expand_path(__FILE__)
+ end
+
+ def env_var_version
+ ENV["BUNDLER_VERSION"]
+ end
+
+ def cli_arg_version
+ return unless invoked_as_script? # don't want to hijack other binstubs
+ return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
+ bundler_version = nil
+ update_index = nil
+ ARGV.each_with_index do |a, i|
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
+ bundler_version = a
+ end
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
+ bundler_version = $1 || ">= 0.a"
+ update_index = i
+ end
+ bundler_version
+ end
+
+ def gemfile
+ gemfile = ENV["BUNDLE_GEMFILE"]
+ return gemfile if gemfile && !gemfile.empty?
+
+ File.expand_path("../<%= relative_gemfile_path %>", __FILE__)
+ end
+
+ def lockfile
+ lockfile =
+ case File.basename(gemfile)
+ when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
+ else "#{gemfile}.lock"
+ end
+ File.expand_path(lockfile)
+ end
+
+ def lockfile_version
+ return unless File.file?(lockfile)
+ lockfile_contents = File.read(lockfile)
+ return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
+ Regexp.last_match(1)
+ end
+
+ def bundler_version
+ @bundler_version ||= begin
+ env_var_version || cli_arg_version ||
+ lockfile_version || "#{Gem::Requirement.default}.a"
+ end
+ end
+
+ def load_bundler!
+ ENV["BUNDLE_GEMFILE"] ||= gemfile
+
+ # must dup string for RG < 1.8 compatibility
+ activate_bundler(bundler_version.dup)
+ end
+
+ def activate_bundler(bundler_version)
+ if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
+ bundler_version = "< 2"
+ end
+ gem_error = activation_error_handling do
+ gem "bundler", bundler_version
+ end
+ return if gem_error.nil?
+ require_error = activation_error_handling do
+ require "bundler/version"
+ end
+ return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
+ warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
+ exit 42
+ end
+
+ def activation_error_handling
+ yield
+ nil
+ rescue StandardError, LoadError => e
+ e
+ end
+end
+
+m.load_bundler!
+
+if m.invoked_as_script?
+ load Gem.bin_path("<%= spec.name %>", "<%= executable %>")
+end
diff --git a/lib/bundler/templates/Gemfile b/lib/bundler/templates/Gemfile
index 21c6283123..1afd2cce67 100644
--- a/lib/bundler/templates/Gemfile
+++ b/lib/bundler/templates/Gemfile
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
diff --git a/lib/bundler/templates/gems.rb b/lib/bundler/templates/gems.rb
new file mode 100644
index 0000000000..547cd6e8d9
--- /dev/null
+++ b/lib/bundler/templates/gems.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+# A sample gems.rb
+source "https://rubygems.org"
+
+git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
+
+# gem "rails"
diff --git a/lib/bundler/templates/newgem/README.md.tt b/lib/bundler/templates/newgem/README.md.tt
index edbe55dabe..868a0afe67 100644
--- a/lib/bundler/templates/newgem/README.md.tt
+++ b/lib/bundler/templates/newgem/README.md.tt
@@ -37,7 +37,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/<%= co
## License
-The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
+The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
<% end -%>
<% if config[:coc] -%>
diff --git a/lib/bundler/templates/newgem/gitignore.tt b/lib/bundler/templates/newgem/gitignore.tt
index 573d76b4c2..b1c9f9986c 100644
--- a/lib/bundler/templates/newgem/gitignore.tt
+++ b/lib/bundler/templates/newgem/gitignore.tt
@@ -1,6 +1,5 @@
/.bundle/
/.yardoc
-/Gemfile.lock
/_yardoc/
/coverage/
/doc/
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index caea7fe7be..9a87a1374a 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -1,4 +1,7 @@
+<%- if RUBY_VERSION < "2.0.0" -%>
# coding: utf-8
+<%- end -%>
+
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "<%= config[:namespaced_path] %>/version"
@@ -9,7 +12,7 @@ Gem::Specification.new do |spec|
spec.authors = [<%= config[:author].inspect %>]
spec.email = [<%= config[:email].inspect %>]
- spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
+ spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
spec.description = %q{TODO: Write a longer description or delete this line.}
spec.homepage = "TODO: Put your gem's website or public repo URL here."
<%- if config[:mit] -%>
diff --git a/lib/bundler/templates/newgem/rspec.tt b/lib/bundler/templates/newgem/rspec.tt
index 8c18f1abdd..34c5164d9b 100644
--- a/lib/bundler/templates/newgem/rspec.tt
+++ b/lib/bundler/templates/newgem/rspec.tt
@@ -1,2 +1,3 @@
--format documentation
--color
+--require spec_helper
diff --git a/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt b/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
index b7ef7f9e4a..c63b487830 100644
--- a/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
+++ b/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
@@ -1,5 +1,3 @@
-require "spec_helper"
-
RSpec.describe <%= config[:constant_name] %> do
it "has a version number" do
expect(<%= config[:constant_name] %>::VERSION).not_to be nil
diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb
index 794c000dc4..8138b30d38 100644
--- a/lib/bundler/ui.rb
+++ b/lib/bundler/ui.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module UI
autoload :RGProxy, "bundler/ui/rg_proxy"
diff --git a/lib/bundler/ui/rg_proxy.rb b/lib/bundler/ui/rg_proxy.rb
index 95a1ecdf0c..e2f98481db 100644
--- a/lib/bundler/ui/rg_proxy.rb
+++ b/lib/bundler/ui/rg_proxy.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/ui"
require "rubygems/user_interaction"
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 87a92471fb..3b3b6bfb53 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -1,15 +1,16 @@
# frozen_string_literal: true
+
require "bundler/vendored_thor"
module Bundler
module UI
class Shell
- LEVELS = %w(silent error warn confirm info debug).freeze
+ LEVELS = %w[silent error warn confirm info debug].freeze
attr_writer :shell
def initialize(options = {})
- if options["no-color"] || !STDOUT.tty?
+ if options["no-color"] || !$stdout.tty?
Thor::Base.shell = Thor::Shell::Basic
end
@shell = Thor::Base.shell.new
@@ -30,13 +31,18 @@ module Bundler
end
def warn(msg, newline = nil)
+ return unless level("warn")
return if @warning_history.include? msg
@warning_history << msg
- tell_me(msg, :yellow, newline) if level("warn")
+
+ return tell_err(msg, :yellow, newline) if Bundler.feature_flag.error_on_stderr?
+ tell_me(msg, :yellow, newline)
end
def error(msg, newline = nil)
- tell_me(msg, :red, newline) if level("error")
+ return unless level("error")
+ return tell_err(msg, :red, newline) if Bundler.feature_flag.error_on_stderr?
+ tell_me(msg, :red, newline)
end
def debug(msg, newline = nil)
@@ -103,6 +109,11 @@ module Bundler
end
def tell_err(message, color = nil, newline = nil)
+ newline = message.to_s !~ /( |\t)\Z/ unless newline
+ message = word_wrap(message) if newline.is_a?(Hash) && newline[:wrap]
+
+ color = nil if color && !$stderr.tty?
+
buffer = @shell.send(:prepare_message, message, *color)
buffer << "\n" if newline && !message.to_s.end_with?("\n")
diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb
index 48390b7198..dca1b2ac86 100644
--- a/lib/bundler/ui/silent.rb
+++ b/lib/bundler/ui/silent.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module UI
class Silent
diff --git a/lib/bundler/uri_credentials_filter.rb b/lib/bundler/uri_credentials_filter.rb
index 997a307533..ee3692268c 100644
--- a/lib/bundler/uri_credentials_filter.rb
+++ b/lib/bundler/uri_credentials_filter.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module URICredentialsFilter
module_function
diff --git a/lib/bundler/vendor/fileutils/lib/fileutils.rb b/lib/bundler/vendor/fileutils/lib/fileutils.rb
new file mode 100644
index 0000000000..cc69740845
--- /dev/null
+++ b/lib/bundler/vendor/fileutils/lib/fileutils.rb
@@ -0,0 +1,1638 @@
+# frozen_string_literal: true
+#
+# = fileutils.rb
+#
+# Copyright (c) 2000-2007 Minero Aoki
+#
+# This program is free software.
+# You can distribute/modify this program under the same terms of ruby.
+#
+# == module Bundler::FileUtils
+#
+# Namespace for several file utility methods for copying, moving, removing, etc.
+#
+# === Module Functions
+#
+# require 'bundler/vendor/fileutils/lib/fileutils'
+#
+# Bundler::FileUtils.cd(dir, options)
+# Bundler::FileUtils.cd(dir, options) {|dir| block }
+# Bundler::FileUtils.pwd()
+# Bundler::FileUtils.mkdir(dir, options)
+# Bundler::FileUtils.mkdir(list, options)
+# Bundler::FileUtils.mkdir_p(dir, options)
+# Bundler::FileUtils.mkdir_p(list, options)
+# Bundler::FileUtils.rmdir(dir, options)
+# Bundler::FileUtils.rmdir(list, options)
+# Bundler::FileUtils.ln(target, link, options)
+# Bundler::FileUtils.ln(targets, dir, options)
+# Bundler::FileUtils.ln_s(target, link, options)
+# Bundler::FileUtils.ln_s(targets, dir, options)
+# Bundler::FileUtils.ln_sf(target, link, options)
+# Bundler::FileUtils.cp(src, dest, options)
+# Bundler::FileUtils.cp(list, dir, options)
+# Bundler::FileUtils.cp_r(src, dest, options)
+# Bundler::FileUtils.cp_r(list, dir, options)
+# Bundler::FileUtils.mv(src, dest, options)
+# Bundler::FileUtils.mv(list, dir, options)
+# Bundler::FileUtils.rm(list, options)
+# Bundler::FileUtils.rm_r(list, options)
+# Bundler::FileUtils.rm_rf(list, options)
+# Bundler::FileUtils.install(src, dest, options)
+# Bundler::FileUtils.chmod(mode, list, options)
+# Bundler::FileUtils.chmod_R(mode, list, options)
+# Bundler::FileUtils.chown(user, group, list, options)
+# Bundler::FileUtils.chown_R(user, group, list, options)
+# Bundler::FileUtils.touch(list, options)
+#
+# The <tt>options</tt> parameter is a hash of options, taken from the list
+# <tt>:force</tt>, <tt>:noop</tt>, <tt>:preserve</tt>, and <tt>:verbose</tt>.
+# <tt>:noop</tt> means that no changes are made. The other three are obvious.
+# Each method documents the options that it honours.
+#
+# All methods that have the concept of a "source" file or directory can take
+# either one file or a list of files in that argument. See the method
+# documentation for examples.
+#
+# There are some `low level' methods, which do not accept any option:
+#
+# Bundler::FileUtils.copy_entry(src, dest, preserve = false, dereference = false)
+# Bundler::FileUtils.copy_file(src, dest, preserve = false, dereference = true)
+# Bundler::FileUtils.copy_stream(srcstream, deststream)
+# Bundler::FileUtils.remove_entry(path, force = false)
+# Bundler::FileUtils.remove_entry_secure(path, force = false)
+# Bundler::FileUtils.remove_file(path, force = false)
+# Bundler::FileUtils.compare_file(path_a, path_b)
+# Bundler::FileUtils.compare_stream(stream_a, stream_b)
+# Bundler::FileUtils.uptodate?(file, cmp_list)
+#
+# == module Bundler::FileUtils::Verbose
+#
+# This module has all methods of Bundler::FileUtils module, but it outputs messages
+# before acting. This equates to passing the <tt>:verbose</tt> flag to methods
+# in Bundler::FileUtils.
+#
+# == module Bundler::FileUtils::NoWrite
+#
+# This module has all methods of Bundler::FileUtils module, but never changes
+# files/directories. This equates to passing the <tt>:noop</tt> flag to methods
+# in Bundler::FileUtils.
+#
+# == module Bundler::FileUtils::DryRun
+#
+# This module has all methods of Bundler::FileUtils module, but never changes
+# files/directories. This equates to passing the <tt>:noop</tt> and
+# <tt>:verbose</tt> flags to methods in Bundler::FileUtils.
+#
+
+module Bundler::FileUtils
+
+ def self.private_module_function(name) #:nodoc:
+ module_function name
+ private_class_method name
+ end
+
+ #
+ # Returns the name of the current directory.
+ #
+ def pwd
+ Dir.pwd
+ end
+ module_function :pwd
+
+ alias getwd pwd
+ module_function :getwd
+
+ #
+ # Changes the current directory to the directory +dir+.
+ #
+ # If this method is called with block, resumes to the old
+ # working directory after the block execution finished.
+ #
+ # Bundler::FileUtils.cd('/', :verbose => true) # chdir and report it
+ #
+ # Bundler::FileUtils.cd('/') do # chdir
+ # # ... # do something
+ # end # return to original directory
+ #
+ def cd(dir, verbose: nil, &block) # :yield: dir
+ fu_output_message "cd #{dir}" if verbose
+ Dir.chdir(dir, &block)
+ fu_output_message 'cd -' if verbose and block
+ end
+ module_function :cd
+
+ alias chdir cd
+ module_function :chdir
+
+ #
+ # Returns true if +new+ is newer than all +old_list+.
+ # Non-existent files are older than any file.
+ #
+ # Bundler::FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \
+ # system 'make hello.o'
+ #
+ def uptodate?(new, old_list)
+ return false unless File.exist?(new)
+ new_time = File.mtime(new)
+ old_list.each do |old|
+ if File.exist?(old)
+ return false unless new_time > File.mtime(old)
+ end
+ end
+ true
+ end
+ module_function :uptodate?
+
+ def remove_trailing_slash(dir) #:nodoc:
+ dir == '/' ? dir : dir.chomp(?/)
+ end
+ private_module_function :remove_trailing_slash
+
+ #
+ # Creates one or more directories.
+ #
+ # Bundler::FileUtils.mkdir 'test'
+ # Bundler::FileUtils.mkdir %w( tmp data )
+ # Bundler::FileUtils.mkdir 'notexist', :noop => true # Does not really create.
+ # Bundler::FileUtils.mkdir 'tmp', :mode => 0700
+ #
+ def mkdir(list, mode: nil, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
+ return if noop
+
+ list.each do |dir|
+ fu_mkdir dir, mode
+ end
+ end
+ module_function :mkdir
+
+ #
+ # Creates a directory and all its parent directories.
+ # For example,
+ #
+ # Bundler::FileUtils.mkdir_p '/usr/local/lib/ruby'
+ #
+ # causes to make following directories, if it does not exist.
+ #
+ # * /usr
+ # * /usr/local
+ # * /usr/local/lib
+ # * /usr/local/lib/ruby
+ #
+ # You can pass several directories at a time in a list.
+ #
+ def mkdir_p(list, mode: nil, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
+ return *list if noop
+
+ list.map {|path| remove_trailing_slash(path)}.each do |path|
+ # optimize for the most common case
+ begin
+ fu_mkdir path, mode
+ next
+ rescue SystemCallError
+ next if File.directory?(path)
+ end
+
+ stack = []
+ until path == stack.last # dirname("/")=="/", dirname("C:/")=="C:/"
+ stack.push path
+ path = File.dirname(path)
+ end
+ stack.pop # root directory should exist
+ stack.reverse_each do |dir|
+ begin
+ fu_mkdir dir, mode
+ rescue SystemCallError
+ raise unless File.directory?(dir)
+ end
+ end
+ end
+
+ return *list
+ end
+ module_function :mkdir_p
+
+ alias mkpath mkdir_p
+ alias makedirs mkdir_p
+ module_function :mkpath
+ module_function :makedirs
+
+ def fu_mkdir(path, mode) #:nodoc:
+ path = remove_trailing_slash(path)
+ if mode
+ Dir.mkdir path, mode
+ File.chmod mode, path
+ else
+ Dir.mkdir path
+ end
+ end
+ private_module_function :fu_mkdir
+
+ #
+ # Removes one or more directories.
+ #
+ # Bundler::FileUtils.rmdir 'somedir'
+ # Bundler::FileUtils.rmdir %w(somedir anydir otherdir)
+ # # Does not really remove directory; outputs message.
+ # Bundler::FileUtils.rmdir 'somedir', :verbose => true, :noop => true
+ #
+ def rmdir(list, parents: nil, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose
+ return if noop
+ list.each do |dir|
+ begin
+ Dir.rmdir(dir = remove_trailing_slash(dir))
+ if parents
+ until (parent = File.dirname(dir)) == '.' or parent == dir
+ dir = parent
+ Dir.rmdir(dir)
+ end
+ end
+ rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
+ end
+ end
+ end
+ module_function :rmdir
+
+ #
+ # :call-seq:
+ # Bundler::FileUtils.ln(target, link, force: nil, noop: nil, verbose: nil)
+ # Bundler::FileUtils.ln(target, dir, force: nil, noop: nil, verbose: nil)
+ # Bundler::FileUtils.ln(targets, dir, force: nil, noop: nil, verbose: nil)
+ #
+ # In the first form, creates a hard link +link+ which points to +target+.
+ # If +link+ already exists, raises Errno::EEXIST.
+ # But if the :force option is set, overwrites +link+.
+ #
+ # Bundler::FileUtils.ln 'gcc', 'cc', verbose: true
+ # Bundler::FileUtils.ln '/usr/bin/emacs21', '/usr/bin/emacs'
+ #
+ # In the second form, creates a link +dir/target+ pointing to +target+.
+ # In the third form, creates several hard links in the directory +dir+,
+ # pointing to each item in +targets+.
+ # If +dir+ is not a directory, raises Errno::ENOTDIR.
+ #
+ # Bundler::FileUtils.cd '/sbin'
+ # Bundler::FileUtils.ln %w(cp mv mkdir), '/bin' # Now /sbin/cp and /bin/cp are linked.
+ #
+ def ln(src, dest, force: nil, noop: nil, verbose: nil)
+ fu_output_message "ln#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
+ return if noop
+ fu_each_src_dest0(src, dest) do |s,d|
+ remove_file d, true if force
+ File.link s, d
+ end
+ end
+ module_function :ln
+
+ alias link ln
+ module_function :link
+
+ #
+ # :call-seq:
+ # Bundler::FileUtils.ln_s(target, link, force: nil, noop: nil, verbose: nil)
+ # Bundler::FileUtils.ln_s(target, dir, force: nil, noop: nil, verbose: nil)
+ # Bundler::FileUtils.ln_s(targets, dir, force: nil, noop: nil, verbose: nil)
+ #
+ # In the first form, creates a symbolic link +link+ which points to +target+.
+ # If +link+ already exists, raises Errno::EEXIST.
+ # But if the :force option is set, overwrites +link+.
+ #
+ # Bundler::FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
+ # Bundler::FileUtils.ln_s 'verylongsourcefilename.c', 'c', force: true
+ #
+ # In the second form, creates a link +dir/target+ pointing to +target+.
+ # In the third form, creates several symbolic links in the directory +dir+,
+ # pointing to each item in +targets+.
+ # If +dir+ is not a directory, raises Errno::ENOTDIR.
+ #
+ # Bundler::FileUtils.ln_s Dir.glob('/bin/*.rb'), '/home/foo/bin'
+ #
+ def ln_s(src, dest, force: nil, noop: nil, verbose: nil)
+ fu_output_message "ln -s#{force ? 'f' : ''} #{[src,dest].flatten.join ' '}" if verbose
+ return if noop
+ fu_each_src_dest0(src, dest) do |s,d|
+ remove_file d, true if force
+ File.symlink s, d
+ end
+ end
+ module_function :ln_s
+
+ alias symlink ln_s
+ module_function :symlink
+
+ #
+ # :call-seq:
+ # Bundler::FileUtils.ln_sf(*args)
+ #
+ # Same as
+ #
+ # Bundler::FileUtils.ln_s(*args, force: true)
+ #
+ def ln_sf(src, dest, noop: nil, verbose: nil)
+ ln_s src, dest, force: true, noop: noop, verbose: verbose
+ end
+ module_function :ln_sf
+
+ #
+ # Copies a file content +src+ to +dest+. If +dest+ is a directory,
+ # copies +src+ to +dest/src+.
+ #
+ # If +src+ is a list of files, then +dest+ must be a directory.
+ #
+ # Bundler::FileUtils.cp 'eval.c', 'eval.c.org'
+ # Bundler::FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6'
+ # Bundler::FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', :verbose => true
+ # Bundler::FileUtils.cp 'symlink', 'dest' # copy content, "dest" is not a symlink
+ #
+ def cp(src, dest, preserve: nil, noop: nil, verbose: nil)
+ fu_output_message "cp#{preserve ? ' -p' : ''} #{[src,dest].flatten.join ' '}" if verbose
+ return if noop
+ fu_each_src_dest(src, dest) do |s, d|
+ copy_file s, d, preserve
+ end
+ end
+ module_function :cp
+
+ alias copy cp
+ module_function :copy
+
+ #
+ # Copies +src+ to +dest+. If +src+ is a directory, this method copies
+ # all its contents recursively. If +dest+ is a directory, copies
+ # +src+ to +dest/src+.
+ #
+ # +src+ can be a list of files.
+ #
+ # # Installing Ruby library "mylib" under the site_ruby
+ # Bundler::FileUtils.rm_r site_ruby + '/mylib', :force
+ # Bundler::FileUtils.cp_r 'lib/', site_ruby + '/mylib'
+ #
+ # # Examples of copying several files to target directory.
+ # Bundler::FileUtils.cp_r %w(mail.rb field.rb debug/), site_ruby + '/tmail'
+ # Bundler::FileUtils.cp_r Dir.glob('*.rb'), '/home/foo/lib/ruby', :noop => true, :verbose => true
+ #
+ # # If you want to copy all contents of a directory instead of the
+ # # directory itself, c.f. src/x -> dest/x, src/y -> dest/y,
+ # # use following code.
+ # Bundler::FileUtils.cp_r 'src/.', 'dest' # cp_r('src', 'dest') makes dest/src,
+ # # but this doesn't.
+ #
+ def cp_r(src, dest, preserve: nil, noop: nil, verbose: nil,
+ dereference_root: true, remove_destination: nil)
+ fu_output_message "cp -r#{preserve ? 'p' : ''}#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
+ return if noop
+ fu_each_src_dest(src, dest) do |s, d|
+ copy_entry s, d, preserve, dereference_root, remove_destination
+ end
+ end
+ module_function :cp_r
+
+ #
+ # Copies a file system entry +src+ to +dest+.
+ # If +src+ is a directory, this method copies its contents recursively.
+ # This method preserves file types, c.f. symlink, directory...
+ # (FIFO, device files and etc. are not supported yet)
+ #
+ # Both of +src+ and +dest+ must be a path name.
+ # +src+ must exist, +dest+ must not exist.
+ #
+ # If +preserve+ is true, this method preserves owner, group, and
+ # modified time. Permissions are copied regardless +preserve+.
+ #
+ # If +dereference_root+ is true, this method dereference tree root.
+ #
+ # If +remove_destination+ is true, this method removes each destination file before copy.
+ #
+ def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
+ Entry_.new(src, nil, dereference_root).wrap_traverse(proc do |ent|
+ destent = Entry_.new(dest, ent.rel, false)
+ File.unlink destent.path if remove_destination && File.file?(destent.path)
+ ent.copy destent.path
+ end, proc do |ent|
+ destent = Entry_.new(dest, ent.rel, false)
+ ent.copy_metadata destent.path if preserve
+ end)
+ end
+ module_function :copy_entry
+
+ #
+ # Copies file contents of +src+ to +dest+.
+ # Both of +src+ and +dest+ must be a path name.
+ #
+ def copy_file(src, dest, preserve = false, dereference = true)
+ ent = Entry_.new(src, nil, dereference)
+ ent.copy_file dest
+ ent.copy_metadata dest if preserve
+ end
+ module_function :copy_file
+
+ #
+ # Copies stream +src+ to +dest+.
+ # +src+ must respond to #read(n) and
+ # +dest+ must respond to #write(str).
+ #
+ def copy_stream(src, dest)
+ IO.copy_stream(src, dest)
+ end
+ module_function :copy_stream
+
+ #
+ # Moves file(s) +src+ to +dest+. If +file+ and +dest+ exist on the different
+ # disk partition, the file is copied then the original file is removed.
+ #
+ # Bundler::FileUtils.mv 'badname.rb', 'goodname.rb'
+ # Bundler::FileUtils.mv 'stuff.rb', '/notexist/lib/ruby', :force => true # no error
+ #
+ # Bundler::FileUtils.mv %w(junk.txt dust.txt), '/home/foo/.trash/'
+ # Bundler::FileUtils.mv Dir.glob('test*.rb'), 'test', :noop => true, :verbose => true
+ #
+ def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
+ fu_output_message "mv#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
+ return if noop
+ fu_each_src_dest(src, dest) do |s, d|
+ destent = Entry_.new(d, nil, true)
+ begin
+ if destent.exist?
+ if destent.directory?
+ raise Errno::EEXIST, d
+ else
+ destent.remove_file if rename_cannot_overwrite_file?
+ end
+ end
+ begin
+ File.rename s, d
+ rescue Errno::EXDEV
+ copy_entry s, d, true
+ if secure
+ remove_entry_secure s, force
+ else
+ remove_entry s, force
+ end
+ end
+ rescue SystemCallError
+ raise unless force
+ end
+ end
+ end
+ module_function :mv
+
+ alias move mv
+ module_function :move
+
+ def rename_cannot_overwrite_file? #:nodoc:
+ /emx/ =~ RUBY_PLATFORM
+ end
+ private_module_function :rename_cannot_overwrite_file?
+
+ #
+ # Remove file(s) specified in +list+. This method cannot remove directories.
+ # All StandardErrors are ignored when the :force option is set.
+ #
+ # Bundler::FileUtils.rm %w( junk.txt dust.txt )
+ # Bundler::FileUtils.rm Dir.glob('*.so')
+ # Bundler::FileUtils.rm 'NotExistFile', :force => true # never raises exception
+ #
+ def rm(list, force: nil, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message "rm#{force ? ' -f' : ''} #{list.join ' '}" if verbose
+ return if noop
+
+ list.each do |path|
+ remove_file path, force
+ end
+ end
+ module_function :rm
+
+ alias remove rm
+ module_function :remove
+
+ #
+ # Equivalent to
+ #
+ # Bundler::FileUtils.rm(list, :force => true)
+ #
+ def rm_f(list, noop: nil, verbose: nil)
+ rm list, force: true, noop: noop, verbose: verbose
+ end
+ module_function :rm_f
+
+ alias safe_unlink rm_f
+ module_function :safe_unlink
+
+ #
+ # remove files +list+[0] +list+[1]... If +list+[n] is a directory,
+ # removes its all contents recursively. This method ignores
+ # StandardError when :force option is set.
+ #
+ # Bundler::FileUtils.rm_r Dir.glob('/tmp/*')
+ # Bundler::FileUtils.rm_r 'some_dir', :force => true
+ #
+ # WARNING: This method causes local vulnerability
+ # if one of parent directories or removing directory tree are world
+ # writable (including /tmp, whose permission is 1777), and the current
+ # process has strong privilege such as Unix super user (root), and the
+ # system has symbolic link. For secure removing, read the documentation
+ # of #remove_entry_secure carefully, and set :secure option to true.
+ # Default is :secure=>false.
+ #
+ # NOTE: This method calls #remove_entry_secure if :secure option is set.
+ # See also #remove_entry_secure.
+ #
+ def rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
+ list = fu_list(list)
+ fu_output_message "rm -r#{force ? 'f' : ''} #{list.join ' '}" if verbose
+ return if noop
+ list.each do |path|
+ if secure
+ remove_entry_secure path, force
+ else
+ remove_entry path, force
+ end
+ end
+ end
+ module_function :rm_r
+
+ #
+ # Equivalent to
+ #
+ # Bundler::FileUtils.rm_r(list, :force => true)
+ #
+ # WARNING: This method causes local vulnerability.
+ # Read the documentation of #rm_r first.
+ #
+ def rm_rf(list, noop: nil, verbose: nil, secure: nil)
+ rm_r list, force: true, noop: noop, verbose: verbose, secure: secure
+ end
+ module_function :rm_rf
+
+ alias rmtree rm_rf
+ module_function :rmtree
+
+ #
+ # This method removes a file system entry +path+. +path+ shall be a
+ # regular file, a directory, or something. If +path+ is a directory,
+ # remove it recursively. This method is required to avoid TOCTTOU
+ # (time-of-check-to-time-of-use) local security vulnerability of #rm_r.
+ # #rm_r causes security hole when:
+ #
+ # * Parent directory is world writable (including /tmp).
+ # * Removing directory tree includes world writable directory.
+ # * The system has symbolic link.
+ #
+ # To avoid this security hole, this method applies special preprocess.
+ # If +path+ is a directory, this method chown(2) and chmod(2) all
+ # removing directories. This requires the current process is the
+ # owner of the removing whole directory tree, or is the super user (root).
+ #
+ # WARNING: You must ensure that *ALL* parent directories cannot be
+ # moved by other untrusted users. For example, parent directories
+ # should not be owned by untrusted users, and should not be world
+ # writable except when the sticky bit set.
+ #
+ # WARNING: Only the owner of the removing directory tree, or Unix super
+ # user (root) should invoke this method. Otherwise this method does not
+ # work.
+ #
+ # For details of this security vulnerability, see Perl's case:
+ #
+ # * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
+ # * http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452
+ #
+ # For fileutils.rb, this vulnerability is reported in [ruby-dev:26100].
+ #
+ def remove_entry_secure(path, force = false)
+ unless fu_have_symlink?
+ remove_entry path, force
+ return
+ end
+ fullpath = File.expand_path(path)
+ st = File.lstat(fullpath)
+ unless st.directory?
+ File.unlink fullpath
+ return
+ end
+ # is a directory.
+ parent_st = File.stat(File.dirname(fullpath))
+ unless parent_st.world_writable?
+ remove_entry path, force
+ return
+ end
+ unless parent_st.sticky?
+ raise ArgumentError, "parent directory is world writable, Bundler::FileUtils#remove_entry_secure does not work; abort: #{path.inspect} (parent directory mode #{'%o' % parent_st.mode})"
+ end
+ # freeze tree root
+ euid = Process.euid
+ File.open(fullpath + '/.') {|f|
+ unless fu_stat_identical_entry?(st, f.stat)
+ # symlink (TOC-to-TOU attack?)
+ File.unlink fullpath
+ return
+ end
+ f.chown euid, -1
+ f.chmod 0700
+ unless fu_stat_identical_entry?(st, File.lstat(fullpath))
+ # TOC-to-TOU attack?
+ File.unlink fullpath
+ return
+ end
+ }
+ # ---- tree root is frozen ----
+ root = Entry_.new(path)
+ root.preorder_traverse do |ent|
+ if ent.directory?
+ ent.chown euid, -1
+ ent.chmod 0700
+ end
+ end
+ root.postorder_traverse do |ent|
+ begin
+ ent.remove
+ rescue
+ raise unless force
+ end
+ end
+ rescue
+ raise unless force
+ end
+ module_function :remove_entry_secure
+
+ def fu_have_symlink? #:nodoc:
+ File.symlink nil, nil
+ rescue NotImplementedError
+ return false
+ rescue TypeError
+ return true
+ end
+ private_module_function :fu_have_symlink?
+
+ def fu_stat_identical_entry?(a, b) #:nodoc:
+ a.dev == b.dev and a.ino == b.ino
+ end
+ private_module_function :fu_stat_identical_entry?
+
+ #
+ # This method removes a file system entry +path+.
+ # +path+ might be a regular file, a directory, or something.
+ # If +path+ is a directory, remove it recursively.
+ #
+ # See also #remove_entry_secure.
+ #
+ def remove_entry(path, force = false)
+ Entry_.new(path).postorder_traverse do |ent|
+ begin
+ ent.remove
+ rescue
+ raise unless force
+ end
+ end
+ rescue
+ raise unless force
+ end
+ module_function :remove_entry
+
+ #
+ # Removes a file +path+.
+ # This method ignores StandardError if +force+ is true.
+ #
+ def remove_file(path, force = false)
+ Entry_.new(path).remove_file
+ rescue
+ raise unless force
+ end
+ module_function :remove_file
+
+ #
+ # Removes a directory +dir+ and its contents recursively.
+ # This method ignores StandardError if +force+ is true.
+ #
+ def remove_dir(path, force = false)
+ remove_entry path, force # FIXME?? check if it is a directory
+ end
+ module_function :remove_dir
+
+ #
+ # Returns true if the contents of a file +a+ and a file +b+ are identical.
+ #
+ # Bundler::FileUtils.compare_file('somefile', 'somefile') #=> true
+ # Bundler::FileUtils.compare_file('/dev/null', '/dev/urandom') #=> false
+ #
+ def compare_file(a, b)
+ return false unless File.size(a) == File.size(b)
+ File.open(a, 'rb') {|fa|
+ File.open(b, 'rb') {|fb|
+ return compare_stream(fa, fb)
+ }
+ }
+ end
+ module_function :compare_file
+
+ alias identical? compare_file
+ alias cmp compare_file
+ module_function :identical?
+ module_function :cmp
+
+ #
+ # Returns true if the contents of a stream +a+ and +b+ are identical.
+ #
+ def compare_stream(a, b)
+ bsize = fu_stream_blksize(a, b)
+ sa = String.new(capacity: bsize)
+ sb = String.new(capacity: bsize)
+ begin
+ a.read(bsize, sa)
+ b.read(bsize, sb)
+ return true if sa.empty? && sb.empty?
+ end while sa == sb
+ false
+ end
+ module_function :compare_stream
+
+ #
+ # If +src+ is not same as +dest+, copies it and changes the permission
+ # mode to +mode+. If +dest+ is a directory, destination is +dest+/+src+.
+ # This method removes destination before copy.
+ #
+ # Bundler::FileUtils.install 'ruby', '/usr/local/bin/ruby', :mode => 0755, :verbose => true
+ # Bundler::FileUtils.install 'lib.rb', '/usr/local/lib/ruby/site_ruby', :verbose => true
+ #
+ def install(src, dest, mode: nil, owner: nil, group: nil, preserve: nil,
+ noop: nil, verbose: nil)
+ if verbose
+ msg = +"install -c"
+ msg << ' -p' if preserve
+ msg << ' -m ' << mode_to_s(mode) if mode
+ msg << " -o #{owner}" if owner
+ msg << " -g #{group}" if group
+ msg << ' ' << [src,dest].flatten.join(' ')
+ fu_output_message msg
+ end
+ return if noop
+ uid = fu_get_uid(owner)
+ gid = fu_get_gid(group)
+ fu_each_src_dest(src, dest) do |s, d|
+ st = File.stat(s)
+ unless File.exist?(d) and compare_file(s, d)
+ remove_file d, true
+ copy_file s, d
+ File.utime st.atime, st.mtime, d if preserve
+ File.chmod fu_mode(mode, st), d if mode
+ File.chown uid, gid, d if uid or gid
+ end
+ end
+ end
+ module_function :install
+
+ def user_mask(target) #:nodoc:
+ target.each_char.inject(0) do |mask, chr|
+ case chr
+ when "u"
+ mask | 04700
+ when "g"
+ mask | 02070
+ when "o"
+ mask | 01007
+ when "a"
+ mask | 07777
+ else
+ raise ArgumentError, "invalid `who' symbol in file mode: #{chr}"
+ end
+ end
+ end
+ private_module_function :user_mask
+
+ def apply_mask(mode, user_mask, op, mode_mask) #:nodoc:
+ case op
+ when '='
+ (mode & ~user_mask) | (user_mask & mode_mask)
+ when '+'
+ mode | (user_mask & mode_mask)
+ when '-'
+ mode & ~(user_mask & mode_mask)
+ end
+ end
+ private_module_function :apply_mask
+
+ def symbolic_modes_to_i(mode_sym, path) #:nodoc:
+ mode = if File::Stat === path
+ path.mode
+ else
+ File.stat(path).mode
+ end
+ mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
+ target, *actions = clause.split(/([=+-])/)
+ raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
+ target = 'a' if target.empty?
+ user_mask = user_mask(target)
+ actions.each_slice(2) do |op, perm|
+ need_apply = op == '='
+ mode_mask = (perm || '').each_char.inject(0) do |mask, chr|
+ case chr
+ when "r"
+ mask | 0444
+ when "w"
+ mask | 0222
+ when "x"
+ mask | 0111
+ when "X"
+ if FileTest.directory? path
+ mask | 0111
+ else
+ mask
+ end
+ when "s"
+ mask | 06000
+ when "t"
+ mask | 01000
+ when "u", "g", "o"
+ if mask.nonzero?
+ current_mode = apply_mask(current_mode, user_mask, op, mask)
+ end
+ need_apply = false
+ copy_mask = user_mask(chr)
+ (current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
+ else
+ raise ArgumentError, "invalid `perm' symbol in file mode: #{chr}"
+ end
+ end
+
+ if mode_mask.nonzero? || need_apply
+ current_mode = apply_mask(current_mode, user_mask, op, mode_mask)
+ end
+ end
+ current_mode
+ end
+ end
+ private_module_function :symbolic_modes_to_i
+
+ def fu_mode(mode, path) #:nodoc:
+ mode.is_a?(String) ? symbolic_modes_to_i(mode, path) : mode
+ end
+ private_module_function :fu_mode
+
+ def mode_to_s(mode) #:nodoc:
+ mode.is_a?(String) ? mode : "%o" % mode
+ end
+ private_module_function :mode_to_s
+
+ #
+ # Changes permission bits on the named files (in +list+) to the bit pattern
+ # represented by +mode+.
+ #
+ # +mode+ is the symbolic and absolute mode can be used.
+ #
+ # Absolute mode is
+ # Bundler::FileUtils.chmod 0755, 'somecommand'
+ # Bundler::FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb)
+ # Bundler::FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true
+ #
+ # Symbolic mode is
+ # Bundler::FileUtils.chmod "u=wrx,go=rx", 'somecommand'
+ # Bundler::FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb)
+ # Bundler::FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', :verbose => true
+ #
+ # "a" :: is user, group, other mask.
+ # "u" :: is user's mask.
+ # "g" :: is group's mask.
+ # "o" :: is other's mask.
+ # "w" :: is write permission.
+ # "r" :: is read permission.
+ # "x" :: is execute permission.
+ # "X" ::
+ # is execute permission for directories only, must be used in conjunction with "+"
+ # "s" :: is uid, gid.
+ # "t" :: is sticky bit.
+ # "+" :: is added to a class given the specified mode.
+ # "-" :: Is removed from a given class given mode.
+ # "=" :: Is the exact nature of the class will be given a specified mode.
+
+ def chmod(mode, list, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message sprintf('chmod %s %s', mode_to_s(mode), list.join(' ')) if verbose
+ return if noop
+ list.each do |path|
+ Entry_.new(path).chmod(fu_mode(mode, path))
+ end
+ end
+ module_function :chmod
+
+ #
+ # Changes permission bits on the named files (in +list+)
+ # to the bit pattern represented by +mode+.
+ #
+ # Bundler::FileUtils.chmod_R 0700, "/tmp/app.#{$$}"
+ # Bundler::FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"
+ #
+ def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
+ list = fu_list(list)
+ fu_output_message sprintf('chmod -R%s %s %s',
+ (force ? 'f' : ''),
+ mode_to_s(mode), list.join(' ')) if verbose
+ return if noop
+ list.each do |root|
+ Entry_.new(root).traverse do |ent|
+ begin
+ ent.chmod(fu_mode(mode, ent.path))
+ rescue
+ raise unless force
+ end
+ end
+ end
+ end
+ module_function :chmod_R
+
+ #
+ # Changes owner and group on the named files (in +list+)
+ # to the user +user+ and the group +group+. +user+ and +group+
+ # may be an ID (Integer/String) or a name (String).
+ # If +user+ or +group+ is nil, this method does not change
+ # the attribute.
+ #
+ # Bundler::FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
+ # Bundler::FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), :verbose => true
+ #
+ def chown(user, group, list, noop: nil, verbose: nil)
+ list = fu_list(list)
+ fu_output_message sprintf('chown %s %s',
+ (group ? "#{user}:#{group}" : user || ':'),
+ list.join(' ')) if verbose
+ return if noop
+ uid = fu_get_uid(user)
+ gid = fu_get_gid(group)
+ list.each do |path|
+ Entry_.new(path).chown uid, gid
+ end
+ end
+ module_function :chown
+
+ #
+ # Changes owner and group on the named files (in +list+)
+ # to the user +user+ and the group +group+ recursively.
+ # +user+ and +group+ may be an ID (Integer/String) or
+ # a name (String). If +user+ or +group+ is nil, this
+ # method does not change the attribute.
+ #
+ # Bundler::FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
+ # Bundler::FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', :verbose => true
+ #
+ def chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
+ list = fu_list(list)
+ fu_output_message sprintf('chown -R%s %s %s',
+ (force ? 'f' : ''),
+ (group ? "#{user}:#{group}" : user || ':'),
+ list.join(' ')) if verbose
+ return if noop
+ uid = fu_get_uid(user)
+ gid = fu_get_gid(group)
+ list.each do |root|
+ Entry_.new(root).traverse do |ent|
+ begin
+ ent.chown uid, gid
+ rescue
+ raise unless force
+ end
+ end
+ end
+ end
+ module_function :chown_R
+
+ begin
+ require 'etc'
+ rescue LoadError # rescue LoadError for miniruby
+ end
+
+ def fu_get_uid(user) #:nodoc:
+ return nil unless user
+ case user
+ when Integer
+ user
+ when /\A\d+\z/
+ user.to_i
+ else
+ Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
+ end
+ end
+ private_module_function :fu_get_uid
+
+ def fu_get_gid(group) #:nodoc:
+ return nil unless group
+ case group
+ when Integer
+ group
+ when /\A\d+\z/
+ group.to_i
+ else
+ Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil
+ end
+ end
+ private_module_function :fu_get_gid
+
+ #
+ # Updates modification time (mtime) and access time (atime) of file(s) in
+ # +list+. Files are created if they don't exist.
+ #
+ # Bundler::FileUtils.touch 'timestamp'
+ # Bundler::FileUtils.touch Dir.glob('*.c'); system 'make'
+ #
+ def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
+ list = fu_list(list)
+ t = mtime
+ if verbose
+ fu_output_message "touch #{nocreate ? '-c ' : ''}#{t ? t.strftime('-t %Y%m%d%H%M.%S ') : ''}#{list.join ' '}"
+ end
+ return if noop
+ list.each do |path|
+ created = nocreate
+ begin
+ File.utime(t, t, path)
+ rescue Errno::ENOENT
+ raise if created
+ File.open(path, 'a') {
+ ;
+ }
+ created = true
+ retry if t
+ end
+ end
+ end
+ module_function :touch
+
+ private
+
+ module StreamUtils_
+ private
+
+ def fu_windows?
+ /mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
+ end
+
+ def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
+ IO.copy_stream(src, dest)
+ end
+
+ def fu_stream_blksize(*streams)
+ streams.each do |s|
+ next unless s.respond_to?(:stat)
+ size = fu_blksize(s.stat)
+ return size if size
+ end
+ fu_default_blksize()
+ end
+
+ def fu_blksize(st)
+ s = st.blksize
+ return nil unless s
+ return nil if s == 0
+ s
+ end
+
+ def fu_default_blksize
+ 1024
+ end
+ end
+
+ include StreamUtils_
+ extend StreamUtils_
+
+ class Entry_ #:nodoc: internal use only
+ include StreamUtils_
+
+ def initialize(a, b = nil, deref = false)
+ @prefix = @rel = @path = nil
+ if b
+ @prefix = a
+ @rel = b
+ else
+ @path = a
+ end
+ @deref = deref
+ @stat = nil
+ @lstat = nil
+ end
+
+ def inspect
+ "\#<#{self.class} #{path()}>"
+ end
+
+ def path
+ if @path
+ File.path(@path)
+ else
+ join(@prefix, @rel)
+ end
+ end
+
+ def prefix
+ @prefix || @path
+ end
+
+ def rel
+ @rel
+ end
+
+ def dereference?
+ @deref
+ end
+
+ def exist?
+ begin
+ lstat
+ true
+ rescue Errno::ENOENT
+ false
+ end
+ end
+
+ def file?
+ s = lstat!
+ s and s.file?
+ end
+
+ def directory?
+ s = lstat!
+ s and s.directory?
+ end
+
+ def symlink?
+ s = lstat!
+ s and s.symlink?
+ end
+
+ def chardev?
+ s = lstat!
+ s and s.chardev?
+ end
+
+ def blockdev?
+ s = lstat!
+ s and s.blockdev?
+ end
+
+ def socket?
+ s = lstat!
+ s and s.socket?
+ end
+
+ def pipe?
+ s = lstat!
+ s and s.pipe?
+ end
+
+ S_IF_DOOR = 0xD000
+
+ def door?
+ s = lstat!
+ s and (s.mode & 0xF000 == S_IF_DOOR)
+ end
+
+ def entries
+ opts = {}
+ opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
+ Dir.entries(path(), opts)\
+ .reject {|n| n == '.' or n == '..' }\
+ .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
+ end
+
+ def stat
+ return @stat if @stat
+ if lstat() and lstat().symlink?
+ @stat = File.stat(path())
+ else
+ @stat = lstat()
+ end
+ @stat
+ end
+
+ def stat!
+ return @stat if @stat
+ if lstat! and lstat!.symlink?
+ @stat = File.stat(path())
+ else
+ @stat = lstat!
+ end
+ @stat
+ rescue SystemCallError
+ nil
+ end
+
+ def lstat
+ if dereference?
+ @lstat ||= File.stat(path())
+ else
+ @lstat ||= File.lstat(path())
+ end
+ end
+
+ def lstat!
+ lstat()
+ rescue SystemCallError
+ nil
+ end
+
+ def chmod(mode)
+ if symlink?
+ File.lchmod mode, path() if have_lchmod?
+ else
+ File.chmod mode, path()
+ end
+ end
+
+ def chown(uid, gid)
+ if symlink?
+ File.lchown uid, gid, path() if have_lchown?
+ else
+ File.chown uid, gid, path()
+ end
+ end
+
+ def copy(dest)
+ lstat
+ case
+ when file?
+ copy_file dest
+ when directory?
+ if !File.exist?(dest) and descendant_directory?(dest, path)
+ raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
+ end
+ begin
+ Dir.mkdir dest
+ rescue
+ raise unless File.directory?(dest)
+ end
+ when symlink?
+ File.symlink File.readlink(path()), dest
+ when chardev?
+ raise "cannot handle device file" unless File.respond_to?(:mknod)
+ mknod dest, ?c, 0666, lstat().rdev
+ when blockdev?
+ raise "cannot handle device file" unless File.respond_to?(:mknod)
+ mknod dest, ?b, 0666, lstat().rdev
+ when socket?
+ raise "cannot handle socket" unless File.respond_to?(:mknod)
+ mknod dest, nil, lstat().mode, 0
+ when pipe?
+ raise "cannot handle FIFO" unless File.respond_to?(:mkfifo)
+ mkfifo dest, 0666
+ when door?
+ raise "cannot handle door: #{path()}"
+ else
+ raise "unknown file type: #{path()}"
+ end
+ end
+
+ def copy_file(dest)
+ File.open(path()) do |s|
+ File.open(dest, 'wb', s.stat.mode) do |f|
+ IO.copy_stream(s, f)
+ end
+ end
+ end
+
+ def copy_metadata(path)
+ st = lstat()
+ if !st.symlink?
+ File.utime st.atime, st.mtime, path
+ end
+ mode = st.mode
+ begin
+ if st.symlink?
+ begin
+ File.lchown st.uid, st.gid, path
+ rescue NotImplementedError
+ end
+ else
+ File.chown st.uid, st.gid, path
+ end
+ rescue Errno::EPERM, Errno::EACCES
+ # clear setuid/setgid
+ mode &= 01777
+ end
+ if st.symlink?
+ begin
+ File.lchmod mode, path
+ rescue NotImplementedError
+ end
+ else
+ File.chmod mode, path
+ end
+ end
+
+ def remove
+ if directory?
+ remove_dir1
+ else
+ remove_file
+ end
+ end
+
+ def remove_dir1
+ platform_support {
+ Dir.rmdir path().chomp(?/)
+ }
+ end
+
+ def remove_file
+ platform_support {
+ File.unlink path
+ }
+ end
+
+ def platform_support
+ return yield unless fu_windows?
+ first_time_p = true
+ begin
+ yield
+ rescue Errno::ENOENT
+ raise
+ rescue => err
+ if first_time_p
+ first_time_p = false
+ begin
+ File.chmod 0700, path() # Windows does not have symlink
+ retry
+ rescue SystemCallError
+ end
+ end
+ raise err
+ end
+ end
+
+ def preorder_traverse
+ stack = [self]
+ while ent = stack.pop
+ yield ent
+ stack.concat ent.entries.reverse if ent.directory?
+ end
+ end
+
+ alias traverse preorder_traverse
+
+ def postorder_traverse
+ if directory?
+ entries().each do |ent|
+ ent.postorder_traverse do |e|
+ yield e
+ end
+ end
+ end
+ ensure
+ yield self
+ end
+
+ def wrap_traverse(pre, post)
+ pre.call self
+ if directory?
+ entries.each do |ent|
+ ent.wrap_traverse pre, post
+ end
+ end
+ post.call self
+ end
+
+ private
+
+ $fileutils_rb_have_lchmod = nil
+
+ def have_lchmod?
+ # This is not MT-safe, but it does not matter.
+ if $fileutils_rb_have_lchmod == nil
+ $fileutils_rb_have_lchmod = check_have_lchmod?
+ end
+ $fileutils_rb_have_lchmod
+ end
+
+ def check_have_lchmod?
+ return false unless File.respond_to?(:lchmod)
+ File.lchmod 0
+ return true
+ rescue NotImplementedError
+ return false
+ end
+
+ $fileutils_rb_have_lchown = nil
+
+ def have_lchown?
+ # This is not MT-safe, but it does not matter.
+ if $fileutils_rb_have_lchown == nil
+ $fileutils_rb_have_lchown = check_have_lchown?
+ end
+ $fileutils_rb_have_lchown
+ end
+
+ def check_have_lchown?
+ return false unless File.respond_to?(:lchown)
+ File.lchown nil, nil
+ return true
+ rescue NotImplementedError
+ return false
+ end
+
+ def join(dir, base)
+ return File.path(dir) if not base or base == '.'
+ return File.path(base) if not dir or dir == '.'
+ File.join(dir, base)
+ end
+
+ if File::ALT_SEPARATOR
+ DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)"
+ else
+ DIRECTORY_TERM = "(?=/|\\z)"
+ end
+ SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
+
+ def descendant_directory?(descendant, ascendant)
+ /\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant)
+ end
+ end # class Entry_
+
+ def fu_list(arg) #:nodoc:
+ [arg].flatten.map {|path| File.path(path) }
+ end
+ private_module_function :fu_list
+
+ def fu_each_src_dest(src, dest) #:nodoc:
+ fu_each_src_dest0(src, dest) do |s, d|
+ raise ArgumentError, "same file: #{s} and #{d}" if fu_same?(s, d)
+ yield s, d
+ end
+ end
+ private_module_function :fu_each_src_dest
+
+ def fu_each_src_dest0(src, dest) #:nodoc:
+ if tmp = Array.try_convert(src)
+ tmp.each do |s|
+ s = File.path(s)
+ yield s, File.join(dest, File.basename(s))
+ end
+ else
+ src = File.path(src)
+ if File.directory?(dest)
+ yield src, File.join(dest, File.basename(src))
+ else
+ yield src, File.path(dest)
+ end
+ end
+ end
+ private_module_function :fu_each_src_dest0
+
+ def fu_same?(a, b) #:nodoc:
+ File.identical?(a, b)
+ end
+ private_module_function :fu_same?
+
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+
+ def fu_output_message(msg) #:nodoc:
+ @fileutils_output ||= $stderr
+ @fileutils_label ||= ''
+ @fileutils_output.puts @fileutils_label + msg
+ end
+ private_module_function :fu_output_message
+
+ # This hash table holds command options.
+ OPT_TABLE = {} #:nodoc: internal use only
+ (private_instance_methods & methods(false)).inject(OPT_TABLE) {|tbl, name|
+ (tbl[name.to_s] = instance_method(name).parameters).map! {|t, n| n if t == :key}.compact!
+ tbl
+ }
+
+ #
+ # Returns an Array of method names which have any options.
+ #
+ # p Bundler::FileUtils.commands #=> ["chmod", "cp", "cp_r", "install", ...]
+ #
+ def self.commands
+ OPT_TABLE.keys
+ end
+
+ #
+ # Returns an Array of option names.
+ #
+ # p Bundler::FileUtils.options #=> ["noop", "force", "verbose", "preserve", "mode"]
+ #
+ def self.options
+ OPT_TABLE.values.flatten.uniq.map {|sym| sym.to_s }
+ end
+
+ #
+ # Returns true if the method +mid+ have an option +opt+.
+ #
+ # p Bundler::FileUtils.have_option?(:cp, :noop) #=> true
+ # p Bundler::FileUtils.have_option?(:rm, :force) #=> true
+ # p Bundler::FileUtils.have_option?(:rm, :preserve) #=> false
+ #
+ def self.have_option?(mid, opt)
+ li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}"
+ li.include?(opt)
+ end
+
+ #
+ # Returns an Array of option names of the method +mid+.
+ #
+ # p Bundler::FileUtils.options_of(:rm) #=> ["noop", "verbose", "force"]
+ #
+ def self.options_of(mid)
+ OPT_TABLE[mid.to_s].map {|sym| sym.to_s }
+ end
+
+ #
+ # Returns an Array of method names which have the option +opt+.
+ #
+ # p Bundler::FileUtils.collect_method(:preserve) #=> ["cp", "cp_r", "copy", "install"]
+ #
+ def self.collect_method(opt)
+ OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
+ end
+
+ LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern)
+ module LowMethods
+ private
+ def _do_nothing(*)end
+ ::Bundler::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
+ end
+
+ METHODS = singleton_methods() - [:private_module_function,
+ :commands, :options, :have_option?, :options_of, :collect_method]
+
+ #
+ # This module has all methods of Bundler::FileUtils module, but it outputs messages
+ # before acting. This equates to passing the <tt>:verbose</tt> flag to
+ # methods in Bundler::FileUtils.
+ #
+ module Verbose
+ include Bundler::FileUtils
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ names = ::Bundler::FileUtils.collect_method(:verbose)
+ names.each do |name|
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args, **options)
+ super(*args, **options, verbose: true)
+ end
+ EOS
+ end
+ private(*names)
+ extend self
+ class << self
+ public(*::Bundler::FileUtils::METHODS)
+ end
+ end
+
+ #
+ # This module has all methods of Bundler::FileUtils module, but never changes
+ # files/directories. This equates to passing the <tt>:noop</tt> flag
+ # to methods in Bundler::FileUtils.
+ #
+ module NoWrite
+ include Bundler::FileUtils
+ include LowMethods
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ names = ::Bundler::FileUtils.collect_method(:noop)
+ names.each do |name|
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args, **options)
+ super(*args, **options, noop: true)
+ end
+ EOS
+ end
+ private(*names)
+ extend self
+ class << self
+ public(*::Bundler::FileUtils::METHODS)
+ end
+ end
+
+ #
+ # This module has all methods of Bundler::FileUtils module, but never changes
+ # files/directories, with printing message before acting.
+ # This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
+ # to methods in Bundler::FileUtils.
+ #
+ module DryRun
+ include Bundler::FileUtils
+ include LowMethods
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ names = ::Bundler::FileUtils.collect_method(:noop)
+ names.each do |name|
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ def #{name}(*args, **options)
+ super(*args, **options, noop: true, verbose: true)
+ end
+ EOS
+ end
+ private(*names)
+ extend self
+ class << self
+ public(*::Bundler::FileUtils::METHODS)
+ end
+ end
+
+end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo.rb b/lib/bundler/vendor/molinillo/lib/molinillo.rb
index 134bf1d720..9e2867144f 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo.rb
@@ -1,4 +1,6 @@
# frozen_string_literal: true
+
+require 'bundler/vendor/molinillo/lib/molinillo/compatibility'
require 'bundler/vendor/molinillo/lib/molinillo/gem_metadata'
require 'bundler/vendor/molinillo/lib/molinillo/errors'
require 'bundler/vendor/molinillo/lib/molinillo/resolver'
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb b/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
new file mode 100644
index 0000000000..3eba8e4083
--- /dev/null
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+module Bundler::Molinillo
+ # Hacks needed for old Ruby versions.
+ module Compatibility
+ module_function
+
+ if [].respond_to?(:flat_map)
+ # Flat map
+ # @param [Enumerable] enum an enumerable object
+ # @block the block to flat-map with
+ # @return The enum, flat-mapped
+ def flat_map(enum, &blk)
+ enum.flat_map(&blk)
+ end
+ else
+ # Flat map
+ # @param [Enumerable] enum an enumerable object
+ # @block the block to flat-map with
+ # @return The enum, flat-mapped
+ def flat_map(enum, &blk)
+ enum.map(&blk).flatten(1)
+ end
+ end
+ end
+end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
index 253c18764f..bcacf35243 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# @!visibility private
module Delegates
@@ -45,6 +46,12 @@ module Bundler::Molinillo
current_state = state || Bundler::Molinillo::ResolutionState.empty
current_state.conflicts
end
+
+ # (see Bundler::Molinillo::ResolutionState#unused_unwind_options)
+ def unused_unwind_options
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
+ current_state.unused_unwind_options
+ end
end
end
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
index 29f48d5b3c..ec9c770a28 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
module Delegates
# Delegates all {Bundler::Molinillo::SpecificationProvider} methods to a
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
index 76e84ab7e6..677a8bd916 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'set'
require 'tsort'
@@ -147,8 +148,8 @@ module Bundler::Molinillo
vertex = add_vertex(name, payload, root)
vertex.explicit_requirements << requirement if root
parent_names.each do |parent_name|
- parent_node = vertex_named(parent_name)
- add_edge(parent_node, vertex, requirement)
+ parent_vertex = vertex_named(parent_name)
+ add_edge(parent_vertex, vertex, requirement)
end
vertex
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
index e0dfe6cbbd..c04c7eec9c 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
class DependencyGraph
# An action that modifies a {DependencyGraph} that is reversible.
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
index 9092e4d546..9849aea2fe 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
index eda4251801..0a1e08255b 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
index e9125a59c6..1d9f4b327d 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
index d20b2cb0e0..385dcbdd06 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
index 72a705e023..8582dd19c1 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular'
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex'
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge'
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
index 8d8e10fedf..37286d104a 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
index 53524d36ad..d6ad16e07a 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph/action'
module Bundler::Molinillo
class DependencyGraph
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
index eab989e7bc..e4d016de24 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
class DependencyGraph
# A vertex in a {DependencyGraph} that encapsulates a {#name} and a
@@ -32,7 +33,7 @@ module Bundler::Molinillo
# @return [Array<Object>] all of the requirements that required
# this vertex
def requirements
- incoming_edges.map(&:requirement) + explicit_requirements
+ (incoming_edges.map(&:requirement) + explicit_requirements).uniq
end
# @return [Array<Edge>] the edges of {#graph} that have `self` as their
@@ -53,7 +54,7 @@ module Bundler::Molinillo
# {#descendent?}
def recursive_predecessors
vertices = predecessors
- vertices += vertices.map(&:recursive_predecessors).flatten(1)
+ vertices += Compatibility.flat_map(vertices, &:recursive_predecessors)
vertices.uniq!
vertices
end
@@ -68,7 +69,7 @@ module Bundler::Molinillo
# {#ancestor?}
def recursive_successors
vertices = successors
- vertices += vertices.map(&:recursive_successors).flatten(1)
+ vertices += Compatibility.flat_map(vertices, &:recursive_successors)
vertices.uniq!
vertices
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb b/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
index f904bd0814..fb343250b1 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# An error that occurred during the resolution process
class ResolverError < StandardError; end
@@ -41,11 +42,11 @@ module Bundler::Molinillo
attr_reader :dependencies
# Initializes a new error with the given circular vertices.
- # @param [Array<DependencyGraph::Vertex>] nodes the nodes in the dependency
+ # @param [Array<DependencyGraph::Vertex>] vertices the vertices in the dependency
# that caused the error
- def initialize(nodes)
- super "There is a circular dependency between #{nodes.map(&:name).join(' and ')}"
- @dependencies = nodes.map(&:payload).to_set
+ def initialize(vertices)
+ super "There is a circular dependency between #{vertices.map(&:name).join(' and ')}"
+ @dependencies = vertices.map { |vertex| vertex.payload.possibilities.last }.to_set
end
end
@@ -55,11 +56,16 @@ module Bundler::Molinillo
# resolution to fail
attr_reader :conflicts
+ # @return [SpecificationProvider] the specification provider used during
+ # resolution
+ attr_reader :specification_provider
+
# Initializes a new error with the given version conflicts.
# @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
- def initialize(conflicts)
+ # @param [SpecificationProvider] specification_provider see {#specification_provider}
+ def initialize(conflicts, specification_provider)
pairs = []
- conflicts.values.flatten.map(&:requirements).flatten.each do |conflicting|
+ Compatibility.flat_map(conflicts.values.flatten, &:requirements).each do |conflicting|
conflicting.each do |source, conflict_requirements|
conflict_requirements.each do |c|
pairs << [c, source]
@@ -69,7 +75,64 @@ module Bundler::Molinillo
super "Unable to satisfy the following requirements:\n\n" \
"#{pairs.map { |r, d| "- `#{r}` required by `#{d}`" }.join("\n")}"
+
@conflicts = conflicts
+ @specification_provider = specification_provider
+ end
+
+ require 'bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider'
+ include Delegates::SpecificationProvider
+
+ # @return [String] An error message that includes requirement trees,
+ # which is much more detailed & customizable than the default message
+ # @param [Hash] opts the options to create a message with.
+ # @option opts [String] :solver_name The user-facing name of the solver
+ # @option opts [String] :possibility_type The generic name of a possibility
+ # @option opts [Proc] :reduce_trees A proc that reduced the list of requirement trees
+ # @option opts [Proc] :printable_requirement A proc that pretty-prints requirements
+ # @option opts [Proc] :additional_message_for_conflict A proc that appends additional
+ # messages for each conflict
+ # @option opts [Proc] :version_for_spec A proc that returns the version number for a
+ # possibility
+ def message_with_trees(opts = {})
+ solver_name = opts.delete(:solver_name) { self.class.name.split('::').first }
+ possibility_type = opts.delete(:possibility_type) { 'possibility named' }
+ reduce_trees = opts.delete(:reduce_trees) { proc { |trees| trees.uniq.sort_by(&:to_s) } }
+ printable_requirement = opts.delete(:printable_requirement) { proc { |req| req.to_s } }
+ additional_message_for_conflict = opts.delete(:additional_message_for_conflict) { proc {} }
+ version_for_spec = opts.delete(:version_for_spec) { proc(&:to_s) }
+
+ conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
+ o << %(\n#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":\n)
+ if conflict.locked_requirement
+ o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
+ o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
+ o << %(\n)
+ end
+ o << %( In #{name_for_explicit_dependency_source}:\n)
+ trees = reduce_trees.call(conflict.requirement_trees)
+
+ o << trees.map do |tree|
+ t = ''.dup
+ depth = 2
+ tree.each do |req|
+ t << ' ' * depth << req.to_s
+ unless tree.last == req
+ if spec = conflict.activated_by_name[name_for(req)]
+ t << %( was resolved to #{version_for_spec.call(spec)}, which)
+ end
+ t << %( depends on)
+ end
+ t << %(\n)
+ depth += 1
+ end
+ t
+ end.join("\n")
+
+ additional_message_for_conflict.call(o, name, conflict)
+
+ o
+ end.strip
end
end
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
index a4fb6dd68e..3feb7be9b5 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# The version of Bundler::Molinillo.
- VERSION = '0.5.7'.freeze
+ VERSION = '0.6.4'.freeze
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb b/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
index 0f1ad195f2..fa094c1981 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# Provides information about specifcations and dependencies to the resolver,
# allowing the {Resolver} class to remain generic while still providing power
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb b/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
index d47cfa2928..a166bc6991 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# Conveys information about the resolution process to a user.
module UI
@@ -48,7 +49,8 @@ module Bundler::Molinillo
if debug?
debug_info = yield
debug_info = debug_info.inspect unless debug_info.is_a?(String)
- output.puts debug_info.split("\n").map { |s| ' ' * depth + s }
+ debug_info = debug_info.split("\n").map { |s| ":#{depth.to_s.rjust 4}: #{s}" }
+ output.puts debug_info
end
end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
index 1845966a75..0eb665d17a 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
class Resolver
# A specific resolution from a given {Resolver}
@@ -8,22 +9,125 @@ module Bundler::Molinillo
# @attr [{String,Nil=>[Object]}] requirements the requirements that caused the conflict
# @attr [Object, nil] existing the existing spec that was in conflict with
# the {#possibility}
- # @attr [Object] possibility the spec that was unable to be activated due
- # to a conflict
+ # @attr [Object] possibility_set the set of specs that was unable to be
+ # activated due to a conflict.
# @attr [Object] locked_requirement the relevant locking requirement.
# @attr [Array<Array<Object>>] requirement_trees the different requirement
# trees that led to every requirement for the conflicting name.
# @attr [{String=>Object}] activated_by_name the already-activated specs.
+ # @attr [Object] underlying_error an error that has occurred during resolution, and
+ # will be raised at the end of it if no resolution is found.
Conflict = Struct.new(
:requirement,
:requirements,
:existing,
- :possibility,
+ :possibility_set,
:locked_requirement,
:requirement_trees,
- :activated_by_name
+ :activated_by_name,
+ :underlying_error
)
+ class Conflict
+ # @return [Object] a spec that was unable to be activated due to a conflict
+ def possibility
+ possibility_set && possibility_set.latest_version
+ end
+ end
+
+ # A collection of possibility states that share the same dependencies
+ # @attr [Array] dependencies the dependencies for this set of possibilities
+ # @attr [Array] possibilities the possibilities
+ PossibilitySet = Struct.new(:dependencies, :possibilities)
+
+ class PossibilitySet
+ # String representation of the possibility set, for debugging
+ def to_s
+ "[#{possibilities.join(', ')}]"
+ end
+
+ # @return [Object] most up-to-date dependency in the possibility set
+ def latest_version
+ possibilities.last
+ end
+ end
+
+ # Details of the state to unwind to when a conflict occurs, and the cause of the unwind
+ # @attr [Integer] state_index the index of the state to unwind to
+ # @attr [Object] state_requirement the requirement of the state we're unwinding to
+ # @attr [Array] requirement_tree for the requirement we're relaxing
+ # @attr [Array] conflicting_requirements the requirements that combined to cause the conflict
+ # @attr [Array] requirement_trees for the conflict
+ # @attr [Array] requirements_unwound_to_instead array of unwind requirements that were chosen over this unwind
+ UnwindDetails = Struct.new(
+ :state_index,
+ :state_requirement,
+ :requirement_tree,
+ :conflicting_requirements,
+ :requirement_trees,
+ :requirements_unwound_to_instead
+ )
+
+ class UnwindDetails
+ include Comparable
+
+ # We compare UnwindDetails when choosing which state to unwind to. If
+ # two options have the same state_index we prefer the one most
+ # removed from a requirement that caused the conflict. Both options
+ # would unwind to the same state, but a `grandparent` option will
+ # filter out fewer of its possibilities after doing so - where a state
+ # is both a `parent` and a `grandparent` to requirements that have
+ # caused a conflict this is the correct behaviour.
+ # @param [UnwindDetail] other UnwindDetail to be compared
+ # @return [Integer] integer specifying ordering
+ def <=>(other)
+ if state_index > other.state_index
+ 1
+ elsif state_index == other.state_index
+ reversed_requirement_tree_index <=> other.reversed_requirement_tree_index
+ else
+ -1
+ end
+ end
+
+ # @return [Integer] index of state requirement in reversed requirement tree
+ # (the conflicting requirement itself will be at position 0)
+ def reversed_requirement_tree_index
+ @reversed_requirement_tree_index ||=
+ if state_requirement
+ requirement_tree.reverse.index(state_requirement)
+ else
+ 999_999
+ end
+ end
+
+ # @return [Boolean] where the requirement of the state we're unwinding
+ # to directly caused the conflict. Note: in this case, it is
+ # impossible for the state we're unwinding to to be a parent of
+ # any of the other conflicting requirements (or we would have
+ # circularity)
+ def unwinding_to_primary_requirement?
+ requirement_tree.last == state_requirement
+ end
+
+ # @return [Array] array of sub-dependencies to avoid when choosing a
+ # new possibility for the state we've unwound to. Only relevant for
+ # non-primary unwinds
+ def sub_dependencies_to_avoid
+ @requirements_to_avoid ||=
+ requirement_trees.map do |tree|
+ index = tree.index(state_requirement)
+ tree[index + 1] if index
+ end.compact
+ end
+
+ # @return [Array] array of all the requirements that led to the need for
+ # this unwind
+ def all_requirements
+ @all_requirements ||= requirement_trees.flatten(1)
+ end
+ end
+
# @return [SpecificationProvider] the provider that knows about
# dependencies, requirements, specifications, versions, etc.
attr_reader :specification_provider
@@ -64,7 +168,7 @@ module Bundler::Molinillo
start_resolution
while state
- break unless state.requirements.any? || state.requirement
+ break if !state.requirement && state.requirements.empty?
indicate_progress
if state.respond_to?(:pop_possibility_state) # DependencyState
debug(depth) { "Creating possibility state for #{requirement} (#{possibilities.count} remaining)" }
@@ -78,7 +182,7 @@ module Bundler::Molinillo
process_topmost_state
end
- activated.freeze
+ resolve_activated_specs
ensure
end_resolution
end
@@ -109,6 +213,19 @@ module Bundler::Molinillo
resolver_ui.before_resolution
end
+ def resolve_activated_specs
+ activated.vertices.each do |_, vertex|
+ next unless vertex.payload
+
+ latest_version = vertex.payload.possibilities.reverse_each.find do |possibility|
+ vertex.requirements.all? { |req| requirement_satisfied_by?(req, activated, possibility) }
+ end
+
+ activated.set_payload(vertex.name, latest_version)
+ end
+ activated.freeze
+ end
+
# Ends the resolution process
# @return [void]
def end_resolution
@@ -136,9 +253,12 @@ module Bundler::Molinillo
if possibility
attempt_to_activate
else
- create_conflict if state.is_a? PossibilityState
- unwind_for_conflict until possibility && state.is_a?(DependencyState)
+ create_conflict
+ unwind_for_conflict
end
+ rescue CircularDependencyError => underlying_error
+ create_conflict(underlying_error)
+ unwind_for_conflict
end
# @return [Object] the current possibility that the resolution is trying
@@ -158,7 +278,10 @@ module Bundler::Molinillo
# @return [DependencyState] the initial state for the resolution
def initial_state
graph = DependencyGraph.new.tap do |dg|
- original_requested.each { |r| dg.add_vertex(name_for(r), nil, true).tap { |v| v.explicit_requirements << r } }
+ original_requested.each do |requested|
+ vertex = dg.add_vertex(name_for(requested), nil, true)
+ vertex.explicit_requirements << requested
+ end
dg.tag(:initial_state)
end
@@ -169,45 +292,280 @@ module Bundler::Molinillo
requirements,
graph,
initial_requirement,
- initial_requirement && search_for(initial_requirement),
+ possibilities_for_requirement(initial_requirement, graph),
0,
- {}
+ {},
+ []
)
end
# Unwinds the states stack because a conflict has been encountered
# @return [void]
def unwind_for_conflict
- debug(depth) { "Unwinding for conflict: #{requirement} to #{state_index_for_unwind / 2}" }
+ details_for_unwind = build_details_for_unwind
+ unwind_options = unused_unwind_options
+ debug(depth) { "Unwinding for conflict: #{requirement} to #{details_for_unwind.state_index / 2}" }
conflicts.tap do |c|
- sliced_states = states.slice!((state_index_for_unwind + 1)..-1)
- raise VersionConflict.new(c) unless state
+ sliced_states = states.slice!((details_for_unwind.state_index + 1)..-1)
+ raise_error_unless_state(c)
activated.rewind_to(sliced_states.first || :initial_state) if sliced_states
state.conflicts = c
+ state.unused_unwind_options = unwind_options
+ filter_possibilities_after_unwind(details_for_unwind)
index = states.size - 1
@parents_of.each { |_, a| a.reject! { |i| i >= index } }
+ state.unused_unwind_options.reject! { |uw| uw.state_index >= index }
+ end
+ end
+
+ # Raises a VersionConflict error, or any underlying error, if there is no
+ # current state
+ # @return [void]
+ def raise_error_unless_state(conflicts)
+ return if state
+
+ error = conflicts.values.map(&:underlying_error).compact.first
+ raise error || VersionConflict.new(conflicts, specification_provider)
+ end
+
+ # @return [UnwindDetails] Details of the nearest index to which we could unwind
+ def build_details_for_unwind
+ # Get the possible unwinds for the current conflict
+ current_conflict = conflicts[name]
+ binding_requirements = binding_requirements_for_conflict(current_conflict)
+ unwind_details = unwind_options_for_requirements(binding_requirements)
+
+ last_detail_for_current_unwind = unwind_details.sort.last
+ current_detail = last_detail_for_current_unwind
+
+ # Look for past conflicts that could be unwound to affect the
+ # requirement tree for the current conflict
+ relevant_unused_unwinds = unused_unwind_options.select do |alternative|
+ intersecting_requirements =
+ last_detail_for_current_unwind.all_requirements &
+ alternative.requirements_unwound_to_instead
+ next if intersecting_requirements.empty?
+ # Find the highest index unwind whilst looping through
+ current_detail = alternative if alternative > current_detail
+ alternative
+ end
+
+ # Add the current unwind options to the `unused_unwind_options` array.
+ # The "used" option will be filtered out during `unwind_for_conflict`.
+ state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
+
+ # Update the requirements_unwound_to_instead on any relevant unused unwinds
+ relevant_unused_unwinds.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
+ unwind_details.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
+
+ current_detail
+ end
+
+ # @param [Array<Object>] array of requirements that combine to create a conflict
+ # @return [Array<UnwindDetails>] array of UnwindDetails that have a chance
+ # of resolving the passed requirements
+ def unwind_options_for_requirements(binding_requirements)
+ unwind_details = []
+
+ trees = []
+ binding_requirements.reverse_each do |r|
+ partial_tree = [r]
+ trees << partial_tree
+ unwind_details << UnwindDetails.new(-1, nil, partial_tree, binding_requirements, trees, [])
+
+ # If this requirement has alternative possibilities, check if any would
+ # satisfy the other requirements that created this conflict
+ requirement_state = find_state_for(r)
+ if conflict_fixing_possibilities?(requirement_state, binding_requirements)
+ unwind_details << UnwindDetails.new(
+ states.index(requirement_state),
+ r,
+ partial_tree,
+ binding_requirements,
+ trees,
+ []
+ )
+ end
+
+ # Next, look at the parent of this requirement, and check if the requirement
+ # could have been avoided if an alternative PossibilitySet had been chosen
+ parent_r = parent_of(r)
+ next if parent_r.nil?
+ partial_tree.unshift(parent_r)
+ requirement_state = find_state_for(parent_r)
+ if requirement_state.possibilities.any? { |set| !set.dependencies.include?(r) }
+ unwind_details << UnwindDetails.new(
+ states.index(requirement_state),
+ parent_r,
+ partial_tree,
+ binding_requirements,
+ trees,
+ []
+ )
+ end
+
+ # Finally, look at the grandparent and up of this requirement, looking
+ # for any possibilities that wouldn't create their parent requirement
+ grandparent_r = parent_of(parent_r)
+ until grandparent_r.nil?
+ partial_tree.unshift(grandparent_r)
+ requirement_state = find_state_for(grandparent_r)
+ if requirement_state.possibilities.any? { |set| !set.dependencies.include?(parent_r) }
+ unwind_details << UnwindDetails.new(
+ states.index(requirement_state),
+ grandparent_r,
+ partial_tree,
+ binding_requirements,
+ trees,
+ []
+ )
+ end
+ parent_r = grandparent_r
+ grandparent_r = parent_of(parent_r)
+ end
+ end
+
+ unwind_details
+ end
+
+ # @param [DependencyState] state
+ # @param [Array] array of requirements
+ # @return [Boolean] whether or not the given state has any possibilities
+ # that could satisfy the given requirements
+ def conflict_fixing_possibilities?(state, binding_requirements)
+ return false unless state
+
+ state.possibilities.any? do |possibility_set|
+ possibility_set.possibilities.any? do |poss|
+ possibility_satisfies_requirements?(poss, binding_requirements)
+ end
+ end
+ end
+
+ # Filter's a state's possibilities to remove any that would not fix the
+ # conflict we've just rewound from
+ # @param [UnwindDetails] details of the conflict just unwound from
+ # @return [void]
+ def filter_possibilities_after_unwind(unwind_details)
+ return unless state && !state.possibilities.empty?
+
+ if unwind_details.unwinding_to_primary_requirement?
+ filter_possibilities_for_primary_unwind(unwind_details)
+ else
+ filter_possibilities_for_parent_unwind(unwind_details)
+ end
+ end
+
+ # Filter's a state's possibilities to remove any that would not satisfy
+ # the requirements in the conflict we've just rewound from
+ # @param [UnwindDetails] details of the conflict just unwound from
+ # @return [void]
+ def filter_possibilities_for_primary_unwind(unwind_details)
+ unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
+ unwinds_to_state << unwind_details
+ unwind_requirement_sets = unwinds_to_state.map(&:conflicting_requirements)
+
+ state.possibilities.reject! do |possibility_set|
+ possibility_set.possibilities.none? do |poss|
+ unwind_requirement_sets.any? do |requirements|
+ possibility_satisfies_requirements?(poss, requirements)
+ end
+ end
end
end
- # @return [Integer] The index to which the resolution should unwind in the
- # case of conflict.
- def state_index_for_unwind
- current_requirement = requirement
- existing_requirement = requirement_for_existing_name(name)
- index = -1
- [current_requirement, existing_requirement].each do |r|
- until r.nil?
- current_state = find_state_for(r)
- if state_any?(current_state)
- current_index = states.index(current_state)
- index = current_index if current_index > index
- break
+ # @param [Object] possibility a single possibility
+ # @param [Array] requirements an array of requirements
+ # @return [Boolean] whether the possibility satisfies all of the
+ # given requirements
+ def possibility_satisfies_requirements?(possibility, requirements)
+ name = name_for(possibility)
+
+ activated.tag(:swap)
+ activated.set_payload(name, possibility) if activated.vertex_named(name)
+ satisfied = requirements.all? { |r| requirement_satisfied_by?(r, activated, possibility) }
+ activated.rewind_to(:swap)
+
+ satisfied
+ end
+
+ # Filter's a state's possibilities to remove any that would (eventually)
+ # create a requirement in the conflict we've just rewound from
+ # @param [UnwindDetails] details of the conflict just unwound from
+ # @return [void]
+ def filter_possibilities_for_parent_unwind(unwind_details)
+ unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
+ unwinds_to_state << unwind_details
+
+ primary_unwinds = unwinds_to_state.select(&:unwinding_to_primary_requirement?).uniq
+ parent_unwinds = unwinds_to_state.uniq - primary_unwinds
+
+ allowed_possibility_sets = Compatibility.flat_map(primary_unwinds) do |unwind|
+ states[unwind.state_index].possibilities.select do |possibility_set|
+ possibility_set.possibilities.any? do |poss|
+ possibility_satisfies_requirements?(poss, unwind.conflicting_requirements)
end
- r = parent_of(r)
end
end
- index
+ requirements_to_avoid = Compatibility.flat_map(parent_unwinds, &:sub_dependencies_to_avoid)
+
+ state.possibilities.reject! do |possibility_set|
+ !allowed_possibility_sets.include?(possibility_set) &&
+ (requirements_to_avoid - possibility_set.dependencies).empty?
+ end
+ end
+
+ # @param [Conflict] conflict
+ # @return [Array] minimal array of requirements that would cause the passed
+ # conflict to occur.
+ def binding_requirements_for_conflict(conflict)
+ return [conflict.requirement] if conflict.possibility.nil?
+
+ possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
+
+ # When there’s a `CircularDependency` error the conflicting requirement
+ # (the one causing the circular) won’t be `conflict.requirement`
+ # (which won’t be for the right state, because we won’t have created it,
+ # because it’s circular).
+ # We need to make sure we have that requirement in the conflict’s list,
+ # otherwise we won’t be able to unwind properly, so we just return all
+ # the requirements for the conflict.
+ return possible_binding_requirements if conflict.underlying_error
+
+ possibilities = search_for(conflict.requirement)
+
+ # If all the requirements together don't filter out all possibilities,
+ # then the only two requirements we need to consider are the initial one
+ # (where the dependency's version was first chosen) and the last
+ if binding_requirement_in_set?(nil, possible_binding_requirements, possibilities)
+ return [conflict.requirement, requirement_for_existing_name(name_for(conflict.requirement))].compact
+ end
+
+ # Loop through the possible binding requirements, removing each one
+ # that doesn't bind. Use a `reverse_each` as we want the earliest set of
+ # binding requirements, and don't use `reject!` as we wish to refine the
+ # array *on each iteration*.
+ binding_requirements = possible_binding_requirements.dup
+ possible_binding_requirements.reverse_each do |req|
+ next if req == conflict.requirement
+ unless binding_requirement_in_set?(req, binding_requirements, possibilities)
+ binding_requirements -= [req]
+ end
+ end
+
+ binding_requirements
+ end
+
+ # @param [Object] requirement we wish to check
+ # @param [Array] array of requirements
+ # @param [Array] array of possibilities the requirements will be used to filter
+ # @return [Boolean] whether or not the given requirement is required to filter
+ # out all elements of the array of possibilities.
+ def binding_requirement_in_set?(requirement, possible_binding_requirements, possibilities)
+ possibilities.any? do |poss|
+ possibility_satisfies_requirements?(poss, possible_binding_requirements - [requirement])
+ end
end
# @return [Object] the requirement that led to `requirement` being added
@@ -222,7 +580,8 @@ module Bundler::Molinillo
# @return [Object] the requirement that led to a version of a possibility
# with the given name being activated.
def requirement_for_existing_name(name)
- return nil unless activated.vertex_named(name).payload
+ return nil unless vertex = activated.vertex_named(name)
+ return nil unless vertex.payload
states.find { |s| s.name == name }.requirement
end
@@ -230,18 +589,12 @@ module Bundler::Molinillo
# `requirement`.
def find_state_for(requirement)
return nil unless requirement
- states.reverse_each.find { |i| requirement == i.requirement && i.is_a?(DependencyState) }
- end
-
- # @return [Boolean] whether or not the given state has any possibilities
- # left.
- def state_any?(state)
- state && state.possibilities.any?
+ states.find { |i| requirement == i.requirement }
end
# @return [Conflict] a {Conflict} that reflects the failure to activate
# the {#possibility} in conjunction with the current {#state}
- def create_conflict
+ def create_conflict(underlying_error = nil)
vertex = activated.vertex_named(name)
locked_requirement = locked_requirement_named(name)
@@ -250,18 +603,21 @@ module Bundler::Molinillo
requirements[name_for_explicit_dependency_source] = vertex.explicit_requirements
end
requirements[name_for_locking_dependency_source] = [locked_requirement] if locked_requirement
- vertex.incoming_edges.each { |edge| (requirements[edge.origin.payload] ||= []).unshift(edge.requirement) }
+ vertex.incoming_edges.each do |edge|
+ (requirements[edge.origin.payload.latest_version] ||= []).unshift(edge.requirement)
+ end
activated_by_name = {}
- activated.each { |v| activated_by_name[v.name] = v.payload if v.payload }
+ activated.each { |v| activated_by_name[v.name] = v.payload.latest_version if v.payload }
conflicts[name] = Conflict.new(
requirement,
requirements,
- vertex.payload,
+ vertex.payload && vertex.payload.latest_version,
possibility,
locked_requirement,
requirement_trees,
- activated_by_name
+ activated_by_name,
+ underlying_error
)
end
@@ -311,116 +667,48 @@ module Bundler::Molinillo
# @return [void]
def attempt_to_activate
debug(depth) { 'Attempting to activate ' + possibility.to_s }
- existing_node = activated.vertex_named(name)
- if existing_node.payload
- debug(depth) { "Found existing spec (#{existing_node.payload})" }
- attempt_to_activate_existing_spec(existing_node)
- else
- attempt_to_activate_new_spec
- end
- end
-
- # Attempts to activate the current {#possibility} (given that it has
- # already been activated)
- # @return [void]
- def attempt_to_activate_existing_spec(existing_node)
- existing_spec = existing_node.payload
- if requirement_satisfied_by?(requirement, activated, existing_spec)
- new_requirements = requirements.dup
- push_state_for_requirements(new_requirements, false)
+ existing_vertex = activated.vertex_named(name)
+ if existing_vertex.payload
+ debug(depth) { "Found existing spec (#{existing_vertex.payload})" }
+ attempt_to_filter_existing_spec(existing_vertex)
else
- return if attempt_to_swap_possibility
- create_conflict
- debug(depth) { "Unsatisfied by existing spec (#{existing_node.payload})" }
- unwind_for_conflict
- end
- end
-
- # Attempts to swp the current {#possibility} with the already-activated
- # spec with the given name
- # @return [Boolean] Whether the possibility was swapped into {#activated}
- def attempt_to_swap_possibility
- activated.tag(:swap)
- vertex = activated.vertex_named(name)
- activated.set_payload(name, possibility)
- if !vertex.requirements.
- all? { |r| requirement_satisfied_by?(r, activated, possibility) } ||
- !new_spec_satisfied?
- activated.rewind_to(:swap)
- return
- end
- fixup_swapped_children(vertex)
- activate_spec
- end
-
- # Ensures there are no orphaned successors to the given {vertex}.
- # @param [DependencyGraph::Vertex] vertex the vertex to fix up.
- # @return [void]
- def fixup_swapped_children(vertex) # rubocop:disable Metrics/CyclomaticComplexity
- payload = vertex.payload
- deps = dependencies_for(payload).group_by(&method(:name_for))
- vertex.outgoing_edges.each do |outgoing_edge|
- requirement = outgoing_edge.requirement
- parent_index = @parents_of[requirement].last
- succ = outgoing_edge.destination
- matching_deps = Array(deps[succ.name])
- dep_matched = matching_deps.include?(requirement)
-
- # only push the current index when it was originally required by the
- # same named spec
- if parent_index && states[parent_index].name == name
- @parents_of[requirement].push(states.size - 1)
+ latest = possibility.latest_version
+ # use reject!(!satisfied) for 1.8.7 compatibility
+ possibility.possibilities.reject! do |possibility|
+ !requirement_satisfied_by?(requirement, activated, possibility)
end
-
- if matching_deps.empty? && !succ.root? && succ.predecessors.to_a == [vertex]
- debug(depth) { "Removing orphaned spec #{succ.name} after swapping #{name}" }
- succ.requirements.each { |r| @parents_of.delete(r) }
-
- removed_names = activated.detach_vertex_named(succ.name).map(&:name)
- requirements.delete_if do |r|
- # the only removed vertices are those with no other requirements,
- # so it's safe to delete only based upon name here
- removed_names.include?(name_for(r))
- end
- elsif !dep_matched
- debug(depth) { "Removing orphaned dependency #{requirement} after swapping #{name}" }
- # also reset if we're removing the edge, but only if its parent has
- # already been fixed up
- @parents_of[requirement].push(states.size - 1) if @parents_of[requirement].empty?
-
- activated.delete_edge(outgoing_edge)
- requirements.delete(requirement)
+ if possibility.latest_version.nil?
+ # ensure there's a possibility for better error messages
+ possibility.possibilities << latest if latest
+ create_conflict
+ unwind_for_conflict
+ else
+ activate_new_spec
end
end
end
- # Attempts to activate the current {#possibility} (given that it hasn't
- # already been activated)
+ # Attempts to update the existing vertex's `PossibilitySet` with a filtered version
# @return [void]
- def attempt_to_activate_new_spec
- if new_spec_satisfied?
- activate_spec
+ def attempt_to_filter_existing_spec(vertex)
+ filtered_set = filtered_possibility_set(vertex)
+ if !filtered_set.possibilities.empty?
+ activated.set_payload(name, filtered_set)
+ new_requirements = requirements.dup
+ push_state_for_requirements(new_requirements, false)
else
create_conflict
+ debug(depth) { "Unsatisfied by existing spec (#{vertex.payload})" }
unwind_for_conflict
end
end
- # @return [Boolean] whether the current spec is satisfied as a new
- # possibility.
- def new_spec_satisfied?
- unless requirement_satisfied_by?(requirement, activated, possibility)
- debug(depth) { 'Unsatisfied by requested spec' }
- return false
- end
-
- locked_requirement = locked_requirement_named(name)
-
- locked_spec_satisfied = !locked_requirement ||
- requirement_satisfied_by?(locked_requirement, activated, possibility)
- debug(depth) { 'Unsatisfied by locked spec' } unless locked_spec_satisfied
-
- locked_spec_satisfied
+ # Generates a filtered version of the existing vertex's `PossibilitySet` using the
+ # current state's `requirement`
+ # @param [Object] existing vertex
+ # @return [PossibilitySet] filtered possibility set
+ def filtered_possibility_set(vertex)
+ PossibilitySet.new(vertex.payload.dependencies, vertex.payload.possibilities & possibility.possibilities)
end
# @param [String] requirement_name the spec name to search for
@@ -434,7 +722,7 @@ module Bundler::Molinillo
# Add the current {#possibility} to the dependency graph of the current
# {#state}
# @return [void]
- def activate_spec
+ def activate_new_spec
conflicts.delete(name)
debug(depth) { "Activated #{name} at #{possibility}" }
activated.set_payload(name, possibility)
@@ -442,14 +730,14 @@ module Bundler::Molinillo
end
# Requires the dependencies that the recently activated spec has
- # @param [Object] activated_spec the specification that has just been
+ # @param [Object] activated_possibility the PossibilitySet that has just been
# activated
# @return [void]
- def require_nested_dependencies_for(activated_spec)
- nested_dependencies = dependencies_for(activated_spec)
+ def require_nested_dependencies_for(possibility_set)
+ nested_dependencies = dependencies_for(possibility_set.latest_version)
debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
nested_dependencies.each do |d|
- activated.add_child_vertex(name_for(d), nil, [name_for(activated_spec)], d)
+ activated.add_child_vertex(name_for(d), nil, [name_for(possibility_set.latest_version)], d)
parent_index = states.size - 1
parents = @parents_of[d]
parents << parent_index if parents.empty?
@@ -464,20 +752,75 @@ module Bundler::Molinillo
# @return [void]
def push_state_for_requirements(new_requirements, requires_sort = true, new_activated = activated)
new_requirements = sort_dependencies(new_requirements.uniq, new_activated, conflicts) if requires_sort
- new_requirement = new_requirements.shift
+ new_requirement = nil
+ loop do
+ new_requirement = new_requirements.shift
+ break if new_requirement.nil? || states.none? { |s| s.requirement == new_requirement }
+ end
new_name = new_requirement ? name_for(new_requirement) : ''.freeze
- possibilities = new_requirement ? search_for(new_requirement) : []
+ possibilities = possibilities_for_requirement(new_requirement)
handle_missing_or_push_dependency_state DependencyState.new(
new_name, new_requirements, new_activated,
- new_requirement, possibilities, depth, conflicts.dup
+ new_requirement, possibilities, depth, conflicts.dup, unused_unwind_options.dup
)
end
+ # Checks a proposed requirement with any existing locked requirement
+ # before generating an array of possibilities for it.
+ # @param [Object] the proposed requirement
+ # @return [Array] possibilities
+ def possibilities_for_requirement(requirement, activated = self.activated)
+ return [] unless requirement
+ if locked_requirement_named(name_for(requirement))
+ return locked_requirement_possibility_set(requirement, activated)
+ end
+
+ group_possibilities(search_for(requirement))
+ end
+
+ # @param [Object] the proposed requirement
+ # @return [Array] possibility set containing only the locked requirement, if any
+ def locked_requirement_possibility_set(requirement, activated = self.activated)
+ all_possibilities = search_for(requirement)
+ locked_requirement = locked_requirement_named(name_for(requirement))
+
+ # Longwinded way to build a possibilities array with either the locked
+ # requirement or nothing in it. Required, since the API for
+ # locked_requirement isn't guaranteed.
+ locked_possibilities = all_possibilities.select do |possibility|
+ requirement_satisfied_by?(locked_requirement, activated, possibility)
+ end
+
+ group_possibilities(locked_possibilities)
+ end
+
+ # Build an array of PossibilitySets, with each element representing a group of
+ # dependency versions that all have the same sub-dependency version constraints
+ # and are contiguous.
+ # @param [Array] an array of possibilities
+ # @return [Array] an array of possibility sets
+ def group_possibilities(possibilities)
+ possibility_sets = []
+ current_possibility_set = nil
+
+ possibilities.reverse_each do |possibility|
+ dependencies = dependencies_for(possibility)
+ if current_possibility_set && current_possibility_set.dependencies == dependencies
+ current_possibility_set.possibilities.unshift(possibility)
+ else
+ possibility_sets.unshift(PossibilitySet.new(dependencies, [possibility]))
+ current_possibility_set = possibility_sets.first
+ end
+ end
+
+ possibility_sets
+ end
+
# Pushes a new {DependencyState}.
# If the {#specification_provider} says to
# {SpecificationProvider#allow_missing?} that particular requirement, and
# there are no possibilities for that requirement, then `state` is not
- # pushed, and the node in {#activated} is removed, and we continue
+ # pushed, and the vertex in {#activated} is removed, and we continue
# resolving the remaining requirements.
# @param [DependencyState] state
# @return [void]
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
index 50d853b146..7d36858778 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph'
module Bundler::Molinillo
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/state.rb b/lib/bundler/vendor/molinillo/lib/molinillo/state.rb
index 3a8107cf1a..68fa1f54e3 100644
--- a/lib/bundler/vendor/molinillo/lib/molinillo/state.rb
+++ b/lib/bundler/vendor/molinillo/lib/molinillo/state.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler::Molinillo
# A state that a {Resolution} can be in
# @attr [String] name the name of the current requirement
@@ -7,7 +8,8 @@ module Bundler::Molinillo
# @attr [Object] requirement the current requirement
# @attr [Object] possibilities the possibilities to satisfy the current requirement
# @attr [Integer] depth the depth of the resolution
- # @attr [Set<Object>] conflicts unresolved conflicts
+ # @attr [Hash] conflicts unresolved conflicts, indexed by dependency name
+ # @attr [Array<UnwindDetails>] unused_unwind_options unwinds for previous conflicts that weren't explored
ResolutionState = Struct.new(
:name,
:requirements,
@@ -15,14 +17,15 @@ module Bundler::Molinillo
:requirement,
:possibilities,
:depth,
- :conflicts
+ :conflicts,
+ :unused_unwind_options
)
class ResolutionState
# Returns an empty resolution state
# @return [ResolutionState] an empty state
def self.empty
- new(nil, [], DependencyGraph.new, nil, nil, 0, Set.new)
+ new(nil, [], DependencyGraph.new, nil, nil, 0, {}, [])
end
end
@@ -40,7 +43,8 @@ module Bundler::Molinillo
requirement,
[possibilities.pop],
depth + 1,
- conflicts.dup
+ conflicts.dup,
+ unused_unwind_options.dup
).tap do |state|
state.activated.tag(state)
end
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
index c872a79c13..7cbca5bc06 100644
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
@@ -814,7 +814,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
##
# Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
- # block is given. Returns all responses recieved.
+ # block is given. Returns all responses received.
#
# See
# Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
diff --git a/lib/bundler/vendor/thor/lib/thor/runner.rb b/lib/bundler/vendor/thor/lib/thor/runner.rb
index 65ae422d7f..b110b8d478 100644
--- a/lib/bundler/vendor/thor/lib/thor/runner.rb
+++ b/lib/bundler/vendor/thor/lib/thor/runner.rb
@@ -3,7 +3,7 @@ require "bundler/vendor/thor/lib/thor/group"
require "bundler/vendor/thor/lib/thor/core_ext/io_binary_read"
require "yaml"
-require "digest/md5"
+require "digest"
require "pathname"
class Bundler::Thor::Runner < Bundler::Thor #:nodoc: # rubocop:disable ClassLength
@@ -90,7 +90,7 @@ class Bundler::Thor::Runner < Bundler::Thor #:nodoc: # rubocop:disable ClassLeng
end
thor_yaml[as] = {
- :filename => Digest::MD5.hexdigest(name + as),
+ :filename => Digest(:MD5).hexdigest(name + as),
:location => location,
:namespaces => Bundler::Thor::Util.namespaces_in_content(contents, base)
}
diff --git a/lib/bundler/vendored_fileutils.rb b/lib/bundler/vendored_fileutils.rb
new file mode 100644
index 0000000000..d14e98baf7
--- /dev/null
+++ b/lib/bundler/vendored_fileutils.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module Bundler; end
+if RUBY_VERSION >= "2.4"
+ require "bundler/vendor/fileutils/lib/fileutils"
+else
+ # the version we vendor is 2.4+
+ require "fileutils"
+end
diff --git a/lib/bundler/vendored_molinillo.rb b/lib/bundler/vendored_molinillo.rb
index 7b231263cb..061b634f72 100644
--- a/lib/bundler/vendored_molinillo.rb
+++ b/lib/bundler/vendored_molinillo.rb
@@ -1,3 +1,4 @@
# frozen_string_literal: true
+
module Bundler; end
require "bundler/vendor/molinillo/lib/molinillo"
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
index 729ac6b6f5..de9c42fcc1 100644
--- a/lib/bundler/vendored_persistent.rb
+++ b/lib/bundler/vendored_persistent.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
# We forcibly require OpenSSL, because net/http/persistent will only autoload
# it. On some Rubies, autoload fails but explicit require succeeds.
begin
@@ -15,3 +16,37 @@ module Bundler
end
end
require "bundler/vendor/net-http-persistent/lib/net/http/persistent"
+
+module Bundler
+ class PersistentHTTP < Persistent::Net::HTTP::Persistent
+ def connection_for(uri)
+ connection = super
+ warn_old_tls_version_rubygems_connection(uri, connection)
+ connection
+ end
+
+ def warn_old_tls_version_rubygems_connection(uri, connection)
+ return unless connection.use_ssl?
+ return unless (uri.host || "").end_with?("rubygems.org")
+
+ socket = connection.instance_variable_get(:@socket)
+ return unless socket
+ socket_io = socket.io
+ return unless socket_io.respond_to?(:ssl_version)
+ ssl_version = socket_io.ssl_version
+
+ case ssl_version
+ when /TLSv([\d\.]+)/
+ version = Gem::Version.new($1)
+ if version < Gem::Version.new("1.2")
+ Bundler.ui.warn \
+ "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \
+ "Starting in January 2018, RubyGems.org will refuse connection requests from these " \
+ "very old versions of OpenSSL. If you will need to continue installing gems after " \
+ "January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.",
+ :wrap => true
+ end
+ end
+ end
+ end
+end
diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb
index 4a5d0cf6bb..8cca090f55 100644
--- a/lib/bundler/vendored_thor.rb
+++ b/lib/bundler/vendored_thor.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
def self.require_thor_actions
Kernel.send(:require, "bundler/vendor/thor/lib/thor/actions")
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index b2dad6dfb6..c2355ff2c8 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: true
+# frozen_string_literal: false
# Ruby 1.9.3 and old RubyGems don't play nice with frozen version strings
# rubocop:disable MutableConstant
@@ -7,7 +7,7 @@ module Bundler
# We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to
# handle this better.
- VERSION = "1.15.4" unless defined?(::Bundler::VERSION)
+ VERSION = "1.16.0" unless defined?(::Bundler::VERSION)
def self.overwrite_loaded_gem_version
begin
@@ -21,4 +21,8 @@ module Bundler
end
private_class_method :overwrite_loaded_gem_version
overwrite_loaded_gem_version
+
+ def self.bundler_major_version
+ @bundler_major_version ||= VERSION.split(".").first.to_i
+ end
end
diff --git a/lib/bundler/version_ranges.rb b/lib/bundler/version_ranges.rb
index 1ee8440edd..ec25716cde 100644
--- a/lib/bundler/version_ranges.rb
+++ b/lib/bundler/version_ranges.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Bundler
module VersionRanges
NEq = Struct.new(:version)
diff --git a/lib/bundler/vlad.rb b/lib/bundler/vlad.rb
index db78f84baa..68181e7db8 100644
--- a/lib/bundler/vlad.rb
+++ b/lib/bundler/vlad.rb
@@ -1,4 +1,9 @@
# frozen_string_literal: true
+
+require "bundler/shared_helpers"
+Bundler::SharedHelpers.major_deprecation 2,
+ "The Bundler task for Vlad"
+
# Vlad task for Bundler.
#
# Add "require 'bundler/vlad'" in your Vlad deploy.rb, and
diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb
index b73a7ed04a..e91cfa7805 100644
--- a/lib/bundler/worker.rb
+++ b/lib/bundler/worker.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "thread"
module Bundler
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb
index 3c9eccafc2..0fd81c40ef 100644
--- a/lib/bundler/yaml_serializer.rb
+++ b/lib/bundler/yaml_serializer.rb
@@ -37,7 +37,7 @@ module Bundler
HASH_REGEX = /
^
([ ]*) # indentations
- (.*) # key
+ (.+) # key
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
[ ]?
(?: !\s)? # optional exclamation mark found with ruby 1.9.3
@@ -54,10 +54,10 @@ module Bundler
last_empty_key = nil
str.split(/\r?\n/).each do |line|
if match = HASH_REGEX.match(line)
- indent, key, _, val = match.captures
+ indent, key, quote, val = match.captures
key = convert_to_backward_compatible_key(key)
depth = indent.scan(/ /).length
- if val.empty?
+ if quote.empty? && val.empty?
new_hash = {}
stack[depth][key] = new_hash
stack[depth + 1] = new_hash
diff --git a/spec/bundler/bundler/bundler_spec.rb b/spec/bundler/bundler/bundler_spec.rb
index 268c0d99ac..19e3f0336f 100644
--- a/spec/bundler/bundler/bundler_spec.rb
+++ b/spec/bundler/bundler/bundler_spec.rb
@@ -1,6 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler"
RSpec.describe Bundler do
@@ -102,11 +102,29 @@ RSpec.describe Bundler do
subject
end
end
+
+ context "with gemspec containing local variables" do
+ before do
+ File.open(app_gemspec_path, "wb") do |f|
+ f.write strip_whitespace(<<-GEMSPEC)
+ must_not_leak = true
+ Gem::Specification.new do |gem|
+ gem.name = "leak check"
+ end
+ GEMSPEC
+ end
+ end
+
+ it "should not pollute the TOPLEVEL_BINDING" do
+ subject
+ expect(TOPLEVEL_BINDING.eval("local_variables")).to_not include(:must_not_leak)
+ end
+ end
end
describe "#which" do
let(:executable) { "executable" }
- let(:path) { %w(/a /b c ../d /e) }
+ let(:path) { %w[/a /b c ../d /e] }
let(:expected) { "executable" }
before do
@@ -145,8 +163,8 @@ RSpec.describe Bundler do
context "disable_shared_gems" do
it "should unset GEM_PATH with empty string" do
env = {}
- settings = { :disable_shared_gems => true }
- Bundler.send(:configure_gem_path, env, settings)
+ expect(Bundler).to receive(:use_system_gems?).and_return(false)
+ Bundler.send(:configure_gem_path, env)
expect(env.keys).to include("GEM_PATH")
expect(env["GEM_PATH"]).to eq ""
end
@@ -158,7 +176,7 @@ RSpec.describe Bundler do
let(:bundler_ui) { Bundler.ui }
it "should raise a friendly error" do
allow(File).to receive(:exist?).and_return(true)
- allow(FileUtils).to receive(:remove_entry_secure).and_raise(ArgumentError)
+ allow(bundler_fileutils).to receive(:remove_entry_secure).and_raise(ArgumentError)
allow(File).to receive(:world_writable?).and_return(true)
message = <<EOF
It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb
index d41e6de4a7..ace4e8a625 100644
--- a/spec/bundler/bundler/cli_spec.rb
+++ b/spec/bundler/bundler/cli_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/cli"
RSpec.describe "bundle executable" do
@@ -27,6 +27,18 @@ RSpec.describe "bundle executable" do
expect(out).to eq("Hello, world")
end
+ context "with no arguments" do
+ it "prints a concise help message", :bundler => "2" do
+ bundle! ""
+ expect(last_command.stderr).to be_empty
+ expect(last_command.stdout).to include("Bundler version #{Bundler::VERSION}").
+ and include("\n\nBundler commands:\n\n").
+ and include("\n\n Primary commands:\n").
+ and include("\n\n Utilities:\n").
+ and include("\n\nOptions:\n")
+ end
+ end
+
context "when ENV['BUNDLE_GEMFILE'] is set to an empty string" do
it "ignores it" do
gemfile bundled_app("Gemfile"), <<-G
@@ -60,12 +72,17 @@ RSpec.describe "bundle executable" do
it "prints the running command" do
gemfile ""
bundle! "info bundler", :verbose => true
- expect(out).to start_with("Running `bundle info bundler --no-color --verbose` with bundler #{Bundler::VERSION}")
+ expect(last_command.stdout).to start_with("Running `bundle info bundler --no-color --verbose` with bundler #{Bundler::VERSION}")
+ end
+
+ it "doesn't print defaults" do
+ install_gemfile! "", :verbose => true
+ expect(last_command.stdout).to start_with("Running `bundle install --no-color --retry 0 --verbose` with bundler #{Bundler::VERSION}")
end
it "doesn't print defaults" do
install_gemfile! "", :verbose => true
- expect(out).to start_with("Running `bundle install --no-color --retry 0 --verbose` with bundler #{Bundler::VERSION}")
+ expect(last_command.stdout).to start_with("Running `bundle install --no-color --retry 0 --verbose` with bundler #{Bundler::VERSION}")
end
end
@@ -73,13 +90,15 @@ RSpec.describe "bundle executable" do
shared_examples_for "no warning" do
it "prints no warning" do
bundle "fail"
- expect(err + out).to eq("Could not find command \"fail\".")
+ expect(last_command.stdboth).to eq("Could not find command \"fail\".")
end
end
let(:bundler_version) { "1.1" }
let(:latest_version) { nil }
before do
+ bundle! "config --global disable_version_check false"
+
simulate_bundler_version(bundler_version)
if latest_version
info_path = home(".bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/info/bundler")
@@ -103,13 +122,12 @@ RSpec.describe "bundle executable" do
end
context "when the latest version is greater than the current version" do
- let(:latest_version) { "2.0" }
+ let(:latest_version) { "222.0" }
it "prints the version warning" do
bundle "fail"
- expect(err + out).to eq(<<-EOS.strip)
+ expect(last_command.stdout).to start_with(<<-EOS.strip)
The latest bundler is #{latest_version}, but you are currently running #{bundler_version}.
-To update, run `gem install bundler`
-Could not find command "fail".
+To install the latest version, run `gem install bundler`
EOS
end
@@ -121,21 +139,20 @@ Could not find command "fail".
context "running a parseable command" do
it "prints no warning" do
bundle! "config --parseable foo"
- expect(out).to eq ""
+ expect(last_command.stdboth).to eq ""
bundle "platform --ruby"
- expect(out).to eq "Could not locate Gemfile"
+ expect(last_command.stdboth).to eq "Could not locate Gemfile"
end
end
context "and is a pre-release" do
- let(:latest_version) { "2.0.0.pre.4" }
+ let(:latest_version) { "222.0.0.pre.4" }
it "prints the version warning" do
bundle "fail"
- expect(err + out).to eq(<<-EOS.strip)
+ expect(last_command.stdout).to start_with(<<-EOS.strip)
The latest bundler is #{latest_version}, but you are currently running #{bundler_version}.
-To update, run `gem install bundler --pre`
-Could not find command "fail".
+To install the latest version, run `gem install bundler --pre`
EOS
end
end
@@ -144,8 +161,13 @@ Could not find command "fail".
end
RSpec.describe "bundler executable" do
- it "shows the bundler version just as the `bundle` executable does" do
+ it "shows the bundler version just as the `bundle` executable does", :bundler => "< 2" do
bundler "--version"
expect(out).to eq("Bundler version #{Bundler::VERSION}")
end
+
+ it "shows the bundler version just as the `bundle` executable does", :bundler => "2" do
+ bundler "--version"
+ expect(out).to eq(Bundler::VERSION)
+ end
end
diff --git a/spec/bundler/bundler/compact_index_client/updater_spec.rb b/spec/bundler/bundler/compact_index_client/updater_spec.rb
index c1cae31956..3c4f212b60 100644
--- a/spec/bundler/bundler/compact_index_client/updater_spec.rb
+++ b/spec/bundler/bundler/compact_index_client/updater_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "net/http"
require "bundler/compact_index_client"
require "bundler/compact_index_client/updater"
diff --git a/spec/bundler/bundler/definition_spec.rb b/spec/bundler/bundler/definition_spec.rb
index 73d44a93ab..5abf0d9756 100644
--- a/spec/bundler/bundler/definition_spec.rb
+++ b/spec/bundler/bundler/definition_spec.rb
@@ -1,12 +1,12 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/definition"
RSpec.describe Bundler::Definition do
describe "#lock" do
before do
allow(Bundler).to receive(:settings) { Bundler::Settings.new(".") }
- allow(Bundler).to receive(:default_gemfile) { Pathname.new("Gemfile") }
+ allow(Bundler::SharedHelpers).to receive(:find_gemfile) { Pathname.new("Gemfile") }
allow(Bundler).to receive(:ui) { double("UI", :info => "", :debug => "") }
end
context "when it's not possible to write to the file" do
@@ -32,7 +32,7 @@ RSpec.describe Bundler::Definition do
end
describe "detects changes" do
- it "for a path gem with changes" do
+ it "for a path gem with changes", :bundler => "< 2" do
build_lib "foo", "1.0", :path => lib_path("foo")
install_gemfile <<-G
@@ -70,7 +70,45 @@ RSpec.describe Bundler::Definition do
G
end
- it "for a path gem with deps and no changes" do
+ it "for a path gem with changes", :bundler => "2" do
+ build_lib "foo", "1.0", :path => lib_path("foo")
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "foo", :path => "#{lib_path("foo")}"
+ G
+
+ build_lib "foo", "1.0", :path => lib_path("foo") do |s|
+ s.add_dependency "rack", "1.0"
+ end
+
+ bundle :install, :env => { "DEBUG" => 1 }
+
+ expect(out).to match(/re-resolving dependencies/)
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PATH
+ remote: #{lib_path("foo")}
+ specs:
+ foo (1.0)
+ rack (= 1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "for a path gem with deps and no changes", :bundler => "< 2" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0"
@@ -107,6 +145,43 @@ RSpec.describe Bundler::Definition do
G
end
+ it "for a path gem with deps and no changes", :bundler => "2" do
+ build_lib "foo", "1.0", :path => lib_path("foo") do |s|
+ s.add_dependency "rack", "1.0"
+ s.add_development_dependency "net-ssh", "1.0"
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "foo", :path => "#{lib_path("foo")}"
+ G
+
+ bundle :check, :env => { "DEBUG" => 1 }
+
+ expect(out).to match(/using resolution from the lockfile/)
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PATH
+ remote: #{lib_path("foo")}
+ specs:
+ foo (1.0)
+ rack (= 1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
it "for a rubygems gem" do
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -123,7 +198,7 @@ RSpec.describe Bundler::Definition do
foo (1.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
foo
@@ -160,6 +235,12 @@ RSpec.describe Bundler::Definition do
end
context "eager unlock" do
+ let(:source_list) do
+ Bundler::SourceList.new.tap do |source_list|
+ source_list.global_rubygems_source = "file://#{gem_repo4}"
+ end
+ end
+
before do
gemfile <<-G
source "file://#{gem_repo4}"
@@ -203,11 +284,11 @@ RSpec.describe Bundler::Definition do
definition = Bundler::Definition.new(
bundled_app("Gemfile.lock"),
updated_deps_in_gemfile,
- Bundler::SourceList.new,
+ source_list,
unlock_hash_for_bundle_install
)
locked = definition.send(:converge_locked_specs).map(&:name)
- expect(locked.include?("shared_dep")).to be_truthy
+ expect(locked).to include "shared_dep"
end
it "should not eagerly unlock shared dependency with bundle update conservative updating behavior" do
@@ -217,11 +298,11 @@ RSpec.describe Bundler::Definition do
definition = Bundler::Definition.new(
bundled_app("Gemfile.lock"),
updated_deps_in_gemfile,
- Bundler::SourceList.new,
+ source_list,
:gems => ["shared_owner_a"], :lock_shared_dependencies => true
)
locked = definition.send(:converge_locked_specs).map(&:name)
- expect(locked).to eq %w(isolated_dep isolated_owner shared_dep shared_owner_b)
+ expect(locked).to eq %w[isolated_dep isolated_owner shared_dep shared_owner_b]
expect(locked.include?("shared_dep")).to be_truthy
end
end
@@ -242,7 +323,7 @@ RSpec.describe Bundler::Definition do
describe "find_indexed_specs" do
it "with no platform set in indexed specs" do
index = Bundler::Index.new
- %w(1.0.0 1.0.1 1.1.0).each {|v| index << build_stub_spec("foo", v) }
+ %w[1.0.0 1.0.1 1.1.0].each {|v| index << build_stub_spec("foo", v) }
dfn = Bundler::Definition.new(nil, [], mock_source_list, true)
dfn.instance_variable_set("@index", index)
diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb
index 4f5eb6dc92..f706e1b9ad 100644
--- a/spec/bundler/bundler/dsl_spec.rb
+++ b/spec/bundler/bundler/dsl_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Dsl do
before do
@@ -26,7 +25,7 @@ RSpec.describe Bundler::Dsl do
expect { subject.git_source(:example) }.to raise_error(Bundler::InvalidOption)
end
- context "default hosts (git, gist)" do
+ context "default hosts (git, gist)", :bundler => "< 2" do
it "converts :github to :git" do
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "git://github.com/indirect/sparks.git"
@@ -63,11 +62,17 @@ RSpec.describe Bundler::Dsl do
expect(subject.dependencies.first.source.uri).to eq(bitbucket_uri)
end
end
+
+ context "default git sources", :bundler => "2" do
+ it "has none" do
+ expect(subject.instance_variable_get(:@git_sources)).to eq({})
+ end
+ end
end
describe "#method_missing" do
it "raises an error for unknown DSL methods" do
- expect(Bundler).to receive(:read_file).with("Gemfile").
+ expect(Bundler).to receive(:read_file).with(bundled_app("Gemfile").to_s).
and_return("unknown")
error_msg = "There was an error parsing `Gemfile`: Undefined local variable or method `unknown' for Gemfile. Bundler cannot continue."
@@ -78,13 +83,13 @@ RSpec.describe Bundler::Dsl do
describe "#eval_gemfile" do
it "handles syntax errors with a useful message" do
- expect(Bundler).to receive(:read_file).with("Gemfile").and_return("}")
+ expect(Bundler).to receive(:read_file).with(bundled_app("Gemfile").to_s).and_return("}")
expect { subject.eval_gemfile("Gemfile") }.
to raise_error(Bundler::GemfileError, /There was an error parsing `Gemfile`: (syntax error, unexpected tSTRING_DEND|(compile error - )?syntax error, unexpected '\}'). Bundler cannot continue./)
end
it "distinguishes syntax errors from evaluation errors" do
- expect(Bundler).to receive(:read_file).with("Gemfile").and_return(
+ expect(Bundler).to receive(:read_file).with(bundled_app("Gemfile").to_s).and_return(
"ruby '2.1.5', :engine => 'ruby', :engine_version => '1.2.4'"
)
expect { subject.eval_gemfile("Gemfile") }.
@@ -105,6 +110,11 @@ RSpec.describe Bundler::Dsl do
to raise_error(Bundler::GemfileError, /is not a valid platform/)
end
+ it "rejects empty gem name" do
+ expect { subject.gem("") }.
+ to raise_error(Bundler::GemfileError, /an empty gem name is not valid/)
+ end
+
it "rejects with a leading space in the name" do
expect { subject.gem(" foo") }.
to raise_error(Bundler::GemfileError, /' foo' is not a valid gem name because it contains whitespace/)
@@ -150,13 +160,13 @@ RSpec.describe Bundler::Dsl do
to raise_error(Bundler::GemfileError, /The `branch` option for `gem 'foo'` is not allowed. Only gems with a git source can specify a branch/)
end
- it "allows specifiying a branch on git gems" do
+ it "allows specifying a branch on git gems" do
subject.gem("foo", :branch => "test", :git => "http://mytestrepo")
dep = subject.dependencies.last
expect(dep.name).to eq "foo"
end
- it "allows specifiying a branch on git gems with a git_source" do
+ it "allows specifying a branch on git gems with a git_source" do
subject.git_source(:test_source) {|n| "https://github.com/#{n}" }
subject.gem("foo", :branch => "test", :test_source => "bundler/bundler")
dep = subject.dependencies.last
@@ -206,7 +216,7 @@ RSpec.describe Bundler::Dsl do
# end
describe "#git" do
it "from a single repo" do
- rails_gems = %w(railties action_pack active_model)
+ rails_gems = %w[railties action_pack active_model]
subject.git "https://github.com/rails/rails.git" do
rails_gems.each {|rails_gem| subject.send :gem, rails_gem }
end
@@ -219,9 +229,9 @@ RSpec.describe Bundler::Dsl do
# gem 'spree_api'
# gem 'spree_backend'
# end
- describe "#github" do
+ describe "#github", :bundler => "< 2" do
it "from github" do
- spree_gems = %w(spree_core spree_api spree_backend)
+ spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do
spree_gems.each {|spree_gem| subject.send :gem, spree_gem }
end
@@ -231,6 +241,17 @@ RSpec.describe Bundler::Dsl do
end
end
end
+
+ describe "#github", :bundler => "2" do
+ it "from github" do
+ expect do
+ spree_gems = %w[spree_core spree_api spree_backend]
+ subject.github "spree" do
+ spree_gems.each {|spree_gem| subject.send :gem, spree_gem }
+ end
+ end.to raise_error(Bundler::DeprecatedError, /github method has been removed/)
+ end
+ end
end
describe "syntax errors" do
diff --git a/spec/bundler/bundler/endpoint_specification_spec.rb b/spec/bundler/bundler/endpoint_specification_spec.rb
index 0b8da840d2..a9371f6617 100644
--- a/spec/bundler/bundler/endpoint_specification_spec.rb
+++ b/spec/bundler/bundler/endpoint_specification_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::EndpointSpecification do
let(:name) { "foo" }
@@ -8,7 +7,7 @@ RSpec.describe Bundler::EndpointSpecification do
let(:dependencies) { [] }
let(:metadata) { nil }
- subject { described_class.new(name, version, platform, dependencies, metadata) }
+ subject(:spec) { described_class.new(name, version, platform, dependencies, metadata) }
describe "#build_dependency" do
let(:name) { "foo" }
@@ -63,4 +62,10 @@ RSpec.describe Bundler::EndpointSpecification do
end
end
end
+
+ it "supports equality comparison" do
+ other_spec = described_class.new("bar", version, platform, dependencies, metadata)
+ expect(spec).to eql(spec)
+ expect(spec).to_not eql(other_spec)
+ end
end
diff --git a/spec/bundler/bundler/env_spec.rb b/spec/bundler/bundler/env_spec.rb
index 269c323ac6..83c03e67d5 100644
--- a/spec/bundler/bundler/env_spec.rb
+++ b/spec/bundler/bundler/env_spec.rb
@@ -1,20 +1,19 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/settings"
RSpec.describe Bundler::Env do
- let(:env) { described_class.new }
let(:git_proxy_stub) { Bundler::Source::Git::GitProxy.new(nil, nil, nil) }
describe "#report" do
it "prints the environment" do
- out = env.report
+ out = described_class.report
expect(out).to include("Environment")
expect(out).to include(Bundler::VERSION)
expect(out).to include(Gem::VERSION)
- expect(out).to include(env.send(:ruby_version))
- expect(out).to include(env.send(:git_version))
+ expect(out).to include(described_class.send(:ruby_version))
+ expect(out).to include(described_class.send(:git_version))
expect(out).to include(OpenSSL::OPENSSL_VERSION)
end
@@ -36,7 +35,7 @@ RSpec.describe Bundler::Env do
L
end
- let(:output) { env.report(:print_gemfile => true) }
+ let(:output) { described_class.report(:print_gemfile => true) }
it "prints the Gemfile" do
expect(output).to include("Gemfile")
@@ -50,7 +49,7 @@ RSpec.describe Bundler::Env do
end
context "when there no Gemfile and print_gemfile is true" do
- let(:output) { env.report(:print_gemfile => true) }
+ let(:output) { described_class.report(:print_gemfile => true) }
it "prints the environment" do
expect(output).to start_with("## Environment")
@@ -76,20 +75,68 @@ RSpec.describe Bundler::Env do
end
it "prints the gemspec" do
- output = env.report(:print_gemspecs => true)
+ output = described_class.report(:print_gemspecs => true)
expect(output).to include("foo.gemspec")
expect(output).to include(gemspec)
end
end
+ context "when eval_gemfile is used" do
+ it "prints all gemfiles" do
+ create_file "other/Gemfile-other", "gem 'rack'"
+ create_file "other/Gemfile", "eval_gemfile 'Gemfile-other'"
+ create_file "Gemfile-alt", <<-G
+ source "file:#{gem_repo1}"
+ eval_gemfile "other/Gemfile"
+ G
+ gemfile "eval_gemfile #{File.expand_path("Gemfile-alt").dump}"
+
+ output = described_class.report(:print_gemspecs => true)
+ expect(output).to include(strip_whitespace(<<-ENV))
+ ## Gemfile
+
+ ### Gemfile
+
+ ```ruby
+ eval_gemfile #{File.expand_path("Gemfile-alt").dump}
+ ```
+
+ ### Gemfile-alt
+
+ ```ruby
+ source "file:#{gem_repo1}"
+ eval_gemfile "other/Gemfile"
+ ```
+
+ ### other/Gemfile
+
+ ```ruby
+ eval_gemfile 'Gemfile-other'
+ ```
+
+ ### other/Gemfile-other
+
+ ```ruby
+ gem 'rack'
+ ```
+
+ ### Gemfile.lock
+
+ ```
+ <No #{bundled_app("Gemfile.lock")} found>
+ ```
+ ENV
+ end
+ end
+
context "when the git version is OS specific" do
it "includes OS specific information with the version number" do
expect(git_proxy_stub).to receive(:git).with("--version").
and_return("git version 1.2.3 (Apple Git-BS)")
expect(Bundler::Source::Git::GitProxy).to receive(:new).and_return(git_proxy_stub)
- expect(env.report).to include("Git 1.2.3 (Apple Git-BS)")
+ expect(described_class.report).to include("Git 1.2.3 (Apple Git-BS)")
end
end
end
diff --git a/spec/bundler/bundler/environment_preserver_spec.rb b/spec/bundler/bundler/environment_preserver_spec.rb
index 41d2650055..530ca6f835 100644
--- a/spec/bundler/bundler/environment_preserver_spec.rb
+++ b/spec/bundler/bundler/environment_preserver_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::EnvironmentPreserver do
let(:preserver) { described_class.new(env, ["foo"]) }
@@ -22,14 +21,14 @@ RSpec.describe Bundler::EnvironmentPreserver do
it "should not affect the original env" do
subject
- expect(env.keys.sort).to eq(%w(bar foo))
+ expect(env.keys.sort).to eq(%w[bar foo])
end
context "when a key is empty" do
let(:env) { { "foo" => "" } }
it "should not create backup entries" do
- expect(subject.key?("BUNDLER_ORIG_foo")).to eq(false)
+ expect(subject).not_to have_key "BUNDLER_ORIG_foo"
end
end
diff --git a/spec/bundler/bundler/fetcher/base_spec.rb b/spec/bundler/bundler/fetcher/base_spec.rb
index 38b69429bc..df1245d44d 100644
--- a/spec/bundler/bundler/fetcher/base_spec.rb
+++ b/spec/bundler/bundler/fetcher/base_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Fetcher::Base do
let(:downloader) { double(:downloader) }
diff --git a/spec/bundler/bundler/fetcher/compact_index_spec.rb b/spec/bundler/bundler/fetcher/compact_index_spec.rb
index e653c1ea43..e0f58766ea 100644
--- a/spec/bundler/bundler/fetcher/compact_index_spec.rb
+++ b/spec/bundler/bundler/fetcher/compact_index_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Fetcher::CompactIndex do
let(:downloader) { double(:downloader) }
@@ -46,7 +45,17 @@ RSpec.describe Bundler::Fetcher::CompactIndex do
end
context "when OpenSSL is FIPS-enabled", :ruby => ">= 2.0.0" do
- before { stub_const("OpenSSL::OPENSSL_FIPS", true) }
+ def remove_cached_md5_availability
+ return unless Bundler::SharedHelpers.instance_variable_defined?(:@md5_available)
+ Bundler::SharedHelpers.remove_instance_variable(:@md5_available)
+ end
+
+ before do
+ remove_cached_md5_availability
+ stub_const("OpenSSL::OPENSSL_FIPS", true)
+ end
+
+ after { remove_cached_md5_availability }
context "when FIPS-mode is active" do
before do
diff --git a/spec/bundler/bundler/fetcher/dependency_spec.rb b/spec/bundler/bundler/fetcher/dependency_spec.rb
index 134ca1bc57..081fdff34d 100644
--- a/spec/bundler/bundler/fetcher/dependency_spec.rb
+++ b/spec/bundler/bundler/fetcher/dependency_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Fetcher::Dependency do
let(:downloader) { double(:downloader) }
@@ -64,7 +63,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
end
describe "#specs" do
- let(:gem_names) { %w(foo bar) }
+ let(:gem_names) { %w[foo bar] }
let(:full_dependency_list) { ["bar"] }
let(:last_spec_list) { [["boulder", gem_version1, "ruby", resque]] }
let(:fail_errors) { double(:fail_errors) }
@@ -103,7 +102,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
context "when all given gem names are in the full dependency list" do
let(:gem_names) { ["foo"] }
- let(:full_dependency_list) { %w(foo bar) }
+ let(:full_dependency_list) { %w[foo bar] }
let(:last_spec_list) { ["boulder"] }
it "should return a hash with the remote_uri and the last spec list" do
@@ -190,7 +189,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
end
describe "#dependency_specs" do
- let(:gem_names) { [%w(foo bar), %w(bundler rubocop)] }
+ let(:gem_names) { [%w[foo bar], %w[bundler rubocop]] }
let(:gem_list) { double(:gem_list) }
let(:formatted_specs_and_deps) { double(:formatted_specs_and_deps) }
@@ -212,7 +211,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
end
describe "#unmarshalled_dep_gems" do
- let(:gem_names) { [%w(foo bar), %w(bundler rubocop)] }
+ let(:gem_names) { [%w[foo bar], %w[bundler rubocop]] }
let(:dep_api_uri) { double(:dep_api_uri) }
let(:unmarshalled_gems) { double(:unmarshalled_gems) }
let(:fetch_response) { double(:fetch_response, :body => double(:body)) }
@@ -220,7 +219,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
before { allow(subject).to receive(:dependency_api_uri).with(gem_names).and_return(dep_api_uri) }
- it "should fetch dependencies from Rubygems and unmarshal them" do
+ it "should fetch dependencies from RubyGems and unmarshal them" do
expect(gem_names).to receive(:each_slice).with(rubygems_limit).and_call_original
expect(downloader).to receive(:fetch).with(dep_api_uri).and_return(fetch_response)
expect(Bundler).to receive(:load_marshal).with(fetch_response.body).and_return([unmarshalled_gems])
@@ -254,7 +253,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
spec_list, deps_list = subject.get_formatted_specs_and_deps(gem_list)
expect(spec_list).to eq([["typhoeus", "1.0.1", "ruby", [["resque", ["req3,req4"]]]],
["grape", "2.0.2", "jruby", [["faraday", ["req1,req2"]]]]])
- expect(deps_list).to eq(%w(resque faraday))
+ expect(deps_list).to eq(%w[resque faraday])
end
end
@@ -262,7 +261,7 @@ RSpec.describe Bundler::Fetcher::Dependency do
let(:uri) { URI("http://gem-api.com") }
context "with gem names" do
- let(:gem_names) { %w(foo bar bundler rubocop) }
+ let(:gem_names) { %w[foo bar bundler rubocop] }
before { allow(subject).to receive(:fetch_uri).and_return(uri) }
diff --git a/spec/bundler/bundler/fetcher/downloader_spec.rb b/spec/bundler/bundler/fetcher/downloader_spec.rb
index 4dcd94b1b2..c9b4fa662a 100644
--- a/spec/bundler/bundler/fetcher/downloader_spec.rb
+++ b/spec/bundler/bundler/fetcher/downloader_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Fetcher::Downloader do
let(:connection) { double(:connection) }
diff --git a/spec/bundler/bundler/fetcher/index_spec.rb b/spec/bundler/bundler/fetcher/index_spec.rb
index b17e0d1727..0cf0ae764e 100644
--- a/spec/bundler/bundler/fetcher/index_spec.rb
+++ b/spec/bundler/bundler/fetcher/index_spec.rb
@@ -1,12 +1,11 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Fetcher::Index do
let(:downloader) { nil }
let(:remote) { nil }
let(:display_uri) { "http://sample_uri.com" }
let(:rubygems) { double(:rubygems) }
- let(:gem_names) { %w(foo bar) }
+ let(:gem_names) { %w[foo bar] }
subject { described_class.new(downloader, remote, display_uri) }
diff --git a/spec/bundler/bundler/fetcher_spec.rb b/spec/bundler/bundler/fetcher_spec.rb
index 585768343f..f9e52e09c0 100644
--- a/spec/bundler/bundler/fetcher_spec.rb
+++ b/spec/bundler/bundler/fetcher_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/fetcher"
RSpec.describe Bundler::Fetcher do
@@ -85,11 +85,52 @@ RSpec.describe Bundler::Fetcher do
end
end
end
+
+ context "when no ssl configuration is set" do
+ it "no cert" do
+ expect(fetcher.send(:connection).cert).to be_nil
+ expect(fetcher.send(:connection).key).to be_nil
+ end
+ end
+
+ context "when bunder ssl ssl configuration is set" do
+ before do
+ allow(Bundler.settings).to receive(:[]).and_return(nil)
+ allow(Bundler.settings).to receive(:[]).with(:ssl_client_cert).and_return("/cert")
+ expect(File).to receive(:read).with("/cert").and_return("")
+ expect(OpenSSL::X509::Certificate).to receive(:new).and_return("cert")
+ expect(OpenSSL::PKey::RSA).to receive(:new).and_return("key")
+ end
+ it "use bundler configuration" do
+ expect(fetcher.send(:connection).cert).to eq("cert")
+ expect(fetcher.send(:connection).key).to eq("key")
+ end
+ end
+
+ context "when gem ssl configuration is set" do
+ before do
+ allow(Bundler.rubygems.configuration).to receive_messages(
+ :http_proxy => nil,
+ :ssl_client_cert => "cert",
+ :ssl_ca_cert => "ca"
+ )
+ expect(File).to receive(:read).and_return("")
+ expect(OpenSSL::X509::Certificate).to receive(:new).and_return("cert")
+ expect(OpenSSL::PKey::RSA).to receive(:new).and_return("key")
+ store = double("ca store")
+ expect(store).to receive(:add_file)
+ expect(OpenSSL::X509::Store).to receive(:new).and_return(store)
+ end
+ it "use gem configuration" do
+ expect(fetcher.send(:connection).cert).to eq("cert")
+ expect(fetcher.send(:connection).key).to eq("key")
+ end
+ end
end
describe "#user_agent" do
it "builds user_agent with current ruby version and Bundler settings" do
- allow(Bundler.settings).to receive(:all).and_return(%w(foo bar))
+ allow(Bundler.settings).to receive(:all).and_return(%w[foo bar])
expect(fetcher.user_agent).to match(%r{bundler/(\d.)})
expect(fetcher.user_agent).to match(%r{rubygems/(\d.)})
expect(fetcher.user_agent).to match(%r{ruby/(\d.)})
diff --git a/spec/bundler/bundler/friendly_errors_spec.rb b/spec/bundler/bundler/friendly_errors_spec.rb
index 19799d5495..2a1be491ef 100644
--- a/spec/bundler/bundler/friendly_errors_spec.rb
+++ b/spec/bundler/bundler/friendly_errors_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler"
require "bundler/friendly_errors"
require "cgi"
@@ -39,7 +39,7 @@ RSpec.describe Bundler, "friendly errors" do
bundle :install, :env => { "DEBUG" => true }
- expect(err).to include("Failed to load #{home(".gemrc")}")
+ expect(last_command.stderr).to include("Failed to load #{home(".gemrc")}")
expect(exitstatus).to eq(0) if exitstatus
end
end
diff --git a/spec/bundler/bundler/gem_helper_spec.rb b/spec/bundler/bundler/gem_helper_spec.rb
index 498ed89447..c36204c542 100644
--- a/spec/bundler/bundler/gem_helper_spec.rb
+++ b/spec/bundler/bundler/gem_helper_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "rake"
require "bundler/gem_helper"
@@ -105,8 +105,8 @@ RSpec.describe Bundler::GemHelper do
context "defines Rake tasks" do
let(:task_names) do
- %w(build install release release:guard_clean
- release:source_control_push release:rubygem_push)
+ %w[build install release release:guard_clean
+ release:source_control_push release:rubygem_push]
end
context "before installation" do
@@ -256,5 +256,95 @@ RSpec.describe Bundler::GemHelper do
end
end
end
+
+ describe "release:rubygem_push" do
+ let!(:rake_application) { Rake.application }
+
+ before(:each) do
+ Rake.application = Rake::Application.new
+ subject.install
+ allow(subject).to receive(:sh)
+ end
+
+ after(:each) do
+ Rake.application = rake_application
+ end
+
+ before do
+ Dir.chdir(app_path) do
+ `git init`
+ `git config user.email "you@example.com"`
+ `git config user.name "name"`
+ `git config push.default simple`
+ end
+
+ # silence messages
+ allow(Bundler.ui).to receive(:confirm)
+ allow(Bundler.ui).to receive(:error)
+
+ credentials = double("credentials", "file?" => true)
+ allow(Bundler.user_home).to receive(:join).
+ with(".gem/credentials").and_return(credentials)
+ end
+
+ describe "success messaging" do
+ context "No allowed_push_host set" do
+ before do
+ allow(subject).to receive(:allowed_push_host).and_return(nil)
+ end
+
+ around do |example|
+ orig_host = ENV["RUBYGEMS_HOST"]
+ ENV["RUBYGEMS_HOST"] = rubygems_host_env
+
+ example.run
+
+ ENV["RUBYGEMS_HOST"] = orig_host
+ end
+
+ context "RUBYGEMS_HOST env var is set" do
+ let(:rubygems_host_env) { "https://custom.env.gemhost.com" }
+
+ it "should report successful push to the host from the environment" do
+ mock_confirm_message "Pushed #{app_name} #{app_version} to #{rubygems_host_env}"
+
+ Rake.application["release:rubygem_push"].invoke
+ end
+ end
+
+ context "RUBYGEMS_HOST env var is not set" do
+ let(:rubygems_host_env) { nil }
+
+ it "should report successful push to rubygems.org" do
+ mock_confirm_message "Pushed #{app_name} #{app_version} to rubygems.org"
+
+ Rake.application["release:rubygem_push"].invoke
+ end
+ end
+
+ context "RUBYGEMS_HOST env var is an empty string" do
+ let(:rubygems_host_env) { "" }
+
+ it "should report successful push to rubygems.org" do
+ mock_confirm_message "Pushed #{app_name} #{app_version} to rubygems.org"
+
+ Rake.application["release:rubygem_push"].invoke
+ end
+ end
+ end
+
+ context "allowed_push_host set in gemspec" do
+ before do
+ allow(subject).to receive(:allowed_push_host).and_return("https://my.gemhost.com")
+ end
+
+ it "should report successful push to the allowed gem host" do
+ mock_confirm_message "Pushed #{app_name} #{app_version} to https://my.gemhost.com"
+
+ Rake.application["release:rubygem_push"].invoke
+ end
+ end
+ end
+ end
end
end
diff --git a/spec/bundler/bundler/gem_version_promoter_spec.rb b/spec/bundler/bundler/gem_version_promoter_spec.rb
index c7620e2620..01e0232fba 100644
--- a/spec/bundler/bundler/gem_version_promoter_spec.rb
+++ b/spec/bundler/bundler/gem_version_promoter_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::GemVersionPromoter do
context "conservative resolver" do
@@ -27,13 +26,15 @@ RSpec.describe Bundler::GemVersionPromoter do
end
end
- def build_spec_group(name, version)
- Bundler::Resolver::SpecGroup.new(build_spec(name, version))
+ def build_spec_groups(name, versions)
+ versions.map do |v|
+ Bundler::Resolver::SpecGroup.new(build_spec(name, v))
+ end
end
# Rightmost (highest array index) in result is most preferred.
# Leftmost (lowest array index) in result is least preferred.
- # `build_spec_group` has all version of gem in index.
+ # `build_spec_groups` has all versions of gem in index.
# `build_spec` is the version currently in the .lock file.
#
# In default (not strict) mode, all versions in the index will
@@ -44,28 +45,28 @@ RSpec.describe Bundler::GemVersionPromoter do
it "when keeping build_spec, keep current, next release" do
keep_locked(:level => :patch)
res = @gvp.filter_dep_specs(
- build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)),
+ build_spec_groups("foo", %w[1.7.8 1.7.9 1.8.0]),
build_spec("foo", "1.7.8").first
)
- expect(versions(res)).to eq %w(1.7.9 1.7.8)
+ expect(versions(res)).to eq %w[1.7.9 1.7.8]
end
it "when unlocking prefer next release first" do
unlocking(:level => :patch)
res = @gvp.filter_dep_specs(
- build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)),
+ build_spec_groups("foo", %w[1.7.8 1.7.9 1.8.0]),
build_spec("foo", "1.7.8").first
)
- expect(versions(res)).to eq %w(1.7.8 1.7.9)
+ expect(versions(res)).to eq %w[1.7.8 1.7.9]
end
it "when unlocking keep current when already at latest release" do
unlocking(:level => :patch)
res = @gvp.filter_dep_specs(
- build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)),
+ build_spec_groups("foo", %w[1.7.9 1.8.0 2.0.0]),
build_spec("foo", "1.7.9").first
)
- expect(versions(res)).to eq %w(1.7.9)
+ expect(versions(res)).to eq %w[1.7.9]
end
end
@@ -73,19 +74,19 @@ RSpec.describe Bundler::GemVersionPromoter do
it "when unlocking favor next releases, remove minor and major increases" do
unlocking(:level => :minor)
res = @gvp.filter_dep_specs(
- build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
+ build_spec_groups("foo", %w[0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1]),
build_spec("foo", "0.2.0").first
)
- expect(versions(res)).to eq %w(0.2.0 0.3.0 0.3.1 0.9.0)
+ expect(versions(res)).to eq %w[0.2.0 0.3.0 0.3.1 0.9.0]
end
it "when keep locked, keep current, then favor next release, remove minor and major increases" do
keep_locked(:level => :minor)
res = @gvp.filter_dep_specs(
- build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
+ build_spec_groups("foo", %w[0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1]),
build_spec("foo", "0.2.0").first
)
- expect(versions(res)).to eq %w(0.3.0 0.3.1 0.9.0 0.2.0)
+ expect(versions(res)).to eq %w[0.3.0 0.3.1 0.9.0 0.2.0]
end
end
@@ -93,37 +94,37 @@ RSpec.describe Bundler::GemVersionPromoter do
it "when not unlocking, same order but make sure build_spec version is most preferred to stay put" do
keep_locked(:level => :patch)
res = @gvp.sort_dep_specs(
- build_spec_group("foo", %w(1.5.4 1.6.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 2.0.0 2.0.1)),
+ build_spec_groups("foo", %w[1.5.4 1.6.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 2.0.0 2.0.1]),
build_spec("foo", "1.7.7").first
)
- expect(versions(res)).to eq %w(1.5.4 1.6.5 1.7.6 2.0.0 2.0.1 1.8.0 1.8.1 1.7.8 1.7.9 1.7.7)
+ expect(versions(res)).to eq %w[1.5.4 1.6.5 1.7.6 2.0.0 2.0.1 1.8.0 1.8.1 1.7.8 1.7.9 1.7.7]
end
it "when unlocking favor next release, then current over minor increase" do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
- build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.8.0)),
+ build_spec_groups("foo", %w[1.7.7 1.7.8 1.7.9 1.8.0]),
build_spec("foo", "1.7.8").first
)
- expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9)
+ expect(versions(res)).to eq %w[1.7.7 1.8.0 1.7.8 1.7.9]
end
it "when unlocking do proper integer comparison, not string" do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
- build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.7.15 1.8.0)),
+ build_spec_groups("foo", %w[1.7.7 1.7.8 1.7.9 1.7.15 1.8.0]),
build_spec("foo", "1.7.8").first
)
- expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9 1.7.15)
+ expect(versions(res)).to eq %w[1.7.7 1.8.0 1.7.8 1.7.9 1.7.15]
end
it "leave current when unlocking but already at latest release" do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
- build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)),
+ build_spec_groups("foo", %w[1.7.9 1.8.0 2.0.0]),
build_spec("foo", "1.7.9").first
)
- expect(versions(res)).to eq %w(2.0.0 1.8.0 1.7.9)
+ expect(versions(res)).to eq %w[2.0.0 1.8.0 1.7.9]
end
end
@@ -131,10 +132,10 @@ RSpec.describe Bundler::GemVersionPromoter do
it "when unlocking favor next release, then minor increase over current" do
unlocking(:level => :minor)
res = @gvp.sort_dep_specs(
- build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
+ build_spec_groups("foo", %w[0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1]),
build_spec("foo", "0.2.0").first
)
- expect(versions(res)).to eq %w(2.0.0 2.0.1 1.0.0 0.2.0 0.3.0 0.3.1 0.9.0)
+ expect(versions(res)).to eq %w[2.0.0 2.0.1 1.0.0 0.2.0 0.3.0 0.3.1 0.9.0]
end
end
@@ -159,7 +160,7 @@ RSpec.describe Bundler::GemVersionPromoter do
end
it "should accept major, minor patch strings" do
- %w(major minor patch).each do |value|
+ %w[major minor patch].each do |value|
subject.level = value
expect(subject.level).to eq value.to_sym
end
@@ -170,8 +171,7 @@ RSpec.describe Bundler::GemVersionPromoter do
it "should not kerblooie on its own debug output" do
gvp = unlocking(:level => :patch)
dep = Bundler::DepProxy.new(dep("foo", "1.2.0").first, "ruby")
- result = gvp.send(:debug_format_result, dep, [build_spec_group("foo", "1.2.0"),
- build_spec_group("foo", "1.3.0")])
+ result = gvp.send(:debug_format_result, dep, build_spec_groups("foo", %w[1.2.0 1.3.0]))
expect(result.class).to eq Array
end
end
diff --git a/spec/bundler/bundler/index_spec.rb b/spec/bundler/bundler/index_spec.rb
index 09b09e08fa..0f3f6e4944 100644
--- a/spec/bundler/bundler/index_spec.rb
+++ b/spec/bundler/bundler/index_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Index do
let(:specs) { [] }
diff --git a/spec/bundler/bundler/installer/gem_installer_spec.rb b/spec/bundler/bundler/installer/gem_installer_spec.rb
index e2f30cdd70..7340a3acc0 100644
--- a/spec/bundler/bundler/installer/gem_installer_spec.rb
+++ b/spec/bundler/bundler/installer/gem_installer_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/installer/gem_installer"
RSpec.describe Bundler::GemInstaller do
@@ -20,6 +20,7 @@ RSpec.describe Bundler::GemInstaller do
it "invokes install method with build_args", :rubygems => ">= 2" do
allow(Bundler.settings).to receive(:[]).with(:bin)
allow(Bundler.settings).to receive(:[]).with(:inline)
+ allow(Bundler.settings).to receive(:[]).with(:forget_cli_options)
allow(Bundler.settings).to receive(:[]).with("build.dummy").and_return("--with-dummy-config=dummy")
expect(spec_source).to receive(:install).with(spec, :force => false, :ensure_builtin_gems_cached => false, :build_args => ["--with-dummy-config=dummy"])
subject.install_from_spec
diff --git a/spec/bundler/bundler/installer/parallel_installer_spec.rb b/spec/bundler/bundler/installer/parallel_installer_spec.rb
index 7d2c441399..ace5c1a23a 100644
--- a/spec/bundler/bundler/installer/parallel_installer_spec.rb
+++ b/spec/bundler/bundler/installer/parallel_installer_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/installer/parallel_installer"
RSpec.describe Bundler::ParallelInstaller do
diff --git a/spec/bundler/bundler/installer/spec_installation_spec.rb b/spec/bundler/bundler/installer/spec_installation_spec.rb
index 1e368ab7c5..a9cf09a372 100644
--- a/spec/bundler/bundler/installer/spec_installation_spec.rb
+++ b/spec/bundler/bundler/installer/spec_installation_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/installer/parallel_installer"
RSpec.describe Bundler::ParallelInstaller::SpecInstallation do
diff --git a/spec/bundler/bundler/lockfile_parser_spec.rb b/spec/bundler/bundler/lockfile_parser_spec.rb
index 17bb447194..3a6d61336f 100644
--- a/spec/bundler/bundler/lockfile_parser_spec.rb
+++ b/spec/bundler/bundler/lockfile_parser_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/lockfile_parser"
RSpec.describe Bundler::LockfileParser do
@@ -91,4 +91,63 @@ RSpec.describe Bundler::LockfileParser do
end
end
end
+
+ describe "#initialize" do
+ before { allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app("gems.rb")) }
+ subject { described_class.new(lockfile_contents) }
+
+ let(:sources) do
+ [Bundler::Source::Git.new("uri" => "https://github.com/alloy/peiji-san.git", "revision" => "eca485d8dc95f12aaec1a434b49d295c7e91844b"),
+ Bundler::Source::Rubygems.new("remotes" => ["https://rubygems.org"])]
+ end
+ let(:dependencies) do
+ {
+ "peiji-san" => Bundler::Dependency.new("peiji-san", ">= 0"),
+ "rake" => Bundler::Dependency.new("rake", ">= 0"),
+ }
+ end
+ let(:specs) do
+ [
+ Bundler::LazySpecification.new("peiji-san", v("1.2.0"), rb),
+ Bundler::LazySpecification.new("rake", v("10.3.2"), rb),
+ ]
+ end
+ let(:platforms) { [rb] }
+ let(:bundler_version) { Gem::Version.new("1.12.0.rc.2") }
+ let(:ruby_version) { "ruby 2.1.3p242" }
+
+ shared_examples_for "parsing" do
+ it "parses correctly" do
+ expect(subject.sources).to eq sources
+ expect(subject.dependencies).to eq dependencies
+ expect(subject.specs).to eq specs
+ expect(Hash[subject.specs.map {|s| [s, s.dependencies] }]).to eq Hash[subject.specs.map {|s| [s, s.dependencies] }]
+ expect(subject.platforms).to eq platforms
+ expect(subject.bundler_version).to eq bundler_version
+ expect(subject.ruby_version).to eq ruby_version
+ end
+ end
+
+ include_examples "parsing"
+
+ context "when an extra section is at the end" do
+ let(:lockfile_contents) { super() + "\n\nFOO BAR\n baz\n baa\n qux\n" }
+ include_examples "parsing"
+ end
+
+ context "when an extra section is at the start" do
+ let(:lockfile_contents) { "FOO BAR\n baz\n baa\n qux\n\n" + super() }
+ include_examples "parsing"
+ end
+
+ context "when an extra section is in the middle" do
+ let(:lockfile_contents) { super().split(/(?=GEM)/).insert(1, "FOO BAR\n baz\n baa\n qux\n\n").join }
+ include_examples "parsing"
+ end
+
+ context "when a dependency has options" do
+ let(:lockfile_contents) { super().sub("peiji-san!", "peiji-san!\n foo: bar") }
+ include_examples "parsing"
+ end
+ end
end
diff --git a/spec/bundler/bundler/mirror_spec.rb b/spec/bundler/bundler/mirror_spec.rb
index 9051a80465..0a8b9f8926 100644
--- a/spec/bundler/bundler/mirror_spec.rb
+++ b/spec/bundler/bundler/mirror_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/mirror"
RSpec.describe Bundler::Settings::Mirror do
diff --git a/spec/bundler/bundler/plugin/api/source_spec.rb b/spec/bundler/bundler/plugin/api/source_spec.rb
index 4dbb993b89..2c50ff56a4 100644
--- a/spec/bundler/bundler/plugin/api/source_spec.rb
+++ b/spec/bundler/bundler/plugin/api/source_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::API::Source do
let(:uri) { "uri://to/test" }
@@ -37,7 +36,7 @@ RSpec.describe Bundler::Plugin::API::Source do
context "install_path" do
let(:uri) { "uri://to/a/repository-name" }
- let(:hash) { Digest::SHA1.hexdigest(uri) }
+ let(:hash) { Digest(:SHA1).hexdigest(uri) }
let(:install_path) { Pathname.new "/bundler/install/path" }
before do
diff --git a/spec/bundler/bundler/plugin/api_spec.rb b/spec/bundler/bundler/plugin/api_spec.rb
index e40b9adb0f..58fb908572 100644
--- a/spec/bundler/bundler/plugin/api_spec.rb
+++ b/spec/bundler/bundler/plugin/api_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::API do
context "plugin declarations" do
@@ -60,15 +59,15 @@ RSpec.describe Bundler::Plugin::API do
# A test of delegation
it "provides the Bundler's functions" do
- expect(Bundler).to receive(:an_unkown_function).once
+ expect(Bundler).to receive(:an_unknown_function).once
- api.an_unkown_function
+ api.an_unknown_function
end
it "includes Bundler::SharedHelpers' functions" do
- expect(Bundler::SharedHelpers).to receive(:an_unkown_helper).once
+ expect(Bundler::SharedHelpers).to receive(:an_unknown_helper).once
- api.an_unkown_helper
+ api.an_unknown_helper
end
context "#tmp" do
diff --git a/spec/bundler/bundler/plugin/dsl_spec.rb b/spec/bundler/bundler/plugin/dsl_spec.rb
index cd15b6ea9d..be23db3bba 100644
--- a/spec/bundler/bundler/plugin/dsl_spec.rb
+++ b/spec/bundler/bundler/plugin/dsl_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::DSL do
DSL = Bundler::Plugin::DSL
diff --git a/spec/bundler/bundler/plugin/index_spec.rb b/spec/bundler/bundler/plugin/index_spec.rb
index 24b9a408ff..163b563b2a 100644
--- a/spec/bundler/bundler/plugin/index_spec.rb
+++ b/spec/bundler/bundler/plugin/index_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::Index do
Index = Bundler::Plugin::Index
diff --git a/spec/bundler/bundler/plugin/installer_spec.rb b/spec/bundler/bundler/plugin/installer_spec.rb
index e8d5941e33..f8bf8450c9 100644
--- a/spec/bundler/bundler/plugin/installer_spec.rb
+++ b/spec/bundler/bundler/plugin/installer_spec.rb
@@ -1,12 +1,16 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::Installer do
subject(:installer) { Bundler::Plugin::Installer.new }
+ before do
+ # allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(Pathname.new("/Gemfile"))
+ end
+
describe "cli install" do
it "uses Gem.sources when non of the source is provided" do
sources = double(:sources)
+ Bundler.settings # initialize it before we have to touch rubygems.ext_lock
allow(Bundler).to receive_message_chain("rubygems.sources") { sources }
allow(installer).to receive(:install_rubygems).
diff --git a/spec/bundler/bundler/plugin/source_list_spec.rb b/spec/bundler/bundler/plugin/source_list_spec.rb
index 86cc4ac4ed..64a1233dd1 100644
--- a/spec/bundler/bundler/plugin/source_list_spec.rb
+++ b/spec/bundler/bundler/plugin/source_list_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin::SourceList do
SourceList = Bundler::Plugin::SourceList
diff --git a/spec/bundler/bundler/plugin_spec.rb b/spec/bundler/bundler/plugin_spec.rb
index 5bbb7384c8..9796b580a3 100644
--- a/spec/bundler/bundler/plugin_spec.rb
+++ b/spec/bundler/bundler/plugin_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Plugin do
Plugin = Bundler::Plugin
diff --git a/spec/bundler/bundler/psyched_yaml_spec.rb b/spec/bundler/bundler/psyched_yaml_spec.rb
index 18e40d6b5a..d5d68c5cc3 100644
--- a/spec/bundler/bundler/psyched_yaml_spec.rb
+++ b/spec/bundler/bundler/psyched_yaml_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/psyched_yaml"
RSpec.describe "Bundler::YamlLibrarySyntaxError" do
diff --git a/spec/bundler/bundler/remote_specification_spec.rb b/spec/bundler/bundler/remote_specification_spec.rb
index 644814c563..8115e026d8 100644
--- a/spec/bundler/bundler/remote_specification_spec.rb
+++ b/spec/bundler/bundler/remote_specification_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::RemoteSpecification do
let(:name) { "foo" }
diff --git a/spec/bundler/bundler/retry_spec.rb b/spec/bundler/bundler/retry_spec.rb
index 525f05d327..b893580d72 100644
--- a/spec/bundler/bundler/retry_spec.rb
+++ b/spec/bundler/bundler/retry_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Retry do
it "return successful result if no errors" do
diff --git a/spec/bundler/bundler/ruby_dsl_spec.rb b/spec/bundler/bundler/ruby_dsl_spec.rb
index 3e0ec9d7f0..bc1ca98457 100644
--- a/spec/bundler/bundler/ruby_dsl_spec.rb
+++ b/spec/bundler/bundler/ruby_dsl_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/ruby_dsl"
RSpec.describe Bundler::RubyDsl do
diff --git a/spec/bundler/bundler/ruby_version_spec.rb b/spec/bundler/bundler/ruby_version_spec.rb
index f77ec606fc..3f30821b5c 100644
--- a/spec/bundler/bundler/ruby_version_spec.rb
+++ b/spec/bundler/bundler/ruby_version_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/ruby_version"
RSpec.describe "Bundler::RubyVersion and its subclasses" do
diff --git a/spec/bundler/bundler/rubygems_integration_spec.rb b/spec/bundler/bundler/rubygems_integration_spec.rb
index 38ff9dae7e..b1b15d9e5d 100644
--- a/spec/bundler/bundler/rubygems_integration_spec.rb
+++ b/spec/bundler/bundler/rubygems_integration_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::RubygemsIntegration do
it "uses the same chdir lock as rubygems", :rubygems => "2.1" do
@@ -67,7 +66,7 @@ RSpec.describe Bundler::RubygemsIntegration do
end
let(:fetcher) { double("gem_remote_fetcher") }
- it "succesfully downloads gem with retries" do
+ it "successfully downloads gem with retries" do
expect(Bundler.rubygems).to receive(:gem_remote_fetcher).and_return(fetcher)
expect(fetcher).to receive(:headers=).with("X-Gemfile-Source" => "https://foo.bar")
expect(Bundler::Retry).to receive(:new).with("download gem from #{uri}/").
@@ -95,7 +94,7 @@ RSpec.describe Bundler::RubygemsIntegration do
expect(fetcher).to receive(:fetch_path).with(uri + "specs.4.8.gz").and_return(specs_response)
expect(fetcher).to receive(:fetch_path).with(uri + "prerelease_specs.4.8.gz").and_return(prerelease_specs_response)
result = Bundler.rubygems.fetch_all_remote_specs(remote_with_mirror)
- expect(result).to eq(%w(specs prerelease_specs))
+ expect(result).to eq(%w[specs prerelease_specs])
end
end
@@ -108,7 +107,7 @@ RSpec.describe Bundler::RubygemsIntegration do
expect(fetcher).to receive(:fetch_path).with(uri + "specs.4.8.gz").and_return(specs_response)
expect(fetcher).to receive(:fetch_path).with(uri + "prerelease_specs.4.8.gz").and_return(prerelease_specs_response)
result = Bundler.rubygems.fetch_all_remote_specs(remote_no_mirror)
- expect(result).to eq(%w(specs prerelease_specs))
+ expect(result).to eq(%w[specs prerelease_specs])
end
end
end
diff --git a/spec/bundler/bundler/settings/validator_spec.rb b/spec/bundler/bundler/settings/validator_spec.rb
new file mode 100644
index 0000000000..e4ffd89435
--- /dev/null
+++ b/spec/bundler/bundler/settings/validator_spec.rb
@@ -0,0 +1,111 @@
+# frozen_string_literal: true
+
+RSpec.describe Bundler::Settings::Validator do
+ describe ".validate!" do
+ def validate!(key, value, settings)
+ transformed_key = Bundler.settings.key_for(key)
+ if value.nil?
+ settings.delete(transformed_key)
+ else
+ settings[transformed_key] = value
+ end
+ described_class.validate!(key, value, settings)
+ settings
+ end
+
+ it "path and path.system are mutually exclusive" do
+ expect(validate!("path", "bundle", {})).to eq("BUNDLE_PATH" => "bundle")
+ expect(validate!("path", "bundle", "BUNDLE_PATH__SYSTEM" => false)).to eq("BUNDLE_PATH" => "bundle")
+ expect(validate!("path", "bundle", "BUNDLE_PATH__SYSTEM" => true)).to eq("BUNDLE_PATH" => "bundle")
+ expect(validate!("path", nil, "BUNDLE_PATH__SYSTEM" => true)).to eq("BUNDLE_PATH__SYSTEM" => true)
+ expect(validate!("path", nil, "BUNDLE_PATH__SYSTEM" => false)).to eq("BUNDLE_PATH__SYSTEM" => false)
+ expect(validate!("path", nil, {})).to eq({})
+
+ expect(validate!("path.system", true, "BUNDLE_PATH" => "bundle")).to eq("BUNDLE_PATH__SYSTEM" => true)
+ expect(validate!("path.system", false, "BUNDLE_PATH" => "bundle")).to eq("BUNDLE_PATH" => "bundle", "BUNDLE_PATH__SYSTEM" => false)
+ expect(validate!("path.system", nil, "BUNDLE_PATH" => "bundle")).to eq("BUNDLE_PATH" => "bundle")
+ expect(validate!("path.system", true, {})).to eq("BUNDLE_PATH__SYSTEM" => true)
+ expect(validate!("path.system", false, {})).to eq("BUNDLE_PATH__SYSTEM" => false)
+ expect(validate!("path.system", nil, {})).to eq({})
+ end
+
+ it "a group cannot be in both `with` & `without` simultaneously" do
+ expect do
+ validate!("with", "", {})
+ validate!("with", nil, {})
+ validate!("with", "", "BUNDLE_WITHOUT" => "a")
+ validate!("with", nil, "BUNDLE_WITHOUT" => "a")
+ validate!("with", "b:c", "BUNDLE_WITHOUT" => "a")
+
+ validate!("without", "", {})
+ validate!("without", nil, {})
+ validate!("without", "", "BUNDLE_WITH" => "a")
+ validate!("without", nil, "BUNDLE_WITH" => "a")
+ validate!("without", "b:c", "BUNDLE_WITH" => "a")
+ end.not_to raise_error
+
+ expect { validate!("with", "b:c", "BUNDLE_WITHOUT" => "c:d") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
+ Setting `with` to "b:c" failed:
+ - a group cannot be in both `with` & `without` simultaneously
+ - `without` is current set to [:c, :d]
+ - the `c` groups conflict
+ EOS
+
+ expect { validate!("without", "b:c", "BUNDLE_WITH" => "c:d") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
+ Setting `without` to "b:c" failed:
+ - a group cannot be in both `with` & `without` simultaneously
+ - `with` is current set to [:c, :d]
+ - the `c` groups conflict
+ EOS
+ end
+ end
+
+ describe described_class::Rule do
+ let(:keys) { %w[key] }
+ let(:description) { "rule description" }
+ let(:validate) { proc { raise "validate called!" } }
+ subject(:rule) { described_class.new(keys, description, &validate) }
+
+ describe "#validate!" do
+ it "calls the block" do
+ expect { rule.validate!("key", nil, {}) }.to raise_error(RuntimeError, /validate called!/)
+ end
+ end
+
+ describe "#fail!" do
+ it "raises with a helpful message" do
+ expect { subject.fail!("key", "value", "reason1", "reason2") }.to raise_error Bundler::InvalidOption, strip_whitespace(<<-EOS).strip
+ Setting `key` to "value" failed:
+ - rule description
+ - reason1
+ - reason2
+ EOS
+ end
+ end
+
+ describe "#set" do
+ it "works when the value has not changed" do
+ allow(Bundler.ui).to receive(:info).never
+
+ subject.set({}, "key", nil)
+ subject.set({ "BUNDLE_KEY" => "value" }, "key", "value")
+ end
+
+ it "prints out when the value is changing" do
+ settings = {}
+
+ expect(Bundler.ui).to receive(:info).with("Setting `key` to \"value\", since rule description, reason1")
+ subject.set(settings, "key", "value", "reason1")
+ expect(settings).to eq("BUNDLE_KEY" => "value")
+
+ expect(Bundler.ui).to receive(:info).with("Setting `key` to \"value2\", since rule description, reason2")
+ subject.set(settings, "key", "value2", "reason2")
+ expect(settings).to eq("BUNDLE_KEY" => "value2")
+
+ expect(Bundler.ui).to receive(:info).with("Setting `key` to nil, since rule description, reason3")
+ subject.set(settings, "key", nil, "reason3")
+ expect(settings).to eq({})
+ end
+ end
+ end
+end
diff --git a/spec/bundler/bundler/settings_spec.rb b/spec/bundler/bundler/settings_spec.rb
index 7302da5421..1a31493e20 100644
--- a/spec/bundler/bundler/settings_spec.rb
+++ b/spec/bundler/bundler/settings_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/settings"
RSpec.describe Bundler::Settings do
@@ -40,7 +40,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
before do
hash.each do |key, value|
- settings[key] = value
+ settings.set_local key, value
end
end
@@ -100,12 +100,12 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
context "when is boolean" do
it "returns a boolean" do
- settings[:frozen] = "true"
+ settings.set_local :frozen, "true"
expect(settings[:frozen]).to be true
end
context "when specific gem is configured" do
it "returns a boolean" do
- settings["ignore_messages.foobar"] = "true"
+ settings.set_local "ignore_messages.foobar", "true"
expect(settings["ignore_messages.foobar"]).to be true
end
end
@@ -113,16 +113,16 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
context "when is number" do
it "returns a number" do
- settings[:ssl_verify_mode] = "1"
+ settings.set_local :ssl_verify_mode, "1"
expect(settings[:ssl_verify_mode]).to be 1
end
end
context "when it's not possible to write to the file" do
it "raises an PermissionError with explanation" do
- expect(FileUtils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname).
+ expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:local_config_file).dirname).
and_raise(Errno::EACCES)
- expect { settings[:frozen] = "1" }.
+ expect { settings.set_local :frozen, "1" }.
to raise_error(Bundler::PermissionError, /config/)
end
end
@@ -130,7 +130,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
describe "#temporary" do
it "reset after used" do
- Bundler.settings[:no_install] = true
+ Bundler.settings.set_local :no_install, true
Bundler.settings.temporary(:no_install => false) do
expect(Bundler.settings[:no_install]).to eq false
@@ -138,12 +138,28 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
expect(Bundler.settings[:no_install]).to eq true
end
+
+ it "returns the return value of the block" do
+ ret = Bundler.settings.temporary({}) { :ret }
+ expect(ret).to eq :ret
+ end
+
+ context "when called without a block" do
+ it "leaves the setting changed" do
+ Bundler.settings.temporary(:foo => :random)
+ expect(Bundler.settings[:foo]).to eq "random"
+ end
+
+ it "returns nil" do
+ expect(Bundler.settings.temporary(:foo => :bar)).to be_nil
+ end
+ end
end
describe "#set_global" do
context "when it's not possible to write to the file" do
it "raises an PermissionError with explanation" do
- expect(FileUtils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname).
+ expect(bundler_fileutils).to receive(:mkdir_p).with(settings.send(:global_config_file).dirname).
and_raise(Errno::EACCES)
expect { settings.set_global(:frozen, "1") }.
to raise_error(Bundler::PermissionError, %r{\.bundle/config})
@@ -154,7 +170,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
describe "#pretty_values_for" do
it "prints the converted value rather than the raw string" do
bool_key = described_class::BOOL_KEYS.first
- settings[bool_key] = false
+ settings.set_local(bool_key, "false")
expect(subject.pretty_values_for(bool_key)).to eq [
"Set for your local app (#{bundled_app("config")}): false",
]
@@ -177,7 +193,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
context "with a configured mirror" do
let(:mirror_uri) { URI("https://rubygems-mirror.org/") }
- before { settings["mirror.https://rubygems.org/"] = mirror_uri.to_s }
+ before { settings.set_local "mirror.https://rubygems.org/", mirror_uri.to_s }
it "returns the mirror URI" do
expect(settings.mirror_for(uri)).to eq(mirror_uri)
@@ -194,6 +210,22 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
it "is case insensitive" do
expect(settings.mirror_for("HTTPS://RUBYGEMS.ORG/")).to eq(mirror_uri)
end
+
+ context "with a file URI" do
+ let(:mirror_uri) { URI("file:/foo/BAR/baz/qUx/") }
+
+ it "returns the mirror URI" do
+ expect(settings.mirror_for(uri)).to eq(mirror_uri)
+ end
+
+ it "converts a string parameter to a URI" do
+ expect(settings.mirror_for("file:/foo/BAR/baz/qUx/")).to eq(mirror_uri)
+ end
+
+ it "normalizes the URI" do
+ expect(settings.mirror_for("file:/foo/BAR/baz/qUx")).to eq(mirror_uri)
+ end
+ end
end
end
@@ -208,7 +240,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
end
context "with credentials configured by URL" do
- before { settings["https://gemserver.example.org/"] = credentials }
+ before { settings.set_local "https://gemserver.example.org/", credentials }
it "returns the configured credentials" do
expect(settings.credentials_for(uri)).to eq(credentials)
@@ -216,7 +248,7 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
end
context "with credentials configured by hostname" do
- before { settings["gemserver.example.org"] = credentials }
+ before { settings.set_local "gemserver.example.org", credentials }
it "returns the configured credentials" do
expect(settings.credentials_for(uri)).to eq(credentials)
@@ -226,41 +258,51 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
describe "URI normalization" do
it "normalizes HTTP URIs in credentials configuration" do
- settings["http://gemserver.example.org"] = "username:password"
+ settings.set_local "http://gemserver.example.org", "username:password"
expect(settings.all).to include("http://gemserver.example.org/")
end
it "normalizes HTTPS URIs in credentials configuration" do
- settings["https://gemserver.example.org"] = "username:password"
+ settings.set_local "https://gemserver.example.org", "username:password"
expect(settings.all).to include("https://gemserver.example.org/")
end
it "normalizes HTTP URIs in mirror configuration" do
- settings["mirror.http://rubygems.org"] = "http://rubygems-mirror.org"
+ settings.set_local "mirror.http://rubygems.org", "http://rubygems-mirror.org"
expect(settings.all).to include("mirror.http://rubygems.org/")
end
it "normalizes HTTPS URIs in mirror configuration" do
- settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
+ settings.set_local "mirror.https://rubygems.org", "http://rubygems-mirror.org"
expect(settings.all).to include("mirror.https://rubygems.org/")
end
it "does not normalize other config keys that happen to contain 'http'" do
- settings["local.httparty"] = home("httparty")
+ settings.set_local "local.httparty", home("httparty")
expect(settings.all).to include("local.httparty")
end
it "does not normalize other config keys that happen to contain 'https'" do
- settings["local.httpsmarty"] = home("httpsmarty")
+ settings.set_local "local.httpsmarty", home("httpsmarty")
expect(settings.all).to include("local.httpsmarty")
end
it "reads older keys without trailing slashes" do
- settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
+ settings.set_local "mirror.https://rubygems.org", "http://rubygems-mirror.org"
expect(settings.mirror_for("https://rubygems.org/")).to eq(
URI("http://rubygems-mirror.org/")
)
end
+
+ it "normalizes URIs with a fallback_timeout option" do
+ settings.set_local "mirror.https://rubygems.org/.fallback_timeout", "true"
+ expect(settings.all).to include("mirror.https://rubygems.org/.fallback_timeout")
+ end
+
+ it "normalizes URIs with a fallback_timeout option without a trailing slash" do
+ settings.set_local "mirror.https://rubygems.org.fallback_timeout", "true"
+ expect(settings.all).to include("mirror.https://rubygems.org/.fallback_timeout")
+ end
end
describe "BUNDLE_ keys format" do
diff --git a/spec/bundler/bundler/shared_helpers_spec.rb b/spec/bundler/bundler/shared_helpers_spec.rb
index d3b93b56d0..b8f099d5ba 100644
--- a/spec/bundler/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/bundler/shared_helpers_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::SharedHelpers do
let(:ext_lock_double) { double(:ext_lock) }
@@ -31,6 +30,16 @@ RSpec.describe Bundler::SharedHelpers do
)
end
end
+
+ context "Gemfile is not an absolute path" do
+ before { ENV["BUNDLE_GEMFILE"] = "Gemfile" }
+
+ let(:expected_gemfile_path) { Pathname.new("Gemfile").expand_path }
+
+ it "returns the Gemfile path" do
+ expect(subject.default_gemfile).to eq(expected_gemfile_path)
+ end
+ end
end
describe "#default_lockfile" do
@@ -102,7 +111,7 @@ RSpec.describe Bundler::SharedHelpers do
context "currently in directory with a Gemfile" do
before { File.new("Gemfile", "w") }
- it "returns path of the bundle gemfile" do
+ it "returns path of the bundle Gemfile" do
expect(subject.in_bundle?).to eq("#{bundled_app}/Gemfile")
end
end
@@ -252,20 +261,53 @@ RSpec.describe Bundler::SharedHelpers do
subject.set_bundle_environment
end
- it "exits if bundle path contains the path seperator" do
- stub_const("File::PATH_SEPARATOR", ":".freeze)
+ it "exits if bundle path contains the unix-like path separator" do
+ if Gem.respond_to?(:path_separator)
+ allow(Gem).to receive(:path_separator).and_return(":")
+ else
+ stub_const("File::PATH_SEPARATOR", ":".freeze)
+ end
allow(Bundler).to receive(:bundle_path) { Pathname.new("so:me/dir/bin") }
expect { subject.send(:validate_bundle_path) }.to raise_error(
Bundler::PathError,
- "Your bundle path contains a ':', which is the " \
+ "Your bundle path contains text matching \":\", which is the " \
"path separator for your system. Bundler cannot " \
"function correctly when the Bundle path contains the " \
"system's PATH separator. Please change your " \
- "bundle path to not include ':'.\nYour current bundle " \
+ "bundle path to not match \":\".\nYour current bundle " \
"path is '#{Bundler.bundle_path}'."
)
end
+ context "with a jruby path_separator regex", :ruby => "1.9" do
+ # In versions of jruby that supported ruby 1.8, the path separator was the standard File::PATH_SEPARATOR
+ let(:regex) { Regexp.new("(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):") }
+ it "does not exit if bundle path is the standard uri path" do
+ allow(Bundler.rubygems).to receive(:path_separator).and_return(regex)
+ allow(Bundler).to receive(:bundle_path) { Pathname.new("uri:classloader:/WEB-INF/gems") }
+ expect { subject.send(:validate_bundle_path) }.not_to raise_error
+ end
+
+ it "exits if bundle path contains another directory" do
+ allow(Bundler.rubygems).to receive(:path_separator).and_return(regex)
+ allow(Bundler).to receive(:bundle_path) {
+ Pathname.new("uri:classloader:/WEB-INF/gems:other/dir")
+ }
+
+ expect { subject.send(:validate_bundle_path) }.to raise_error(
+ Bundler::PathError,
+ "Your bundle path contains text matching " \
+ "/(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):/, which is the " \
+ "path separator for your system. Bundler cannot " \
+ "function correctly when the Bundle path contains the " \
+ "system's PATH separator. Please change your " \
+ "bundle path to not match " \
+ "/(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):/." \
+ "\nYour current bundle path is '#{Bundler.bundle_path}'."
+ )
+ end
+ end
+
context "ENV['PATH'] does not exist" do
before { ENV.delete("PATH") }
diff --git a/spec/bundler/bundler/source/git/git_proxy_spec.rb b/spec/bundler/bundler/source/git/git_proxy_spec.rb
index 34fe21e9fb..d282a449a5 100644
--- a/spec/bundler/bundler/source/git/git_proxy_spec.rb
+++ b/spec/bundler/bundler/source/git/git_proxy_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Source::Git::GitProxy do
let(:uri) { "https://github.com/bundler/bundler.git" }
@@ -7,25 +6,25 @@ RSpec.describe Bundler::Source::Git::GitProxy do
context "with configured credentials" do
it "adds username and password to URI" do
- Bundler.settings[uri] = "u:p"
+ Bundler.settings.temporary(uri => "u:p")
expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/bundler/bundler.git"))
subject.checkout
end
it "adds username and password to URI for host" do
- Bundler.settings["github.com"] = "u:p"
+ Bundler.settings.temporary("github.com" => "u:p")
expect(subject).to receive(:git_retry).with(match("https://u:p@github.com/bundler/bundler.git"))
subject.checkout
end
it "does not add username and password to mismatched URI" do
- Bundler.settings["https://u:p@github.com/bundler/bundler-mismatch.git"] = "u:p"
+ Bundler.settings.temporary("https://u:p@github.com/bundler/bundler-mismatch.git" => "u:p")
expect(subject).to receive(:git_retry).with(match(uri))
subject.checkout
end
it "keeps original userinfo" do
- Bundler.settings["github.com"] = "u:p"
+ Bundler.settings.temporary("github.com" => "u:p")
original = "https://orig:info@github.com/bundler/bundler.git"
subject = described_class.new(Pathname("path"), original, "HEAD")
expect(subject).to receive(:git_retry).with(match(original))
diff --git a/spec/bundler/bundler/source/rubygems/remote_spec.rb b/spec/bundler/bundler/source/rubygems/remote_spec.rb
index 54394fc0ca..9a7ab42128 100644
--- a/spec/bundler/bundler/source/rubygems/remote_spec.rb
+++ b/spec/bundler/bundler/source/rubygems/remote_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/source/rubygems/remote"
RSpec.describe Bundler::Source::Rubygems::Remote do
@@ -8,7 +8,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
before do
- allow(Digest::MD5).to receive(:hexdigest).with(duck_type(:to_s)) {|string| "MD5HEX(#{string})" }
+ allow(Digest(:MD5)).to receive(:hexdigest).with(duck_type(:to_s)) {|string| "MD5HEX(#{string})" }
end
let(:uri_no_auth) { URI("https://gems.example.com") }
@@ -22,7 +22,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "applies configured credentials" do
- Bundler.settings[uri_no_auth.to_s] = credentials
+ Bundler.settings.temporary(uri_no_auth.to_s => credentials)
expect(remote(uri_no_auth).uri).to eq(uri_with_auth)
end
end
@@ -33,7 +33,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "does not apply given credentials" do
- Bundler.settings[uri_no_auth.to_s] = credentials
+ Bundler.settings.temporary(uri_no_auth.to_s => credentials)
expect(remote(uri_no_auth).anonymized_uri).to eq(uri_no_auth)
end
end
@@ -44,7 +44,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "only applies the given user" do
- Bundler.settings[uri_no_auth.to_s] = credentials
+ Bundler.settings.temporary(uri_no_auth.to_s => credentials)
expect(remote(uri_no_auth).cache_slug).to eq("gems.example.com.username.443.MD5HEX(gems.example.com.username.443./)")
end
end
@@ -57,7 +57,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "does not apply configured credentials" do
- Bundler.settings[uri_no_auth.to_s] = "other:stuff"
+ Bundler.settings.temporary(uri_no_auth.to_s => "other:stuff")
expect(remote(uri_with_auth).uri).to eq(uri_with_auth)
end
end
@@ -68,7 +68,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "does not apply given credentials" do
- Bundler.settings[uri_no_auth.to_s] = "other:stuff"
+ Bundler.settings.temporary(uri_no_auth.to_s => "other:stuff")
expect(remote(uri_with_auth).anonymized_uri).to eq(uri_no_auth)
end
end
@@ -79,7 +79,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
end
it "does not apply given credentials" do
- Bundler.settings[uri_with_auth.to_s] = credentials
+ Bundler.settings.temporary(uri_with_auth.to_s => credentials)
expect(remote(uri_with_auth).cache_slug).to eq("gems.example.com.username.443.MD5HEX(gems.example.com.username.443./)")
end
end
@@ -106,7 +106,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
let(:mirror_uri_with_auth) { URI("https://username:password@rubygems-mirror.org/") }
let(:mirror_uri_no_auth) { URI("https://rubygems-mirror.org/") }
- before { Bundler.settings["mirror.https://rubygems.org/"] = mirror_uri_with_auth.to_s }
+ before { Bundler.settings.set_local("mirror.https://rubygems.org/", mirror_uri_with_auth.to_s) }
specify "#uri returns the mirror URI with credentials" do
expect(remote(uri).uri).to eq(mirror_uri_with_auth)
@@ -131,8 +131,8 @@ RSpec.describe Bundler::Source::Rubygems::Remote do
let(:mirror_uri_no_auth) { URI("https://rubygems-mirror.org/") }
before do
- Bundler.settings["mirror.https://rubygems.org/"] = mirror_uri_no_auth.to_s
- Bundler.settings[mirror_uri_no_auth.to_s] = credentials
+ Bundler.settings.temporary("mirror.https://rubygems.org/" => mirror_uri_no_auth.to_s)
+ Bundler.settings.temporary(mirror_uri_no_auth.to_s => credentials)
end
specify "#uri returns the mirror URI with credentials" do
diff --git a/spec/bundler/bundler/source/rubygems_spec.rb b/spec/bundler/bundler/source/rubygems_spec.rb
index b8f9f09c20..7c457a7265 100644
--- a/spec/bundler/bundler/source/rubygems_spec.rb
+++ b/spec/bundler/bundler/source/rubygems_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Source::Rubygems do
before do
diff --git a/spec/bundler/bundler/source_list_spec.rb b/spec/bundler/bundler/source_list_spec.rb
index 6a23c8bcbf..ce3353012c 100644
--- a/spec/bundler/bundler/source_list_spec.rb
+++ b/spec/bundler/bundler/source_list_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::SourceList do
before do
@@ -13,6 +12,7 @@ RSpec.describe Bundler::SourceList do
subject(:source_list) { Bundler::SourceList.new }
let(:rubygems_aggregate) { Bundler::Source::Rubygems.new }
+ let(:metadata_source) { Bundler::Source::Metadata.new }
describe "adding sources" do
before do
@@ -85,7 +85,7 @@ RSpec.describe Bundler::SourceList do
end
it "ignores git protocols on request" do
- Bundler.settings["git.allow_insecure"] = true
+ Bundler.settings.temporary(:"git.allow_insecure" => true)
expect(Bundler.ui).to_not receive(:warn).with(msg)
source_list.add_git_source("uri" => "git://existing-git.org/path.git")
end
@@ -115,18 +115,19 @@ RSpec.describe Bundler::SourceList do
end
end
- describe "#add_rubygems_remote" do
- before do
- @returned_source = source_list.add_rubygems_remote("https://rubygems.org/")
- end
+ describe "#add_rubygems_remote", :bundler => "< 2" do
+ let!(:returned_source) { source_list.add_rubygems_remote("https://rubygems.org/") }
it "returns the aggregate rubygems source" do
- expect(@returned_source).to be_instance_of(Bundler::Source::Rubygems)
+ expect(returned_source).to be_instance_of(Bundler::Source::Rubygems)
end
it "adds the provided remote to the beginning of the aggregate source" do
source_list.add_rubygems_remote("https://othersource.org")
- expect(@returned_source.remotes.first).to eq(URI("https://othersource.org/"))
+ expect(returned_source.remotes).to eq [
+ URI("https://othersource.org/"),
+ URI("https://rubygems.org/"),
+ ]
end
end
@@ -204,6 +205,7 @@ RSpec.describe Bundler::SourceList do
Bundler::Source::Rubygems.new("remotes" => ["https://fourth-rubygems.org"]),
Bundler::Source::Rubygems.new("remotes" => ["https://fifth-rubygems.org"]),
rubygems_aggregate,
+ metadata_source,
]
end
end
@@ -354,7 +356,7 @@ RSpec.describe Bundler::SourceList do
end
describe "#lock_sources" do
- it "combines the rubygems sources into a single instance, removing duplicate remotes from the end" do
+ before do
source_list.add_git_source("uri" => "git://third-git.org/path.git")
source_list.add_rubygems_source("remotes" => ["https://duplicate-rubygems.org"])
source_list.add_plugin_source("new_source", "uri" => "https://third-bar.org/foo")
@@ -368,7 +370,9 @@ RSpec.describe Bundler::SourceList do
source_list.add_path_source("path" => "/first/path/to/gem")
source_list.add_rubygems_source("remotes" => ["https://duplicate-rubygems.org"])
source_list.add_git_source("uri" => "git://first-git.org/path.git")
+ end
+ it "combines the rubygems sources into a single instance, removing duplicate remotes from the end", :bundler => "< 2" do
expect(source_list.lock_sources).to eq [
Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
@@ -386,6 +390,24 @@ RSpec.describe Bundler::SourceList do
]),
]
end
+
+ it "returns all sources, without combining rubygems sources", :bundler => "2" do
+ expect(source_list.lock_sources).to eq [
+ Bundler::Source::Rubygems.new,
+ Bundler::Source::Rubygems.new("remotes" => ["https://duplicate-rubygems.org"]),
+ Bundler::Source::Rubygems.new("remotes" => ["https://first-rubygems.org"]),
+ Bundler::Source::Rubygems.new("remotes" => ["https://second-rubygems.org"]),
+ Bundler::Source::Rubygems.new("remotes" => ["https://third-rubygems.org"]),
+ Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
+ Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
+ Bundler::Source::Git.new("uri" => "git://third-git.org/path.git"),
+ Bundler::Source::Path.new("path" => "/first/path/to/gem"),
+ Bundler::Source::Path.new("path" => "/second/path/to/gem"),
+ Bundler::Source::Path.new("path" => "/third/path/to/gem"),
+ ASourcePlugin.new("uri" => "https://second-plugin.org/random"),
+ ASourcePlugin.new("uri" => "https://third-bar.org/foo"),
+ ]
+ end
end
describe "replace_sources!" do
@@ -414,7 +436,7 @@ RSpec.describe Bundler::SourceList do
end
describe "#cached!" do
- let(:rubygems_source) { source_list.add_rubygems_remote("https://rubygems.org") }
+ let(:rubygems_source) { source_list.add_rubygems_source("remotes" => ["https://rubygems.org"]) }
let(:git_source) { source_list.add_git_source("uri" => "git://host/path.git") }
let(:path_source) { source_list.add_path_source("path" => "/path/to/gem") }
@@ -427,7 +449,7 @@ RSpec.describe Bundler::SourceList do
end
describe "#remote!" do
- let(:rubygems_source) { source_list.add_rubygems_remote("https://rubygems.org") }
+ let(:rubygems_source) { source_list.add_rubygems_source("remotes" => ["https://rubygems.org"]) }
let(:git_source) { source_list.add_git_source("uri" => "git://host/path.git") }
let(:path_source) { source_list.add_path_source("path" => "/path/to/gem") }
diff --git a/spec/bundler/bundler/source_spec.rb b/spec/bundler/bundler/source_spec.rb
index 08d1698fcd..9ef8e7e50f 100644
--- a/spec/bundler/bundler/source_spec.rb
+++ b/spec/bundler/bundler/source_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::Source do
class ExampleSource < Bundler::Source
diff --git a/spec/bundler/bundler/spec_set_spec.rb b/spec/bundler/bundler/spec_set_spec.rb
index 8f7c27f065..6fedd38b50 100644
--- a/spec/bundler/bundler/spec_set_spec.rb
+++ b/spec/bundler/bundler/spec_set_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::SpecSet do
let(:specs) do
@@ -17,6 +16,7 @@ RSpec.describe Bundler::SpecSet do
build_spec("e", "1.0.0.pre.1"),
].flatten
end
+
subject { described_class.new(specs) }
context "enumerable methods" do
@@ -29,15 +29,49 @@ RSpec.describe Bundler::SpecSet do
end
end
+ describe "#find_by_name_and_platform" do
+ let(:platform) { Gem::Platform.new("universal-darwin-64") }
+ let(:platform_spec) { build_spec("b", "2.0", platform).first }
+ let(:specs) do
+ [
+ build_spec("a", "1.0"),
+ platform_spec,
+ ].flatten
+ end
+
+ it "finds spec with given name and platform" do
+ spec = described_class.new(specs).find_by_name_and_platform("b", platform)
+ expect(spec).to eq platform_spec
+ end
+ end
+
+ describe "#merge" do
+ let(:other_specs) do
+ [
+ build_spec("f", "1.0"),
+ build_spec("g", "2.0"),
+ ].flatten
+ end
+
+ let(:other_spec_set) { described_class.new(other_specs) }
+
+ it "merges the items in each gemspec" do
+ new_spec_set = subject.merge(other_spec_set)
+ specs = new_spec_set.to_a.map(&:full_name)
+ expect(specs).to include("a-1.0")
+ expect(specs).to include("f-1.0")
+ end
+ end
+
describe "#to_a" do
it "returns the specs in order" do
- expect(subject.to_a.map(&:full_name)).to eq %w(
+ expect(subject.to_a.map(&:full_name)).to eq %w[
a-1.0
b-1.0
e-1.0.0.pre.1
c-1.1
d-2.0
- )
+ ]
end
end
end
diff --git a/spec/bundler/bundler/ssl_certs/certificate_manager_spec.rb b/spec/bundler/bundler/ssl_certs/certificate_manager_spec.rb
index 66853a6815..d1ec08bdc4 100644
--- a/spec/bundler/bundler/ssl_certs/certificate_manager_spec.rb
+++ b/spec/bundler/bundler/ssl_certs/certificate_manager_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/ssl_certs/certificate_manager"
RSpec.describe Bundler::SSLCerts::CertificateManager do
@@ -78,17 +78,17 @@ RSpec.describe Bundler::SSLCerts::CertificateManager do
context "when certificate manager is not up to date" do
before do
allow(subject).to receive(:up_to_date?).and_return(false)
- allow(FileUtils).to receive(:rm)
- allow(FileUtils).to receive(:cp)
+ allow(bundler_fileutils).to receive(:rm)
+ allow(bundler_fileutils).to receive(:cp)
end
it "should remove the current bundler certs" do
- expect(FileUtils).to receive(:rm).with(subject.bundler_certs)
+ expect(bundler_fileutils).to receive(:rm).with(subject.bundler_certs)
subject.update!
end
it "should copy the rubygems certs into bundler certs" do
- expect(FileUtils).to receive(:cp).with(subject.rubygems_certs, subject.bundler_cert_path)
+ expect(bundler_fileutils).to receive(:cp).with(subject.rubygems_certs, subject.bundler_cert_path)
subject.update!
end
diff --git a/spec/bundler/bundler/stub_specification_spec.rb b/spec/bundler/bundler/stub_specification_spec.rb
index f1ddf43bb4..5521d83769 100644
--- a/spec/bundler/bundler/stub_specification_spec.rb
+++ b/spec/bundler/bundler/stub_specification_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::StubSpecification do
let(:gemspec) do
diff --git a/spec/bundler/bundler/ui/shell_spec.rb b/spec/bundler/bundler/ui/shell_spec.rb
new file mode 100644
index 0000000000..9a47a3572f
--- /dev/null
+++ b/spec/bundler/bundler/ui/shell_spec.rb
@@ -0,0 +1,64 @@
+# frozen_string_literal: true
+
+RSpec.describe Bundler::UI::Shell do
+ subject { described_class.new }
+
+ before { subject.level = "debug" }
+
+ describe "#info" do
+ before { subject.level = "info" }
+ it "prints to stdout" do
+ expect { subject.info("info") }.to output("info\n").to_stdout
+ end
+ end
+
+ describe "#confirm" do
+ before { subject.level = "confirm" }
+ it "prints to stdout" do
+ expect { subject.confirm("confirm") }.to output("confirm\n").to_stdout
+ end
+ end
+
+ describe "#warn" do
+ before { subject.level = "warn" }
+ it "prints to stdout", :bundler => "< 2" do
+ expect { subject.warn("warning") }.to output("warning\n").to_stdout
+ end
+
+ it "prints to stderr", :bundler => "2" do
+ expect { subject.warn("warning") }.to output("warning\n").to_stderr
+ end
+
+ context "when stderr flag is enabled" do
+ before { Bundler.settings.temporary(:error_on_stderr => true) }
+ it "prints to stderr" do
+ expect { subject.warn("warning!") }.to output("warning!\n").to_stderr
+ end
+ end
+ end
+
+ describe "#debug" do
+ it "prints to stdout" do
+ expect { subject.debug("debug") }.to output("debug\n").to_stdout
+ end
+ end
+
+ describe "#error" do
+ before { subject.level = "error" }
+
+ it "prints to stdout", :bundler => "< 2" do
+ expect { subject.error("error!!!") }.to output("error!!!\n").to_stdout
+ end
+
+ it "prints to stderr", :bundler => "2" do
+ expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr
+ end
+
+ context "when stderr flag is enabled" do
+ before { Bundler.settings.temporary(:error_on_stderr => true) }
+ it "prints to stderr" do
+ expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr
+ end
+ end
+ end
+end
diff --git a/spec/bundler/bundler/ui_spec.rb b/spec/bundler/bundler/ui_spec.rb
index fc76eb1ee7..6ef8729277 100644
--- a/spec/bundler/bundler/ui_spec.rb
+++ b/spec/bundler/bundler/ui_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::UI do
describe Bundler::UI::Silent do
diff --git a/spec/bundler/bundler/uri_credentials_filter_spec.rb b/spec/bundler/bundler/uri_credentials_filter_spec.rb
index 1dd01b4be0..fe52d16306 100644
--- a/spec/bundler/bundler/uri_credentials_filter_spec.rb
+++ b/spec/bundler/bundler/uri_credentials_filter_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe Bundler::URICredentialsFilter do
subject { described_class }
diff --git a/spec/bundler/bundler/vendored_persistent_spec.rb b/spec/bundler/bundler/vendored_persistent_spec.rb
new file mode 100644
index 0000000000..338431c4a6
--- /dev/null
+++ b/spec/bundler/bundler/vendored_persistent_spec.rb
@@ -0,0 +1,78 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+require "bundler/vendored_persistent"
+
+RSpec.describe Bundler::PersistentHTTP do
+ describe "#warn_old_tls_version_rubygems_connection" do
+ let(:uri) { "https://index.rubygems.org" }
+ let(:connection) { instance_double(subject.http_class) }
+ let(:tls_version) { "TLSv1.2" }
+ let(:socket) { double("Socket") }
+ let(:socket_io) { double("SocketIO") }
+
+ before do
+ allow(connection).to receive(:use_ssl?).and_return(!tls_version.nil?)
+ allow(socket).to receive(:io).and_return(socket_io)
+ connection.instance_variable_set(:@socket, socket)
+
+ if tls_version
+ allow(socket_io).to receive(:ssl_version).and_return(tls_version)
+ end
+ end
+
+ shared_examples_for "does not warn" do
+ it "does not warn" do
+ allow(Bundler.ui).to receive(:warn).never
+ subject.warn_old_tls_version_rubygems_connection(URI(uri), connection)
+ end
+ end
+
+ shared_examples_for "does warn" do |*expected|
+ it "warns" do
+ expect(Bundler.ui).to receive(:warn).with(*expected)
+ subject.warn_old_tls_version_rubygems_connection(URI(uri), connection)
+ end
+ end
+
+ context "an HTTPS uri with TLSv1.2" do
+ include_examples "does not warn"
+ end
+
+ context "without SSL" do
+ let(:tls_version) { nil }
+
+ include_examples "does not warn"
+ end
+
+ context "without a socket" do
+ let(:socket) { nil }
+
+ include_examples "does not warn"
+ end
+
+ context "with a different TLD" do
+ let(:uri) { "https://foo.bar" }
+ include_examples "does not warn"
+
+ context "and an outdated TLS version" do
+ let(:tls_version) { "TLSv1" }
+ include_examples "does not warn"
+ end
+ end
+
+ context "with a nonsense TLS version" do
+ let(:tls_version) { "BlahBlah2.0Blah" }
+ include_examples "does not warn"
+ end
+
+ context "with an outdated TLS version" do
+ let(:tls_version) { "TLSv1" }
+ include_examples "does warn",
+ "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \
+ "Starting in January 2018, RubyGems.org will refuse connection requests from these very old versions of OpenSSL. " \
+ "If you will need to continue installing gems after January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.",
+ :wrap => true
+ end
+ end
+end
diff --git a/spec/bundler/bundler/version_ranges_spec.rb b/spec/bundler/bundler/version_ranges_spec.rb
index f746aa88ad..ccbb9285d5 100644
--- a/spec/bundler/bundler/version_ranges_spec.rb
+++ b/spec/bundler/bundler/version_ranges_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/version_ranges"
RSpec.describe Bundler::VersionRanges do
diff --git a/spec/bundler/bundler/worker_spec.rb b/spec/bundler/bundler/worker_spec.rb
index fbfe6ddab3..2e5642709d 100644
--- a/spec/bundler/bundler/worker_spec.rb
+++ b/spec/bundler/bundler/worker_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/worker"
RSpec.describe Bundler::Worker do
diff --git a/spec/bundler/bundler/yaml_serializer_spec.rb b/spec/bundler/bundler/yaml_serializer_spec.rb
index c28db59223..1241c74bbf 100644
--- a/spec/bundler/bundler/yaml_serializer_spec.rb
+++ b/spec/bundler/bundler/yaml_serializer_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/yaml_serializer"
RSpec.describe Bundler::YAMLSerializer do
@@ -156,6 +156,7 @@ RSpec.describe Bundler::YAMLSerializer do
"a_joke" => {
"my-stand" => "I can totally keep secrets",
"but" => "The people I tell them to can't :P",
+ "wouldn't it be funny if this string were empty?" => "",
},
"more" => {
"first" => [
diff --git a/spec/bundler/cache/cache_path_spec.rb b/spec/bundler/cache/cache_path_spec.rb
index ec6d6e312a..69d3809964 100644
--- a/spec/bundler/cache/cache_path_spec.rb
+++ b/spec/bundler/cache/cache_path_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle package" do
before do
@@ -24,11 +23,10 @@ RSpec.describe "bundle package" do
end
end
- context "when given an absolute path" do
- it "exits with non-zero status" do
+ context "with absolute --cache-path" do
+ it "caches gems at given path" do
bundle :package, "cache-path" => "/tmp/cache-foo"
- expect(out).to match(/must be relative/)
- expect(exitstatus).to eq(15) if exitstatus
+ expect(bundled_app("/tmp/cache-foo/rack-1.0.0.gem")).to exist
end
end
end
diff --git a/spec/bundler/cache/gems_spec.rb b/spec/bundler/cache/gems_spec.rb
index 7828c87fec..4a0b953830 100644
--- a/spec/bundler/cache/gems_spec.rb
+++ b/spec/bundler/cache/gems_spec.rb
@@ -1,15 +1,14 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle cache" do
- describe "when there are only gemsources" do
+ shared_examples_for "when there are only gemsources" do
before :each do
gemfile <<-G
gem 'rack'
G
- system_gems "rack-1.0.0"
- bundle :cache
+ system_gems "rack-1.0.0", :path => :bundle_path
+ bundle! :cache
end
it "copies the .gem file to vendor/cache" do
@@ -28,7 +27,7 @@ RSpec.describe "bundle cache" do
end
it "uses the cache as a source when installing gems with --local" do
- system_gems []
+ system_gems [], :path => :bundle_path
bundle "install --local"
expect(the_bundle).to include_gems("rack 1.0.0")
@@ -47,7 +46,7 @@ RSpec.describe "bundle cache" do
end
it "does not reinstall gems from the cache if they exist in the bundle" do
- system_gems "rack-1.0.0"
+ system_gems "rack-1.0.0", :path => :bundle_path
gemfile <<-G
gem "rack"
@@ -57,7 +56,7 @@ RSpec.describe "bundle cache" do
s.write "lib/rack.rb", "RACK = 'FAIL'"
end
- bundle "install --local"
+ bundle! :install, :local => true
expect(the_bundle).to include_gems("rack 1.0.0")
end
@@ -74,6 +73,16 @@ RSpec.describe "bundle cache" do
end
end
+ context "using system gems" do
+ before { bundle! "config path.system true" }
+ it_behaves_like "when there are only gemsources"
+ end
+
+ context "installing into a local path" do
+ before { bundle! "config path ./.bundle" }
+ it_behaves_like "when there are only gemsources"
+ end
+
describe "when there is a built-in gem", :ruby => "2.0" do
before :each do
build_repo2 do
@@ -87,7 +96,8 @@ RSpec.describe "bundle cache" do
FileUtils.rm("#{system_gem_path}/cache/builtin_gem-1.0.2.gem")
end
- it "uses builtin gems" do
+ it "uses builtin gems when installing to system gems" do
+ bundle! "config path.system true"
install_gemfile %(gem 'builtin_gem', '1.0.2')
expect(the_bundle).to include_gems("builtin_gem 1.0.2")
end
@@ -119,6 +129,8 @@ RSpec.describe "bundle cache" do
end
it "errors if the builtin gem isn't available to cache" do
+ bundle! "config path.system true"
+
install_gemfile <<-G
gem 'builtin_gem', '1.0.2'
G
@@ -184,7 +196,7 @@ RSpec.describe "bundle cache" do
it "adds and removes when gems are updated" do
update_repo2
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(cached_gem("rack-1.2")).to exist
expect(cached_gem("rack-1.0.0")).not_to exist
end
diff --git a/spec/bundler/cache/git_spec.rb b/spec/bundler/cache/git_spec.rb
index 31b3816a3b..33387dbbb2 100644
--- a/spec/bundler/cache/git_spec.rb
+++ b/spec/bundler/cache/git_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "git base name" do
it "base_name should strip private repo uris" do
@@ -13,7 +12,7 @@ RSpec.describe "git base name" do
end
end
-%w(cache package).each do |cmd|
+%w[cache package].each do |cmd|
RSpec.describe "bundle #{cmd} with git" do
it "copies repository to vendor cache and uses it" do
git = build_git "foo"
@@ -23,7 +22,7 @@ end
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file
@@ -41,7 +40,7 @@ end
G
bundle "install --path vendor/bundle"
- bundle "#{cmd} --all"
+ bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
@@ -53,14 +52,14 @@ end
it "runs twice without exploding" do
build_git "foo"
- install_gemfile <<-G
+ install_gemfile! <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
- bundle "#{cmd} --all"
+ bundle! "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
+ bundle! "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
- expect(err).to lack_errors
+ expect(last_command.stdout).to include "Updating files in vendor/cache"
FileUtils.rm_rf lib_path("foo-1.0")
expect(the_bundle).to include_gems "foo 1.0"
end
@@ -73,7 +72,7 @@ end
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
update_git "foo" do |s|
s.write "lib/foo.rb", "puts :CACHE"
@@ -82,14 +81,14 @@ end
ref = git.ref_for("master", 11)
expect(ref).not_to eq(old_ref)
- bundle "update"
- bundle "#{cmd} --all"
+ bundle! "update", :all => bundle_update_requires_all?
+ bundle! "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/foo-1.0-#{old_ref}")).not_to exist
FileUtils.rm_rf lib_path("foo-1.0")
- run "require 'foo'"
+ run! "require 'foo'"
expect(out).to eq("CACHE")
end
@@ -101,7 +100,7 @@ end
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle! cmd, forgotten_command_line_options([:all, :cache_all] => true)
update_git "foo" do |s|
s.write "lib/foo.rb", "puts :CACHE"
@@ -130,7 +129,7 @@ end
bundle %(config local.foo #{lib_path("foo-1.0")})
bundle "install"
- bundle "#{cmd} --all"
+ bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-invalid-#{ref}")).to exist
@@ -162,14 +161,14 @@ end
G
ref = git.ref_for("master", 11)
- bundle "#{cmd} --all"
+ bundle "#{cmd}", forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/has_submodule-1.0-#{ref}/submodule-1.0")).to exist
expect(the_bundle).to include_gems "has_submodule 1.0"
end
- it "displays warning message when detecting git repo in Gemfile" do
+ it "displays warning message when detecting git repo in Gemfile", :bundler => "< 2" do
build_git "foo"
install_gemfile <<-G
@@ -188,8 +187,8 @@ end
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
- bundle "#{cmd}"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
+ bundle cmd
expect(out).not_to include("Your Gemfile contains path and git dependencies.")
end
@@ -205,7 +204,7 @@ end
install_gemfile <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
ref = git.ref_for("master", 11)
gemspec = bundled_app("vendor/cache/foo-1.0-#{ref}/foo.gemspec").read
diff --git a/spec/bundler/cache/path_spec.rb b/spec/bundler/cache/path_spec.rb
index bbce448759..8c6a843476 100644
--- a/spec/bundler/cache/path_spec.rb
+++ b/spec/bundler/cache/path_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-%w(cache package).each do |cmd|
+%w[cache package].each do |cmd|
RSpec.describe "bundle #{cmd} with path" do
it "is no-op when the path is within the bundle" do
build_lib "foo", :path => bundled_app("lib/foo")
@@ -10,7 +9,7 @@ require "spec_helper"
gem "foo", :path => '#{bundled_app("lib/foo")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
expect(the_bundle).to include_gems "foo 1.0"
end
@@ -22,7 +21,7 @@ require "spec_helper"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0")).to exist
expect(bundled_app("vendor/cache/foo-1.0/.bundlecache")).to be_file
@@ -40,7 +39,7 @@ require "spec_helper"
gem "#{libname}", :path => '#{libpath}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/#{libname}")).to exist
expect(bundled_app("vendor/cache/#{libname}/.bundlecache")).to be_file
@@ -55,13 +54,13 @@ require "spec_helper"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
build_lib "foo" do |s|
s.write "lib/foo.rb", "puts :CACHE"
end
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0")).to exist
FileUtils.rm_rf lib_path("foo-1.0")
@@ -77,17 +76,17 @@ require "spec_helper"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
install_gemfile <<-G
gem "bar", :path => '#{lib_path("bar-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
end
- it "raises a warning without --all" do
+ it "raises a warning without --all", :bundler => "< 2" do
build_lib "foo"
install_gemfile <<-G
@@ -106,7 +105,7 @@ require "spec_helper"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
build_lib "bar"
install_gemfile <<-G
@@ -125,7 +124,7 @@ require "spec_helper"
gem "foo", :path => '#{lib_path("foo-1.0")}'
G
- bundle "#{cmd} --all"
+ bundle cmd, forgotten_command_line_options([:all, :cache_all] => true)
build_lib "baz"
gemfile <<-G
diff --git a/spec/bundler/cache/platform_spec.rb b/spec/bundler/cache/platform_spec.rb
index ed80c949aa..c0622a3c94 100644
--- a/spec/bundler/cache/platform_spec.rb
+++ b/spec/bundler/cache/platform_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle cache with multiple platforms" do
before :each do
@@ -35,18 +34,14 @@ RSpec.describe "bundle cache with multiple platforms" do
end
it "ensures that a successful bundle install does not delete gems for other platforms" do
- bundle "install"
-
- expect(exitstatus).to eq 0 if exitstatus
+ bundle! "install"
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
end
it "ensures that a successful bundle update does not delete gems for other platforms" do
- bundle "update"
-
- expect(exitstatus).to eq 0 if exitstatus
+ bundle! "update", :all => bundle_update_requires_all?
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb
index 4931402c33..7916db960a 100644
--- a/spec/bundler/commands/add_spec.rb
+++ b/spec/bundler/commands/add_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle add" do
before :each do
@@ -82,7 +81,7 @@ RSpec.describe "bundle add" do
it "using combination of short form options works like long form" do
bundle "add 'foo' -s='file://#{gem_repo2}' -g='development' -v='~>1.0'"
- expect(bundled_app("Gemfile").read).to match(%r{gem "foo", "~> 1.0", :group => \[:development\], :source => "file:\/\/#{gem_repo2}"})
+ expect(bundled_app("Gemfile").read).to include %(gem "foo", "~> 1.0", :group => [:development], :source => "file://#{gem_repo2}")
expect(the_bundle).to include_gems "foo 1.1"
end
@@ -93,7 +92,7 @@ RSpec.describe "bundle add" do
it "shows error message when gem cannot be found" do
bundle "add 'werk_it'"
- expect(out).to match("Could not find gem 'werk_it' in any of the gem sources listed in your Gemfile.")
+ expect(out).to match("Could not find gem 'werk_it' in")
bundle "add 'werk_it' -s='file://#{gem_repo2}'"
expect(out).to match("Could not find gem 'werk_it' in rubygems repository")
diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb
index cb0999348e..0313f48b60 100644
--- a/spec/bundler/commands/binstubs_spec.rb
+++ b/spec/bundler/commands/binstubs_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle binstubs <gem>" do
context "when the gem exists in the lockfile" do
@@ -51,22 +50,130 @@ RSpec.describe "bundle binstubs <gem>" do
expect(out).to include("`bundle binstubs` needs at least one gem to run.")
end
- it "does not bundle the bundler binary" do
- install_gemfile <<-G
- source "file://#{gem_repo1}"
- G
+ context "the bundle binstub" do
+ before do
+ if system_bundler_version == :bundler
+ system_gems :bundler
+ elsif system_bundler_version
+ build_repo4 do
+ build_gem "bundler", system_bundler_version do |s|
+ s.executables = "bundle"
+ s.bindir = "exe"
+ s.write "exe/bundle", "puts %(system bundler #{system_bundler_version}\\n\#{ARGV.inspect})"
+ end
+ end
+ system_gems "bundler-#{system_bundler_version}", :gem_repo => gem_repo4
+ end
+ build_repo2 do
+ build_gem "prints_loaded_gems", "1.0" do |s|
+ s.executables = "print_loaded_gems"
+ s.write "bin/print_loaded_gems", <<-R
+ specs = Gem.loaded_specs.values.reject {|s| Bundler.rubygems.spec_default_gem?(s) }
+ puts specs.map(&:full_name).sort.inspect
+ R
+ end
+ end
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ gem "prints_loaded_gems"
+ G
+ bundle! "binstubs bundler rack prints_loaded_gems"
+ end
+
+ let(:system_bundler_version) { Bundler::VERSION }
+
+ it "runs bundler" do
+ sys_exec! "#{bundled_app("bin/bundle")} install"
+ expect(out).to eq %(system bundler #{system_bundler_version}\n["install"])
+ end
+
+ context "when BUNDLER_VERSION is set" do
+ it "runs the correct version of bundler" do
+ sys_exec "BUNDLER_VERSION='999.999.999' #{bundled_app("bin/bundle")} install"
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (999.999.999) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
+ end
+ end
+
+ context "when a lockfile exists with a locked bundler version" do
+ it "runs the correct version of bundler when the version is newer" do
+ lockfile lockfile.gsub(system_bundler_version, "999.999.999")
+ sys_exec "#{bundled_app("bin/bundle")} install"
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (999.999.999) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
+ end
+
+ it "runs the correct version of bundler when the version is older" do
+ simulate_bundler_version "55"
+ lockfile lockfile.gsub(system_bundler_version, "44.0")
+ sys_exec "#{bundled_app("bin/bundle")} install"
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (44.0) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '44.0'`")
+ end
+
+ it "runs the correct version of bundler when the version is a pre-release" do
+ simulate_bundler_version "55"
+ lockfile lockfile.gsub(system_bundler_version, "2.12.0.a")
+ sys_exec "#{bundled_app("bin/bundle")} install"
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (2.12.0.a) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '2.12.0.a'`")
+ end
+ end
+
+ context "when update --bundler is called" do
+ before { lockfile.gsub(system_bundler_version, "1.1.1") }
+
+ it "calls through to the latest bundler version" do
+ sys_exec! "#{bundled_app("bin/bundle")} update --bundler"
+ expect(last_command.stdout).to eq %(system bundler #{system_bundler_version}\n["update", "--bundler"])
+ end
+
+ it "calls through to the explicit bundler version" do
+ sys_exec "#{bundled_app("bin/bundle")} update --bundler=999.999.999"
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (999.999.999) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
+ end
+ end
+
+ context "without a lockfile" do
+ it "falls back to the latest installed bundler" do
+ FileUtils.rm bundled_app("Gemfile.lock")
+ sys_exec! bundled_app("bin/bundle").to_s
+ expect(out).to eq "system bundler #{system_bundler_version}\n[]"
+ end
+ end
+
+ context "using another binstub", :ruby_repo do
+ let(:system_bundler_version) { :bundler }
+ it "loads all gems" do
+ sys_exec! bundled_app("bin/print_loaded_gems").to_s
+ expect(out).to eq %(["bundler-#{Bundler::VERSION}", "prints_loaded_gems-1.0", "rack-1.2"])
+ end
- bundle "binstubs bundler"
+ context "when requesting a different bundler version" do
+ before { lockfile lockfile.gsub(Bundler::VERSION, "999.999.999") }
- expect(bundled_app("bin/bundle")).not_to exist
- expect(out).to include("Sorry, Bundler can only be run via Rubygems.")
+ it "attempts to load that version" do
+ sys_exec bundled_app("bin/rackup").to_s
+ expect(exitstatus).to eq(42) if exitstatus
+ expect(last_command.stderr).to include("Activating bundler (999.999.999) failed:").
+ and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
+ end
+ end
+ end
end
it "installs binstubs from git gems" do
FileUtils.mkdir_p(lib_path("foo/bin"))
FileUtils.touch(lib_path("foo/bin/foo"))
build_git "foo", "1.0", :path => lib_path("foo") do |s|
- s.executables = %w(foo)
+ s.executables = %w[foo]
end
install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo")}"
@@ -81,7 +188,7 @@ RSpec.describe "bundle binstubs <gem>" do
FileUtils.mkdir_p(lib_path("foo/bin"))
FileUtils.touch(lib_path("foo/bin/foo"))
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
- s.executables = %w(foo)
+ s.executables = %w[foo]
end
install_gemfile <<-G
gem "foo", :path => "#{lib_path("foo")}"
@@ -104,6 +211,19 @@ RSpec.describe "bundle binstubs <gem>" do
expect(File.stat(binary).mode.to_s(8)).to eq("100775")
end
end
+
+ context "when using --shebang" do
+ it "sets the specified shebang for the the binstub" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ bundle "binstubs rack --shebang jruby"
+
+ expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env jruby\n")
+ end
+ end
end
context "when the gem doesn't exist" do
@@ -131,33 +251,43 @@ RSpec.describe "bundle binstubs <gem>" do
expect(bundled_app("exec/rackup")).to exist
end
- it "setting is saved for bundle install" do
+ it "setting is saved for bundle install", :bundler => "< 2" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
gem "rails"
G
- bundle "binstubs rack --path exec"
- bundle :install
+ bundle! "binstubs rack", forgotten_command_line_options([:path, :bin] => "exec")
+ bundle! :install
expect(bundled_app("exec/rails")).to exist
end
end
- context "after installing with --standalone" do
+ context "with --standalone option" do
before do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle "install --standalone"
end
- it "includes the standalone path" do
- bundle "binstubs rack --standalone"
- standalone_line = File.read(bundled_app("bin/rackup")).each_line.find {|line| line.include? "$:.unshift" }.strip
- expect(standalone_line).to eq %($:.unshift File.expand_path "../../bundle", path.realpath)
+ it "generates a standalone binstub" do
+ bundle! "binstubs rack --standalone"
+ expect(bundled_app("bin/rackup")).to exist
+ end
+
+ it "generates a binstub that does not depend on rubygems or bundler" do
+ bundle! "binstubs rack --standalone"
+ expect(File.read(bundled_app("bin/rackup"))).to_not include("Gem.bin_path")
+ end
+
+ context "when specified --path option" do
+ it "generates a standalone binstub at the given path" do
+ bundle! "binstubs rack --standalone --path foo"
+ expect(bundled_app("foo/rackup")).to exist
+ end
end
end
diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb
index 532be07c3f..f2af446fbf 100644
--- a/spec/bundler/commands/check_spec.rb
+++ b/spec/bundler/commands/check_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle check" do
it "returns success when the Gemfile is satisfied" do
@@ -93,7 +92,7 @@ RSpec.describe "bundle check" do
expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.")
end
- it "remembers --without option from install" do
+ it "remembers --without option from install", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
group :foo do
@@ -101,9 +100,21 @@ RSpec.describe "bundle check" do
end
G
- bundle "install --without foo"
- bundle "check"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! "install --without foo"
+ bundle! "check"
+ expect(out).to include("The Gemfile's dependencies are satisfied")
+ end
+
+ it "uses the without setting" do
+ bundle! "config without foo"
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ group :foo do
+ gem "rack"
+ end
+ G
+
+ bundle! "check"
expect(out).to include("The Gemfile's dependencies are satisfied")
end
@@ -113,7 +124,7 @@ RSpec.describe "bundle check" do
gem "rack", :group => :foo
G
- bundle "install --without foo"
+ bundle :install, forgotten_command_line_options(:without => "foo")
gemfile <<-G
source "file://#{gem_repo1}"
@@ -126,8 +137,6 @@ RSpec.describe "bundle check" do
end
it "ignores missing gems restricted to other platforms" do
- system_gems "rack-1.0.0"
-
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -136,6 +145,8 @@ RSpec.describe "bundle check" do
end
G
+ system_gems "rack-1.0.0", :path => :bundle_path
+
lockfile <<-G
GEM
remote: file:#{gem_repo1}/
@@ -157,8 +168,6 @@ RSpec.describe "bundle check" do
end
it "works with env conditionals" do
- system_gems "rack-1.0.0"
-
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -167,6 +176,8 @@ RSpec.describe "bundle check" do
end
G
+ system_gems "rack-1.0.0", :path => :bundle_path
+
lockfile <<-G
GEM
remote: file:#{gem_repo1}/
@@ -211,25 +222,23 @@ RSpec.describe "bundle check" do
3.times do
bundle :check
expect(out).to eq(last_out)
- expect(err).to lack_errors
end
end
it "fails when there's no lock file and frozen is set" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "foo"
G
- bundle "install"
- bundle "install --deployment"
+ bundle! "install", forgotten_command_line_options(:deployment => true)
FileUtils.rm(bundled_app("Gemfile.lock"))
bundle :check
- expect(exitstatus).not_to eq(0) if exitstatus
+ expect(last_command).to be_failure
end
- context "--path" do
+ context "--path", :bundler => "< 2" do
before do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -241,15 +250,13 @@ RSpec.describe "bundle check" do
end
it "returns success" do
- bundle "check --path vendor/bundle"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! "check --path vendor/bundle"
expect(out).to include("The Gemfile's dependencies are satisfied")
end
- it "should write to .bundle/config" do
+ it "should write to .bundle/config", :bundler => "< 2" do
bundle "check --path vendor/bundle"
- bundle "check"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! "check"
end
end
@@ -299,7 +306,7 @@ RSpec.describe "bundle check" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -330,9 +337,8 @@ RSpec.describe "bundle check" do
context "is newer" do
it "does not change the lock but warns" do
lockfile lock_with(Bundler::VERSION.succ)
- bundle :check
- expect(out).to include("the running version of Bundler (#{Bundler::VERSION}) is older than the version that created the lockfile (#{Bundler::VERSION.succ})")
- expect(err).to lack_errors
+ bundle! :check
+ expect(last_command.bundler_err).to include("the running version of Bundler (#{Bundler::VERSION}) is older than the version that created the lockfile (#{Bundler::VERSION.succ})")
lockfile_should_be lock_with(Bundler::VERSION.succ)
end
end
diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb
index 02d96a0ff7..bab87372d1 100644
--- a/spec/bundler/commands/clean_spec.rb
+++ b/spec/bundler/commands/clean_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle clean" do
def should_have_gems(*gems)
@@ -26,16 +25,16 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
gem "thin"
G
- bundle "install"
+ bundle! "install"
- bundle :clean
+ bundle! :clean
expect(out).to include("Removing foo (1.0)")
@@ -53,7 +52,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -81,7 +80,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -89,9 +88,9 @@ RSpec.describe "bundle clean" do
gem "rack", "0.9.1"
gem "foo"
G
- bundle "install"
+ bundle! "update rack"
- bundle :clean
+ bundle! :clean
expect(out).to include("Removing rack (1.0.0)")
@@ -112,8 +111,8 @@ RSpec.describe "bundle clean" do
end
G
- bundle "install --path vendor/bundle"
- bundle "install --without test_group"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
+ bundle "install", forgotten_command_line_options(:without => "test_group")
bundle :clean
expect(out).to include("Removing rack (1.0.0)")
@@ -138,12 +137,13 @@ RSpec.describe "bundle clean" do
end
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
bundle :clean
- digest = Digest::SHA1.hexdigest(git_path.to_s)
- expect(vendored_gems("cache/bundler/git/foo-1.0-#{digest}")).to exist
+ digest = Digest(:SHA1).hexdigest(git_path.to_s)
+ cache_path = Bundler::VERSION.start_with?("1.") ? vendored_gems("cache/bundler/git/foo-1.0-#{digest}") : home(".bundle/cache/git/foo-1.0-#{digest}")
+ expect(cache_path).to exist
end
it "removes unused git gems" do
@@ -160,7 +160,7 @@ RSpec.describe "bundle clean" do
end
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
gemfile <<-G
source "file://#{gem_repo1}"
@@ -175,7 +175,7 @@ RSpec.describe "bundle clean" do
expect(vendored_gems("gems/rack-1.0.0")).to exist
expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).not_to exist
- digest = Digest::SHA1.hexdigest(git_path.to_s)
+ digest = Digest(:SHA1).hexdigest(git_path.to_s)
expect(vendored_gems("cache/bundler/git/foo-#{digest}")).not_to exist
expect(vendored_gems("specifications/rack-1.0.0.gemspec")).to exist
@@ -196,13 +196,13 @@ RSpec.describe "bundle clean" do
end
G
- bundle "install --path vendor/bundle"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle")
update_git "foo", :path => lib_path("foo-bar")
revision2 = revision_for(lib_path("foo-bar"))
- bundle "update"
- bundle :clean
+ bundle! "update", :all => bundle_update_requires_all?
+ bundle! :clean
expect(out).to include("Removing foo-bar (#{revision[0..11]})")
@@ -226,7 +226,7 @@ RSpec.describe "bundle clean" do
gem "activesupport", :git => "#{lib_path("rails")}", :ref => '#{revision}'
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
bundle :clean
expect(out).to include("")
@@ -248,13 +248,13 @@ RSpec.describe "bundle clean" do
end
end
G
- bundle "install --path vendor/bundle --without test"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :without => "test")
bundle :clean
expect(out).to include("")
expect(vendored_gems("bundler/gems/foo-#{revision[0..11]}")).to exist
- digest = Digest::SHA1.hexdigest(git_path.to_s)
+ digest = Digest(:SHA1).hexdigest(git_path.to_s)
expect(vendored_gems("cache/bundler/git/foo-#{digest}")).to_not exist
end
@@ -269,13 +269,14 @@ RSpec.describe "bundle clean" do
end
G
- bundle "install --path vendor/bundle --without development"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :without => "development")
bundle :clean
expect(exitstatus).to eq(0) if exitstatus
end
it "displays an error when used without --path" do
+ bundle! "config path.system true"
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -284,7 +285,7 @@ RSpec.describe "bundle clean" do
bundle :clean
- expect(exitstatus).to eq(1) if exitstatus
+ expect(exitstatus).to eq(15) if exitstatus
expect(out).to include("--force")
end
@@ -297,7 +298,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
gemfile <<-G
source "file://#{gem_repo1}"
@@ -319,34 +320,37 @@ RSpec.describe "bundle clean" do
end
it "does not call clean automatically when using system gems" do
- gemfile <<-G
+ bundle! "config path.system true"
+
+ bundle! :config
+
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "thin"
gem "rack"
G
- bundle :install
- gemfile <<-G
+ bundle! "info thin"
+
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :install
- sys_exec "gem list"
- expect(out).to include("rack (1.0.0)")
- expect(out).to include("thin (1.0)")
+ sys_exec! "gem list"
+ expect(out).to include("rack (1.0.0)").and include("thin (1.0)")
end
- it "--clean should override the bundle setting on install" do
+ it "--clean should override the bundle setting on install", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "thin"
gem "rack"
G
- bundle "install --path vendor/bundle --clean"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => true)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -359,7 +363,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "thin-1.0"
end
- it "--clean should override the bundle setting on update" do
+ it "--clean should override the bundle setting on update", :bundler => "< 2" do
build_repo2
gemfile <<-G
@@ -367,18 +371,42 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --clean"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => true)
update_repo2 do
build_gem "foo", "1.0.1"
end
- bundle "update"
+ bundle! "update", :all => bundle_update_requires_all?
should_have_gems "foo-1.0.1"
should_not_have_gems "foo-1.0"
end
+ it "automatically cleans when path has not been set", :bundler => "2" do
+ build_repo2
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
+
+ gem "foo"
+ G
+
+ update_repo2 do
+ build_gem "foo", "1.0.1"
+ end
+
+ bundle! "update", :all => true
+
+ files = Pathname.glob(bundled_app(".bundle", Bundler.ruby_scope, "*", "*"))
+ files.map! {|f| f.to_s.sub(bundled_app(".bundle", Bundler.ruby_scope).to_s, "") }
+ expect(files.sort).to eq %w[
+ /cache/foo-1.0.1.gem
+ /gems/foo-1.0.1
+ /specifications/foo-1.0.1.gemspec
+ ]
+ end
+
it "does not clean automatically on --path" do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -386,7 +414,7 @@ RSpec.describe "bundle clean" do
gem "thin"
gem "rack"
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
gemfile <<-G
source "file://#{gem_repo1}"
@@ -406,17 +434,19 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle")
update_repo2 do
build_gem "foo", "1.0.1"
end
- bundle :update
+ bundle! :update, :all => bundle_update_requires_all?
should_have_gems "foo-1.0", "foo-1.0.1"
end
it "does not clean on bundle update when using --system" do
+ bundle! "config path.system true"
+
build_repo2
gemfile <<-G
@@ -424,18 +454,20 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install"
+ bundle! "install"
update_repo2 do
build_gem "foo", "1.0.1"
end
- bundle :update
+ bundle! :update, :all => bundle_update_requires_all?
- sys_exec "gem list"
+ sys_exec! "gem list"
expect(out).to include("foo (1.0.1, 1.0)")
end
it "cleans system gems when --force is used" do
+ bundle! "config path.system true"
+
gemfile <<-G
source "file://#{gem_repo1}"
@@ -459,8 +491,10 @@ RSpec.describe "bundle clean" do
end
describe "when missing permissions" do
+ before { ENV["BUNDLE_PATH__SYSTEM"] = "true" }
+ let(:system_cache_path) { system_gem_path("cache") }
after do
- FileUtils.chmod(0o755, default_bundle_path("cache"))
+ FileUtils.chmod(0o755, system_cache_path)
end
it "returns a helpful error message" do
gemfile <<-G
@@ -478,7 +512,6 @@ RSpec.describe "bundle clean" do
G
bundle :install
- system_cache_path = default_bundle_path("cache")
FileUtils.chmod(0o500, system_cache_path)
bundle :clean, :force => true
@@ -502,7 +535,7 @@ RSpec.describe "bundle clean" do
gem "foo", :git => "#{lib_path("foo-1.0")}"
G
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
# mimic 7 length git revisions in Gemfile.lock
gemfile_lock = File.read(bundled_app("Gemfile.lock")).split("\n")
@@ -513,7 +546,7 @@ RSpec.describe "bundle clean" do
file.print gemfile_lock.join("\n")
end
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
bundle :clean
@@ -523,6 +556,8 @@ RSpec.describe "bundle clean" do
end
it "when using --force on system gems, it doesn't remove binaries" do
+ bundle! "config path.system true"
+
build_repo2
update_repo2 do
build_gem "bindir" do |s|
@@ -561,10 +596,8 @@ RSpec.describe "bundle clean" do
gem "bar", "1.0", :path => "#{relative_path}"
G
- bundle "install --path vendor/bundle"
- bundle :clean
-
- expect(exitstatus).to eq(0) if exitstatus
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
+ bundle! :clean
end
it "doesn't remove gems in dry-run mode with path set" do
@@ -575,7 +608,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -603,7 +636,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -633,7 +666,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
bundle "config dry_run false"
gemfile <<-G
@@ -663,7 +696,7 @@ RSpec.describe "bundle clean" do
gem "foo"
G
- bundle "install --path vendor/bundle --no-clean"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
gemfile <<-G
source "file://#{gem_repo1}"
@@ -672,8 +705,8 @@ RSpec.describe "bundle clean" do
gem "weakling"
G
- bundle "config auto_install 1"
- bundle :clean
+ bundle! "config auto_install 1"
+ bundle! :clean
expect(out).to include("Installing weakling 0.0.3")
should_have_gems "thin-1.0", "rack-1.0.0", "weakling-0.0.3"
should_not_have_gems "foo-1.0"
@@ -690,7 +723,7 @@ RSpec.describe "bundle clean" do
gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}"
G
- bundle! "install --path vendor/bundle"
+ bundle! "install", forgotten_command_line_options(:path => "vendor/bundle")
expect(vendored_gems("bundler/gems/extensions")).to exist
expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist
diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb
index a3ca696ec1..9e49357465 100644
--- a/spec/bundler/commands/config_spec.rb
+++ b/spec/bundler/commands/config_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe ".bundle/config" do
before :each do
@@ -46,7 +45,7 @@ RSpec.describe ".bundle/config" do
describe "BUNDLE_APP_CONFIG" do
it "can be moved with an environment variable" do
ENV["BUNDLE_APP_CONFIG"] = tmp("foo/bar").to_s
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
expect(bundled_app(".bundle")).not_to exist
expect(tmp("foo/bar/config")).to exist
@@ -58,7 +57,7 @@ RSpec.describe ".bundle/config" do
Dir.chdir bundled_app("omg")
ENV["BUNDLE_APP_CONFIG"] = "../foo"
- bundle "install --path vendor/bundle"
+ bundle "install", forgotten_command_line_options(:path => "vendor/bundle")
expect(bundled_app(".bundle")).not_to exist
expect(bundled_app("../foo/config")).to exist
@@ -267,7 +266,7 @@ RSpec.describe ".bundle/config" do
expect(out).to eq "bar=value"
end
- it "preferes local config over global" do
+ it "prefers local config over global" do
bundle "config --local bar value2"
bundle "config --global bar value"
bundle "config bar --parseable"
diff --git a/spec/bundler/commands/console_spec.rb b/spec/bundler/commands/console_spec.rb
index de14b6db5f..9bf66e8f5b 100644
--- a/spec/bundler/commands/console_spec.rb
+++ b/spec/bundler/commands/console_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "bundle console" do
+RSpec.describe "bundle console", :bundler => "< 2" do
before :each do
install_gemfile <<-G
source "file://#{gem_repo1}"
diff --git a/spec/bundler/commands/doctor_spec.rb b/spec/bundler/commands/doctor_spec.rb
index 7c6e48ce19..2572d4ff4d 100644
--- a/spec/bundler/commands/doctor_spec.rb
+++ b/spec/bundler/commands/doctor_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "stringio"
require "bundler/cli"
require "bundler/cli/doctor"
@@ -17,45 +17,42 @@ RSpec.describe "bundle doctor" do
end
it "exits with no message if the installed gem has no C extensions" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :install
- Bundler::CLI::Doctor.new({}).run
+ expect { Bundler::CLI::Doctor.new({}).run }.not_to raise_error
expect(@stdout.string).to be_empty
end
it "exits with no message if the installed gem's C extension dylib breakage is fine" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :install
doctor = Bundler::CLI::Doctor.new({})
expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"]
expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/lib/libSystem.dylib"]
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with("/usr/lib/libSystem.dylib").and_return(true)
- doctor.run
+ expect { doctor.run }.not_to(raise_error, @stdout.string)
expect(@stdout.string).to be_empty
end
it "exits with a message if one of the linked libraries is missing" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :install
doctor = Bundler::CLI::Doctor.new({})
expect(doctor).to receive(:bundles_for_gem).exactly(2).times.and_return ["/path/to/rack/rack.bundle"]
expect(doctor).to receive(:dylibs).exactly(2).times.and_return ["/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib"]
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with("/usr/local/opt/icu4c/lib/libicui18n.57.1.dylib").and_return(false)
- expect { doctor.run }.to raise_error Bundler::ProductionError, strip_whitespace(<<-E).strip
+ expect { doctor.run }.to raise_error(Bundler::ProductionError, strip_whitespace(<<-E).strip), @stdout.string
The following gems are missing OS dependencies:
* bundler: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
* rack: /usr/local/opt/icu4c/lib/libicui18n.57.1.dylib
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index 7736adefe1..077e1b03a2 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/commands/exec_spec.rb
@@ -1,10 +1,9 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle exec" do
- let(:system_gems_to_install) { %w(rack-1.0.0 rack-0.9.1) }
+ let(:system_gems_to_install) { %w[rack-1.0.0 rack-0.9.1] }
before :each do
- system_gems(system_gems_to_install)
+ system_gems(system_gems_to_install, :path => :bundle_path)
end
it "activates the correct gem" do
@@ -138,7 +137,7 @@ RSpec.describe "bundle exec" do
end
it "handles gems installed with --without" do
- install_gemfile <<-G, :without => :middleware
+ install_gemfile <<-G, forgotten_command_line_options(:without => "middleware")
source "file://#{gem_repo1}"
gem "rack" # rack 0.9.1 and 1.0 exist
@@ -217,6 +216,7 @@ RSpec.describe "bundle exec" do
end
it "raises a helpful error when exec'ing to something outside of the bundle", :ruby_repo, :rubygems => ">= 2.5.2" do
+ bundle! "config clean false" # want to keep the rackup binstub
install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "with_license"
@@ -224,7 +224,7 @@ RSpec.describe "bundle exec" do
[true, false].each do |l|
bundle! "config disable_exec_load #{l}"
bundle "exec rackup"
- expect(err).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
+ expect(last_command.stderr).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
end
end
@@ -238,7 +238,7 @@ RSpec.describe "bundle exec" do
[true, false].each do |l|
bundle! "config disable_exec_load #{l}"
bundle "exec rackup"
- expect(err).to include "rack is not part of the bundle. Add it to your Gemfile."
+ expect(last_command.stderr).to include "rack is not part of the bundle. Add it to your Gemfile."
end
end
@@ -518,8 +518,8 @@ RSpec.describe "bundle exec" do
it "like a normally executed executable" do
subject
expect(exitstatus).to eq(exit_code) if exitstatus
- expect(err).to eq(expected_err)
- expect(out).to eq(expected)
+ expect(last_command.stderr).to eq(expected_err)
+ expect(last_command.stdout).to eq(expected)
end
end
@@ -538,7 +538,27 @@ RSpec.describe "bundle exec" do
end
end
- context "the executable is empty" do
+ context "the executable exits by SignalException" do
+ let(:executable) do
+ ex = super()
+ ex << "\n"
+ if LessThanProc.with(RUBY_VERSION).call("1.9")
+ # Ruby < 1.9 needs a flush for a exit by signal, later
+ # rubies do not
+ ex << "STDOUT.flush\n"
+ end
+ ex << "raise SignalException, 'SIGTERM'\n"
+ ex
+ end
+ let(:exit_code) do
+ # signal mask 128 + plus signal 15 -> TERM
+ # this is specified by C99
+ 128 + 15
+ end
+ it_behaves_like "it runs"
+ end
+
+ context "the executable is empty", :bundler => "< 2" do
let(:executable) { "" }
let(:exit_code) { 0 }
@@ -553,7 +573,16 @@ RSpec.describe "bundle exec" do
end
end
- context "the executable raises" do
+ context "the executable is empty", :bundler => "2" do
+ let(:executable) { "" }
+
+ let(:exit_code) { 0 }
+ let(:expected_err) { "#{path} is empty" }
+ let(:expected) { "" }
+ it_behaves_like "it runs"
+ end
+
+ context "the executable raises", :bundler => "< 2" do
let(:executable) { super() << "\nraise 'ERROR'" }
let(:exit_code) { 1 }
let(:expected) { super() << "\nbundler: failed to load command: #{path} (#{path})" }
@@ -564,12 +593,22 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
+ context "the executable raises", :bundler => "2" do
+ let(:executable) { super() << "\nraise 'ERROR'" }
+ let(:exit_code) { 1 }
+ let(:expected_err) do
+ "bundler: failed to load command: #{path} (#{path})" \
+ "\nRuntimeError: ERROR\n #{path}:10:in `<top (required)>'"
+ end
+ it_behaves_like "it runs"
+ end
+
context "when the file uses the current ruby shebang", :ruby_repo do
let(:shebang) { "#!#{Gem.ruby}" }
it_behaves_like "it runs"
end
- context "when Bundler.setup fails" do
+ context "when Bundler.setup fails", :bundler => "< 2" do
before do
gemfile <<-G
gem 'rack', '2'
@@ -586,6 +625,24 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
+ context "when Bundler.setup fails", :bundler => "2" do
+ before do
+ gemfile <<-G
+ gem 'rack', '2'
+ G
+ ENV["BUNDLER_FORCE_TTY"] = "true"
+ end
+
+ let(:exit_code) { Bundler::GemNotFound.new.status_code }
+ let(:expected) { <<-EOS.strip }
+\e[31mCould not find gem 'rack (= 2)' in locally installed gems.
+The source contains 'rack' at: 1.0.0\e[0m
+\e[33mRun `bundle install` to install missing gems.\e[0m
+ EOS
+
+ it_behaves_like "it runs"
+ end
+
context "when the executable exits non-zero via at_exit" do
let(:executable) { super() + "\n\nat_exit { $! ? raise($!) : exit(1) }" }
let(:exit_code) { 1 }
@@ -729,7 +786,7 @@ __FILE__: #{path.to_s.inspect}
# sanity check that we get the newer, custom version without bundler
sys_exec("#{Gem.ruby} #{file}")
- expect(err).to include("custom openssl should not be loaded")
+ expect(last_command.stderr).to include("custom openssl should not be loaded")
end
end
end
diff --git a/spec/bundler/commands/help_spec.rb b/spec/bundler/commands/help_spec.rb
index 6faeed058e..cd6f13756c 100644
--- a/spec/bundler/commands/help_spec.rb
+++ b/spec/bundler/commands/help_spec.rb
@@ -1,8 +1,7 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle help" do
- # Rubygems 1.4+ no longer load gem plugins so this test is no longer needed
+ # RubyGems 1.4+ no longer load gem plugins so this test is no longer needed
it "complains if older versions of bundler are installed", :rubygems => "< 1.4" do
system_gems "bundler-0.8.1"
diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb
index cdfea983dc..a9ab8fc210 100644
--- a/spec/bundler/commands/info_spec.rb
+++ b/spec/bundler/commands/info_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle info" do
context "info from specific gem in gemfile" do
diff --git a/spec/bundler/commands/init_spec.rb b/spec/bundler/commands/init_spec.rb
index 6ab7e25cc3..0441e62e13 100644
--- a/spec/bundler/commands/init_spec.rb
+++ b/spec/bundler/commands/init_spec.rb
@@ -1,10 +1,16 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle init" do
- it "generates a Gemfile" do
- bundle :init
- expect(bundled_app("Gemfile")).to exist
+ it "generates a Gemfile", :bundler => "< 2" do
+ bundle! :init
+ expect(out).to include("Writing new Gemfile")
+ expect(bundled_app("Gemfile")).to be_file
+ end
+
+ it "generates a gems.rb", :bundler => "2" do
+ bundle! :init
+ expect(out).to include("Writing new gems.rb")
+ expect(bundled_app("gems.rb")).to be_file
end
context "when a Gemfile already exists" do
@@ -24,7 +30,24 @@ RSpec.describe "bundle init" do
end
end
- context "given --gemspec option" do
+ context "when a gems.rb already exists" do
+ before do
+ create_file "gems.rb", <<-G
+ gem "rails"
+ G
+ end
+
+ it "does not change existing gem.rb files" do
+ expect { bundle :init }.not_to change { File.read(bundled_app("gems.rb")) }
+ end
+
+ it "notifies the user that an existing gems.rb already exists" do
+ bundle :init
+ expect(out).to include("gems.rb already exists")
+ end
+ end
+
+ context "given --gemspec option", :bundler => "< 2" do
let(:spec_file) { tmp.join("test.gemspec") }
it "should generate from an existing gemspec" do
@@ -40,7 +63,11 @@ RSpec.describe "bundle init" do
bundle :init, :gemspec => spec_file
- gemfile = bundled_app("Gemfile").read
+ gemfile = if Bundler::VERSION[0, 2] == "1."
+ bundled_app("Gemfile").read
+ else
+ bundled_app("gems.rb").read
+ end
expect(gemfile).to match(%r{source 'https://rubygems.org'})
expect(gemfile.scan(/gem "rack", "= 1.0.1"/).size).to eq(1)
expect(gemfile.scan(/gem "rspec", "= 1.2"/).size).to eq(1)
@@ -59,7 +86,65 @@ RSpec.describe "bundle init" do
end
bundle :init, :gemspec => spec_file
- expect(out).to include("There was an error while loading `test.gemspec`")
+ expect(last_command.bundler_err).to include("There was an error while loading `test.gemspec`")
+ end
+ end
+ end
+
+ context "when init_gems_rb setting is enabled" do
+ before { bundle "config init_gems_rb true" }
+
+ it "generates a gems.rb file" do
+ bundle :init
+ expect(bundled_app("gems.rb")).to exist
+ end
+
+ context "when gems.rb already exists" do
+ before do
+ create_file("gems.rb", <<-G)
+ gem "rails"
+ G
+ end
+
+ it "does not change existing Gemfiles" do
+ expect { bundle :init }.not_to change { File.read(bundled_app("gems.rb")) }
+ end
+
+ it "notifies the user that an existing gems.rb already exists" do
+ bundle :init
+ expect(out).to include("gems.rb already exists")
+ end
+ end
+
+ context "given --gemspec option", :bundler => "< 2" do
+ let(:spec_file) { tmp.join("test.gemspec") }
+
+ before do
+ File.open(spec_file, "w") do |file|
+ file << <<-S
+ Gem::Specification.new do |s|
+ s.name = 'test'
+ s.add_dependency 'rack', '= 1.0.1'
+ s.add_development_dependency 'rspec', '1.2'
+ end
+ S
+ end
+ end
+
+ it "should generate from an existing gemspec" do
+ bundle :init, :gemspec => spec_file
+
+ gemfile = bundled_app("gems.rb").read
+ expect(gemfile).to match(%r{source 'https://rubygems.org'})
+ expect(gemfile.scan(/gem "rack", "= 1.0.1"/).size).to eq(1)
+ expect(gemfile.scan(/gem "rspec", "= 1.2"/).size).to eq(1)
+ expect(gemfile.scan(/group :development/).size).to eq(1)
+ end
+
+ it "prints message to user" do
+ bundle :init, :gemspec => spec_file
+
+ expect(out).to include("Writing new gems.rb")
end
end
end
diff --git a/spec/bundler/commands/inject_spec.rb b/spec/bundler/commands/inject_spec.rb
index dd0f1348cc..6c1994b59d 100644
--- a/spec/bundler/commands/inject_spec.rb
+++ b/spec/bundler/commands/inject_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "bundle inject" do
+RSpec.describe "bundle inject", :bundler => "< 2" do
before :each do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -80,7 +79,11 @@ Usage: "bundle inject GEM VERSION"
context "when frozen" do
before do
bundle "install"
- bundle "config --local frozen 1"
+ if Bundler.feature_flag.bundler_2_mode?
+ bundle! "config --local deployment true"
+ else
+ bundle! "config --local frozen true"
+ end
end
it "injects anyway" do
@@ -97,7 +100,7 @@ Usage: "bundle inject GEM VERSION"
it "restores frozen afterwards" do
bundle "inject 'rack-obama' '> 0'"
config = YAML.load(bundled_app(".bundle/config").read)
- expect(config["BUNDLE_FROZEN"]).to eq("1")
+ expect(config["BUNDLE_DEPLOYMENT"] || config["BUNDLE_FROZEN"]).to eq("true")
end
it "doesn't allow Gemfile changes" do
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index 2d67a39f1e..4cb8584633 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with gem sources" do
describe "the simple case" do
@@ -17,8 +16,7 @@ RSpec.describe "bundle install with gem sources" do
raise StandardError, "FAIL"
G
- expect(err).to lack_errors
- expect(out).to match(/StandardError, "FAIL"/)
+ expect(last_command.bundler_err).to include('StandardError, "FAIL"')
expect(bundled_app("Gemfile.lock")).not_to exist
end
@@ -31,13 +29,23 @@ RSpec.describe "bundle install with gem sources" do
expect(bundled_app("Gemfile.lock")).to exist
end
- it "does not create ./.bundle by default" do
+ it "does not create ./.bundle by default", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :install # can't use install_gemfile since it sets retry
+ bundle! :install # can't use install_gemfile since it sets retry
+ expect(bundled_app(".bundle")).not_to exist
+ end
+
+ it "does not create ./.bundle by default when installing to system gems" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ bundle! :install, :env => { "BUNDLE_PATH__SYSTEM" => true } # can't use install_gemfile since it sets retry
expect(bundled_app(".bundle")).not_to exist
end
@@ -168,7 +176,7 @@ RSpec.describe "bundle install with gem sources" do
end
it "does not reinstall any gem that is already available locally" do
- system_gems "activesupport-2.3.2"
+ system_gems "activesupport-2.3.2", :path => :bundle_path
build_repo2 do
build_gem "activesupport", "2.3.2" do |s|
@@ -185,7 +193,7 @@ RSpec.describe "bundle install with gem sources" do
end
it "works when the gemfile specifies gems that only exist in the system" do
- build_gem "foo", :to_system => true
+ build_gem "foo", :to_bundle => true
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -196,7 +204,7 @@ RSpec.describe "bundle install with gem sources" do
end
it "prioritizes local gems over remote gems" do
- build_gem "rack", "1.0.0", :to_system => true do |s|
+ build_gem "rack", "1.0.0", :to_bundle => true do |s|
s.add_dependency "activesupport", "2.3.5"
end
@@ -263,26 +271,26 @@ RSpec.describe "bundle install with gem sources" do
end
it "works" do
- bundle "install --path vendor"
+ bundle "install", forgotten_command_line_options(:path => "vendor")
expect(the_bundle).to include_gems "rack 1.0"
end
- it "allows running bundle install --system without deleting foo" do
- bundle "install --path vendor"
- bundle "install --system"
+ it "allows running bundle install --system without deleting foo", :bundler => "< 2" do
+ bundle "install", forgotten_command_line_options(:path => "vendor")
+ bundle "install", forgotten_command_line_options(:system => true)
FileUtils.rm_rf(bundled_app("vendor"))
expect(the_bundle).to include_gems "rack 1.0"
end
- it "allows running bundle install --system after deleting foo" do
- bundle "install --path vendor"
+ it "allows running bundle install --system after deleting foo", :bundler => "< 2" do
+ bundle "install", forgotten_command_line_options(:path => "vendor")
FileUtils.rm_rf(bundled_app("vendor"))
- bundle "install --system"
+ bundle "install", forgotten_command_line_options(:system => true)
expect(the_bundle).to include_gems "rack 1.0"
end
end
- it "finds gems in multiple sources" do
+ it "finds gems in multiple sources", :bundler => "< 2" do
build_repo2
update_repo2
@@ -316,9 +324,9 @@ RSpec.describe "bundle install with gem sources" do
it "gracefully handles error when rubygems server is unavailable" do
install_gemfile <<-G, :artifice => nil
source "file://#{gem_repo1}"
- source "http://localhost:9384"
-
- gem 'foo'
+ source "http://localhost:9384" do
+ gem 'foo'
+ end
G
bundle :install, :artifice => nil
@@ -345,9 +353,8 @@ RSpec.describe "bundle install with gem sources" do
gem "ajp-rails", "0.0.0"
G
- expect(out).not_to match(/Error Report/i)
- expect(err).not_to match(/Error Report/i)
- expect(out).to include("An error occurred while installing ajp-rails (0.0.0), and Bundler cannot continue.").
+ expect(last_command.stdboth).not_to match(/Error Report/i)
+ expect(last_command.bundler_err).to include("An error occurred while installing ajp-rails (0.0.0), and Bundler cannot continue.").
and include("Make sure that `gem install ajp-rails -v '0.0.0'` succeeds before bundling.")
end
@@ -382,10 +389,10 @@ RSpec.describe "bundle install with gem sources" do
context "and using an unsupported Ruby version" do
it "prints an error" do
install_gemfile <<-G
- ::RUBY_VERSION = '1.8.7'
- ruby '~> 2.1'
+ ::RUBY_VERSION = '2.0.1'
+ ruby '~> 2.2'
G
- expect(out).to include("Your Ruby version is 1.8.7, but your Gemfile specified ~> 2.1")
+ expect(out).to include("Your Ruby version is 2.0.1, but your Gemfile specified ~> 2.2")
end
end
@@ -404,7 +411,7 @@ RSpec.describe "bundle install with gem sources" do
specs:
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
@@ -428,7 +435,7 @@ RSpec.describe "bundle install with gem sources" do
specs:
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
@@ -489,17 +496,34 @@ RSpec.describe "bundle install with gem sources" do
it "should display a proper message to explain the problem" do
FileUtils.chmod(0o500, bundled_app("vendor"))
- bundle :install, :path => "vendor"
+ bundle :install, forgotten_command_line_options(:path => "vendor")
expect(out).to include(bundled_app("vendor").to_s)
expect(out).to include("grant write permissions")
end
end
+ context "after installing with --standalone" do
+ before do
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ forgotten_command_line_options(:path => "bundle")
+ bundle! "install", :standalone => true
+ end
+
+ it "includes the standalone path" do
+ bundle! "binstubs rack", :standalone => true
+ standalone_line = File.read(bundled_app("bin/rackup")).each_line.find {|line| line.include? "$:.unshift" }.strip
+ expect(standalone_line).to eq %($:.unshift File.expand_path "../../bundle", path.realpath)
+ end
+ end
+
describe "when bundle install is executed with unencoded authentication" do
before do
gemfile <<-G
source 'https://rubygems.org/'
- gem 'bundler'
+ gem "."
G
end
diff --git a/spec/bundler/commands/issue_spec.rb b/spec/bundler/commands/issue_spec.rb
index 056ef0f300..04c575130e 100644
--- a/spec/bundler/commands/issue_spec.rb
+++ b/spec/bundler/commands/issue_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle issue" do
it "exits with a message" do
diff --git a/spec/bundler/commands/licenses_spec.rb b/spec/bundler/commands/licenses_spec.rb
index 0ee1a46945..144931fb27 100644
--- a/spec/bundler/commands/licenses_spec.rb
+++ b/spec/bundler/commands/licenses_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle licenses" do
before :each do
diff --git a/spec/bundler/commands/list_spec.rb b/spec/bundler/commands/list_spec.rb
new file mode 100644
index 0000000000..0ea70f015c
--- /dev/null
+++ b/spec/bundler/commands/list_spec.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+RSpec.describe "bundle list", :bundler => "2" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ end
+
+ context "with name-only option" do
+ it "prints only the name of the gems in the bundle" do
+ bundle "list --name-only"
+ expect(out).to eq "rack"
+ end
+ end
+
+ context "when no gems are in the gemfile" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ G
+ end
+
+ it "prints message saying no gems are in the bundle" do
+ bundle "list"
+ expect(out).to include("No gems in the Gemfile")
+ end
+ end
+
+ it "lists gems installed in the bundle" do
+ bundle "list"
+ expect(out).to include(" * rack (1.0.0)")
+ end
+
+ it "aliases the ls command to list" do
+ bundle "ls"
+ expect(out).to include("Gems included by the bundle")
+ end
+end
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 5c15b6a7f6..b16a828cad 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle lock" do
def strip_lockfile(lockfile)
@@ -44,7 +43,7 @@ RSpec.describe "bundle lock" do
with_license (1.0)
PLATFORMS
- #{local}
+ #{lockfile_platforms}
DEPENDENCIES
foo
@@ -59,7 +58,7 @@ RSpec.describe "bundle lock" do
it "prints a lockfile when there is no existing lockfile with --print" do
bundle "lock --print"
- expect(out).to include(@lockfile)
+ expect(out).to eq(@lockfile)
end
it "prints a lockfile when there is an existing lockfile with --print" do
@@ -87,7 +86,7 @@ RSpec.describe "bundle lock" do
it "does not fetch remote specs when using the --local option" do
bundle "lock --update --local"
- expect(out).to include("sources listed in your Gemfile")
+ expect(out).to match(/sources listed in your Gemfile|installed locally/)
end
it "writes to a custom location using --lockfile" do
@@ -120,17 +119,17 @@ RSpec.describe "bundle lock" do
context "conservative updates" do
before do
build_repo4 do
- build_gem "foo", %w(1.4.3 1.4.4) do |s|
+ build_gem "foo", %w[1.4.3 1.4.4] do |s|
s.add_dependency "bar", "~> 2.0"
end
- build_gem "foo", %w(1.4.5 1.5.0) do |s|
+ build_gem "foo", %w[1.4.5 1.5.0] do |s|
s.add_dependency "bar", "~> 2.1"
end
- build_gem "foo", %w(1.5.1) do |s|
+ build_gem "foo", %w[1.5.1] do |s|
s.add_dependency "bar", "~> 3.0"
end
- build_gem "bar", %w(2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0)
- build_gem "qux", %w(1.0.0 1.0.1 1.1.0 2.0.0)
+ build_gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
+ build_gem "qux", %w[1.0.0 1.0.1 1.1.0 2.0.0]
end
# establish a lockfile set to 1.4.3
@@ -153,13 +152,13 @@ RSpec.describe "bundle lock" do
it "single gem updates dependent gem to minor" do
bundle "lock --update foo --patch"
- expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w(foo-1.4.5 bar-2.1.1 qux-1.0.0).sort)
+ expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[foo-1.4.5 bar-2.1.1 qux-1.0.0].sort)
end
it "minor preferred with strict" do
bundle "lock --update --minor --strict"
- expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w(foo-1.5.0 bar-2.1.1 qux-1.1.0).sort)
+ expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[foo-1.5.0 bar-2.1.1 qux-1.1.0].sort)
end
end
@@ -167,13 +166,13 @@ RSpec.describe "bundle lock" do
bundle! "lock --add-platform java x86-mingw32"
lockfile = Bundler::LockfileParser.new(read_lockfile)
- expect(lockfile.platforms).to eq([java, local, mingw])
+ expect(lockfile.platforms).to match_array(local_platforms.unshift(java, mingw).uniq)
end
it "supports adding the `ruby` platform" do
bundle! "lock --add-platform ruby"
lockfile = Bundler::LockfileParser.new(read_lockfile)
- expect(lockfile.platforms).to eq([local, "ruby"].uniq)
+ expect(lockfile.platforms).to match_array(local_platforms.unshift("ruby").uniq)
end
it "warns when adding an unknown platform" do
@@ -185,17 +184,17 @@ RSpec.describe "bundle lock" do
bundle! "lock --add-platform java x86-mingw32"
lockfile = Bundler::LockfileParser.new(read_lockfile)
- expect(lockfile.platforms).to eq([java, local, mingw])
+ expect(lockfile.platforms).to match_array(local_platforms.unshift(java, mingw).uniq)
bundle! "lock --remove-platform java"
lockfile = Bundler::LockfileParser.new(read_lockfile)
- expect(lockfile.platforms).to eq([local, mingw])
+ expect(lockfile.platforms).to match_array(local_platforms.unshift(mingw).uniq)
end
it "errors when removing all platforms" do
- bundle "lock --remove-platform #{local}"
- expect(out).to include("Removing all platforms from the bundle is not allowed")
+ bundle "lock --remove-platform #{local_platforms.join(" ")}"
+ expect(last_command.bundler_err).to include("Removing all platforms from the bundle is not allowed")
end
# from https://github.com/bundler/bundler/issues/4896
@@ -221,7 +220,7 @@ RSpec.describe "bundle lock" do
# we need all these versions to get the sorting the same as it would be
# pulling from rubygems.org
- %w(0.8.3 0.8.2 0.8.1 0.8.0).each do |v|
+ %w[0.8.3 0.8.2 0.8.1 0.8.0].each do |v|
build_gem "win32-process", v do |s|
s.add_dependency "ffi", ">= 1.0.0"
end
diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb
index e9c19005eb..dcd89391a4 100644
--- a/spec/bundler/commands/newgem_spec.rb
+++ b/spec/bundler/commands/newgem_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle gem" do
def reset!
@@ -166,10 +165,10 @@ RSpec.describe "bundle gem" do
expect(bundled_app("test_gem/.git")).to exist
end
- context "when git is not avaiable" do
+ context "when git is not available" do
let(:gem_name) { "test_gem" }
- # This spec cannot have `git` avaiable in the test env
+ # This spec cannot have `git` available in the test env
before do
load_paths = [lib, spec]
load_path_str = "-I#{load_paths.join(File::PATH_SEPARATOR)}"
@@ -191,8 +190,6 @@ RSpec.describe "bundle gem" do
end
it "generates a valid gemspec" do
- system_gems ["rake-10.0.2"]
-
in_app_root
bundle "gem newgem --bin"
@@ -214,12 +211,11 @@ RSpec.describe "bundle gem" do
end
Dir.chdir(bundled_app("newgem")) do
- bundle "exec rake build"
+ system_gems ["rake-10.0.2"], :path => :bundle_path
+ bundle! "exec rake build"
end
- expect(exitstatus).to be_zero if exitstatus
- expect(out).not_to include("ERROR")
- expect(err).not_to include("ERROR")
+ expect(last_command.stdboth).not_to include("ERROR")
end
context "gem naming with relative paths" do
@@ -785,24 +781,24 @@ RSpec.describe "bundle gem" do
it "fails gracefully with a ." do
bundle "gem foo.gemspec"
- expect(out).to end_with("Invalid gem name foo.gemspec -- `Foo.gemspec` is an invalid constant name")
+ expect(last_command.bundler_err).to end_with("Invalid gem name foo.gemspec -- `Foo.gemspec` is an invalid constant name")
end
it "fails gracefully with a ^" do
bundle "gem ^"
- expect(out).to end_with("Invalid gem name ^ -- `^` is an invalid constant name")
+ expect(last_command.bundler_err).to end_with("Invalid gem name ^ -- `^` is an invalid constant name")
end
it "fails gracefully with a space" do
bundle "gem 'foo bar'"
- expect(out).to end_with("Invalid gem name foo bar -- `Foo bar` is an invalid constant name")
+ expect(last_command.bundler_err).to end_with("Invalid gem name foo bar -- `Foo bar` is an invalid constant name")
end
it "fails gracefully when multiple names are passed" do
bundle "gem foo bar baz"
- expect(out).to eq(<<-E.strip)
+ expect(last_command.bundler_err).to eq(<<-E.strip)
ERROR: "bundle gem" was called with arguments ["foo", "bar", "baz"]
-Usage: "bundle gem GEM [OPTIONS]"
+Usage: "bundle gem NAME [OPTIONS]"
E
end
end
@@ -890,8 +886,8 @@ Usage: "bundle gem GEM [OPTIONS]"
in_app_root do
FileUtils.touch("conflict-foobar")
end
- output = bundle "gem conflict-foobar"
- expect(output).to include("Errno::ENOTDIR")
+ bundle "gem conflict-foobar"
+ expect(last_command.bundler_err).to include("Errno::ENOTDIR")
expect(exitstatus).to eql(32) if exitstatus
end
end
@@ -902,7 +898,7 @@ Usage: "bundle gem GEM [OPTIONS]"
FileUtils.mkdir_p("conflict-foobar/Gemfile")
end
bundle! "gem conflict-foobar"
- expect(out).to include("file_clash conflict-foobar/Gemfile").
+ expect(last_command.stdout).to include("file_clash conflict-foobar/Gemfile").
and include "Initializing git repo in #{bundled_app("conflict-foobar")}"
end
end
diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb
index 6872e859d2..5cab846fb5 100644
--- a/spec/bundler/commands/open_spec.rb
+++ b/spec/bundler/commands/open_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle open" do
before :each do
diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb
index c6b6c9f59e..f0ad136c98 100644
--- a/spec/bundler/commands/outdated_spec.rb
+++ b/spec/bundler/commands/outdated_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle outdated" do
before :each do
@@ -192,6 +191,8 @@ RSpec.describe "bundle outdated" do
build_gem "activesupport", "2.3.4"
end
+ bundle! "config clean false"
+
install_gemfile <<-G
source "file://#{gem_repo2}"
gem "activesupport", "2.3.4"
@@ -334,7 +335,7 @@ RSpec.describe "bundle outdated" do
G
update_repo2 do
- build_gem "activesupport", %w(2.4.0 3.0.0)
+ build_gem "activesupport", %w[2.4.0 3.0.0]
build_gem "weakling", "0.0.5"
end
@@ -352,7 +353,7 @@ RSpec.describe "bundle outdated" do
G
update_repo2 do
- build_gem "activesupport", %w(2.3.9)
+ build_gem "activesupport", %w[2.3.9]
build_gem "weakling", "0.1.5"
end
@@ -370,7 +371,7 @@ RSpec.describe "bundle outdated" do
G
update_repo2 do
- build_gem "activesupport", %w(2.4.0 2.5.0)
+ build_gem "activesupport", %w[2.4.0 2.5.0]
build_gem "weakling", "1.1.5"
end
@@ -406,9 +407,9 @@ RSpec.describe "bundle outdated" do
expect(out).to include("Installing foo 1.0")
end
- context "after bundle install --deployment" do
+ context "after bundle install --deployment", :bundler => "< 2" do
before do
- install_gemfile <<-G, :deployment => true
+ install_gemfile <<-G, forgotten_command_line_options(:deployment => true)
source "file://#{gem_repo2}"
gem "rack"
@@ -420,7 +421,7 @@ RSpec.describe "bundle outdated" do
update_repo2 { build_gem "activesupport", "3.0" }
bundle "outdated"
- expect(exitstatus).to_not be_zero if exitstatus
+ expect(last_command).to be_failure
expect(out).to include("You are trying to check outdated gems in deployment mode.")
expect(out).to include("Run `bundle outdated` elsewhere.")
expect(out).to include("If this is a development machine, remove the ")
@@ -428,6 +429,29 @@ RSpec.describe "bundle outdated" do
end
end
+ context "after bundle config deployment true" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "rack"
+ gem "foo"
+ G
+ bundle! "config deployment true"
+ end
+
+ it "outputs a helpful message about being in deployment mode" do
+ update_repo2 { build_gem "activesupport", "3.0" }
+
+ bundle "outdated"
+ expect(last_command).to be_failure
+ expect(out).to include("You are trying to check outdated gems in deployment mode.")
+ expect(out).to include("Run `bundle outdated` elsewhere.")
+ expect(out).to include("If this is a development machine, remove the ")
+ expect(out).to include("Gemfile freeze\nby running `bundle config --delete deployment`.")
+ end
+ end
+
context "update available for a gem on a different platform" do
before do
install_gemfile <<-G
@@ -629,9 +653,9 @@ RSpec.describe "bundle outdated" do
context "without update-strict" do
before do
build_repo4 do
- build_gem "patch", %w(1.0.0 1.0.1)
- build_gem "minor", %w(1.0.0 1.0.1 1.1.0)
- build_gem "major", %w(1.0.0 1.0.1 1.1.0 2.0.0)
+ build_gem "patch", %w[1.0.0 1.0.1]
+ build_gem "minor", %w[1.0.0 1.0.1 1.1.0]
+ build_gem "major", %w[1.0.0 1.0.1 1.1.0 2.0.0]
end
# establish a lockfile set to 1.0.0
@@ -689,17 +713,17 @@ RSpec.describe "bundle outdated" do
context "with update-strict" do
before do
build_repo4 do
- build_gem "foo", %w(1.4.3 1.4.4) do |s|
+ build_gem "foo", %w[1.4.3 1.4.4] do |s|
s.add_dependency "bar", "~> 2.0"
end
- build_gem "foo", %w(1.4.5 1.5.0) do |s|
+ build_gem "foo", %w[1.4.5 1.5.0] do |s|
s.add_dependency "bar", "~> 2.1"
end
- build_gem "foo", %w(1.5.1) do |s|
+ build_gem "foo", %w[1.5.1] do |s|
s.add_dependency "bar", "~> 3.0"
end
- build_gem "bar", %w(2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0)
- build_gem "qux", %w(1.0.0 1.1.0 2.0.0)
+ build_gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
+ build_gem "qux", %w[1.0.0 1.1.0 2.0.0]
end
# establish a lockfile set to 1.4.3
diff --git a/spec/bundler/commands/package_spec.rb b/spec/bundler/commands/package_spec.rb
index 86c09db3ca..6351909bc7 100644
--- a/spec/bundler/commands/package_spec.rb
+++ b/spec/bundler/commands/package_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle package" do
context "with --gemfile" do
@@ -25,7 +24,7 @@ RSpec.describe "bundle package" do
gem 'bundler'
D
- bundle "package --all"
+ bundle :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/bundler-0.9.gem")).to_not exist
@@ -55,7 +54,7 @@ RSpec.describe "bundle package" do
gemspec
D
- bundle! "package --all"
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -86,7 +85,7 @@ RSpec.describe "bundle package" do
gemspec
D
- bundle! "package --all"
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -130,7 +129,7 @@ RSpec.describe "bundle package" do
gemspec :name => 'mygem_test'
D
- bundle! "package --all"
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist
@@ -142,14 +141,14 @@ RSpec.describe "bundle package" do
end
end
- context "with --path" do
+ context "with --path", :bundler => "< 2" do
it "sets root directory for gems" do
gemfile <<-D
source "file://#{gem_repo1}"
gem 'rack'
D
- bundle "package --path=#{bundled_app("test")}"
+ bundle! :package, forgotten_command_line_options(:path => bundled_app("test"))
expect(the_bundle).to include_gems "rack 1.0.0"
expect(bundled_app("test/vendor/cache/")).to exist
@@ -163,7 +162,7 @@ RSpec.describe "bundle package" do
gem 'rack'
D
- bundle "package --no-install"
+ bundle! "package --no-install"
expect(the_bundle).not_to include_gems "rack 1.0.0"
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
@@ -175,8 +174,8 @@ RSpec.describe "bundle package" do
gem 'rack'
D
- bundle "package --no-install"
- bundle "install"
+ bundle! "package --no-install"
+ bundle! "install"
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -203,9 +202,10 @@ RSpec.describe "bundle package" do
bundle "install"
end
- subject { bundle "package --frozen" }
+ subject { bundle :package, forgotten_command_line_options(:frozen => true) }
it "tries to install with frozen" do
+ bundle! "config deployment true"
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -217,7 +217,7 @@ RSpec.describe "bundle package" do
expect(out).to include("You have added to the Gemfile")
expect(out).to include("* rack-obama")
bundle "env"
- expect(out).to include("frozen")
+ expect(out).to include("frozen").or include("deployment")
end
end
end
@@ -241,16 +241,16 @@ RSpec.describe "bundle install with gem sources" do
it "does not hit the remote at all" do
build_repo2
- install_gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "rack"
G
- bundle :pack
+ bundle! :pack
simulate_new_machine
FileUtils.rm_rf gem_repo2
- bundle "install --deployment"
+ bundle! :install, forgotten_command_line_options(:deployment => true, :path => "vendor/bundle")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/bundler/commands/pristine_spec.rb b/spec/bundler/commands/pristine_spec.rb
index 3aca313e0f..ee75934380 100644
--- a/spec/bundler/commands/pristine_spec.rb
+++ b/spec/bundler/commands/pristine_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-require "fileutils"
+
+require "bundler/vendored_fileutils"
RSpec.describe "bundle pristine", :ruby_repo do
before :each do
@@ -28,7 +28,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
G
end
- context "when sourced from Rubygems" do
+ context "when sourced from RubyGems" do
it "reverts using cached .gem file" do
spec = Bundler.definition.specs["weakling"].first
changes_txt = Pathname.new(spec.full_gem_path).join("lib/changes.txt")
@@ -55,12 +55,23 @@ RSpec.describe "bundle pristine", :ruby_repo do
changed_file = Pathname.new(spec.full_gem_path).join("lib/foo.rb")
diff = "#Pristine spec changes"
- File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" }
+ File.open(changed_file, "a") {|f| f.puts diff }
expect(File.read(changed_file)).to include(diff)
- bundle "pristine"
+ bundle! "pristine"
expect(File.read(changed_file)).to_not include(diff)
end
+
+ it "removes added files" do
+ spec = Bundler.definition.specs["foo"].first
+ changes_txt = Pathname.new(spec.full_gem_path).join("lib/changes.txt")
+
+ FileUtils.touch(changes_txt)
+ expect(changes_txt).to be_file
+
+ bundle! "pristine"
+ expect(changes_txt).not_to be_file
+ end
end
context "when sourced from gemspec" do
@@ -69,7 +80,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
changed_file = Pathname.new(spec.full_gem_path).join("lib/baz.rb")
diff = "#Pristine spec changes"
- File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" }
+ File.open(changed_file, "a") {|f| f.puts diff }
expect(File.read(changed_file)).to include(diff)
bundle "pristine"
@@ -102,6 +113,39 @@ RSpec.describe "bundle pristine", :ruby_repo do
end
end
+ context "when passing a list of gems to pristine" do
+ it "resets them" do
+ foo = Bundler.definition.specs["foo"].first
+ foo_changes_txt = Pathname.new(foo.full_gem_path).join("lib/changes.txt")
+ FileUtils.touch(foo_changes_txt)
+ expect(foo_changes_txt).to be_file
+
+ bar = Bundler.definition.specs["bar"].first
+ bar_changes_txt = Pathname.new(bar.full_gem_path).join("lib/changes.txt")
+ FileUtils.touch(bar_changes_txt)
+ expect(bar_changes_txt).to be_file
+
+ weakling = Bundler.definition.specs["weakling"].first
+ weakling_changes_txt = Pathname.new(weakling.full_gem_path).join("lib/changes.txt")
+ FileUtils.touch(weakling_changes_txt)
+ expect(weakling_changes_txt).to be_file
+
+ bundle! "pristine foo bar weakling"
+
+ expect(out).to include("Cannot pristine bar (1.0). Gem is sourced from local path.").
+ and include("Installing weakling 1.0")
+
+ expect(weakling_changes_txt).not_to be_file
+ expect(foo_changes_txt).not_to be_file
+ expect(bar_changes_txt).to be_file
+ end
+
+ it "raises when one of them is not in the lockfile" do
+ bundle "pristine abcabcabc"
+ expect(out).to include("Could not find gem 'abcabcabc'.")
+ end
+ end
+
context "when a build config exists for one of the gems" do
let(:very_simple_binary) { Bundler.definition.specs["very_simple_binary"].first }
let(:c_ext_dir) { Pathname.new(very_simple_binary.full_gem_path).join("ext") }
diff --git a/spec/bundler/commands/show_spec.rb b/spec/bundler/commands/show_spec.rb
index fc34831a72..adbf289fd0 100644
--- a/spec/bundler/commands/show_spec.rb
+++ b/spec/bundler/commands/show_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "bundle show" do
+RSpec.describe "bundle show", :bundler => "< 2" do
context "with a standard Gemfile" do
before :each do
install_gemfile <<-G
@@ -32,15 +31,15 @@ RSpec.describe "bundle show" do
end
it "warns if path no longer exists on disk" do
- FileUtils.rm_rf("#{system_gem_path}/gems/rails-2.3.2")
+ FileUtils.rm_rf(default_bundle_path("gems", "rails-2.3.2"))
bundle "show rails"
- expect(out).to match(/has been deleted/i)
- expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s)
+ expect(out).to match(/has been deleted/i).
+ and include(default_bundle_path("gems", "rails-2.3.2").to_s)
end
- it "prints the path to the running bundler" do
+ it "prints the path to the running bundler", :ruby_repo do
bundle "show bundler"
expect(out).to eq(root.to_s)
end
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb
index 4992e428da..a8283cf593 100644
--- a/spec/bundler/commands/update_spec.rb
+++ b/spec/bundler/commands/update_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle update" do
before :each do
@@ -12,7 +11,7 @@ RSpec.describe "bundle update" do
G
end
- describe "with no arguments" do
+ describe "with no arguments", :bundler => "< 2" do
it "updates the entire bundle" do
update_repo2 do
build_gem "activesupport", "3.0"
@@ -35,6 +34,51 @@ RSpec.describe "bundle update" do
end
end
+ describe "with --all", :bundler => "2" do
+ it "updates the entire bundle" do
+ update_repo2 do
+ build_gem "activesupport", "3.0"
+ end
+
+ bundle! "update", :all => true
+ expect(out).to include("Bundle updated!")
+ expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
+ end
+
+ it "doesn't delete the Gemfile.lock file if something goes wrong" do
+ gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "activesupport"
+ gem "rack-obama"
+ exit!
+ G
+ bundle "update", :all => true
+ expect(bundled_app("Gemfile.lock")).to exist
+ end
+ end
+
+ context "when update_requires_all_flag is set" do
+ before { bundle! "config update_requires_all_flag true" }
+
+ it "errors when passed nothing" do
+ install_gemfile! ""
+ bundle :update
+ expect(out).to eq("To update everything, pass the `--all` flag.")
+ end
+
+ it "errors when passed --all and another option" do
+ install_gemfile! ""
+ bundle "update --all foo"
+ expect(out).to eq("Cannot specify --all along with specific options.")
+ end
+
+ it "updates everything when passed --all" do
+ install_gemfile! ""
+ bundle "update --all"
+ expect(out).to include("Bundle updated!")
+ end
+ end
+
describe "--quiet argument" do
it "hides UI messages" do
bundle "update --quiet"
@@ -101,7 +145,7 @@ RSpec.describe "bundle update" do
end
end
- bundle! "update"
+ bundle! "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems("a 1.0", "b 1.0", "c 2.0")
end
@@ -112,13 +156,13 @@ RSpec.describe "bundle update" do
it "doesn't hit repo2" do
FileUtils.rm_rf(gem_repo2)
- bundle "update --local"
- expect(out).not_to match(/Fetching source index/)
+ bundle "update --local --all"
+ expect(out).not_to include("Fetching source index")
end
end
describe "with --group option" do
- it "should update only specifed group gems" do
+ it "should update only specified group gems" do
install_gemfile <<-G
source "file://#{gem_repo2}"
gem "activesupport", :group => :development
@@ -154,46 +198,66 @@ RSpec.describe "bundle update" do
end
describe "in a frozen bundle" do
- it "should fail loudly" do
- bundle "install --deployment"
- bundle "update"
+ it "should fail loudly", :bundler => "< 2" do
+ bundle! "install --deployment"
+ bundle "update", :all => bundle_update_requires_all?
+ expect(last_command).to be_failure
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
expect(out).to match(/freeze \nby running `bundle install --no-deployment`./m)
- expect(exitstatus).not_to eq(0) if exitstatus
end
- it "should suggest different command when frozen is set globally" do
- bundler "config --global frozen 1"
- bundle "update"
- expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
- expect(out).to match(/freeze \nby running `bundle config --delete frozen`./m)
+ it "should suggest different command when frozen is set globally", :bundler => "< 2" do
+ bundle! "config --global frozen 1"
+ bundle "update", :all => bundle_update_requires_all?
+ expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
+ and match(/freeze \nby running `bundle config --delete frozen`./m)
+ end
+
+ it "should suggest different command when frozen is set globally", :bundler => "2" do
+ bundle! "config --global deployment true"
+ bundle "update", :all => bundle_update_requires_all?
+ expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
+ and match(/freeze \nby running `bundle config --delete deployment`./m)
end
end
describe "with --source option" do
- it "should not update gems not included in the source that happen to have the same name" do
- pending("Allowed to fail to preserve backwards-compatibility")
-
- install_gemfile <<-G
+ it "should not update gems not included in the source that happen to have the same name", :bundler => "< 2" do
+ install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "activesupport"
G
update_repo2 { build_gem "activesupport", "3.0" }
- bundle "update --source activesupport"
- expect(the_bundle).not_to include_gems "activesupport 3.0"
+ bundle! "update --source activesupport"
+ expect(the_bundle).to include_gem "activesupport 3.0"
end
- it "should update gems not included in the source that happen to have the same name" do
- install_gemfile <<-G
+ it "should not update gems not included in the source that happen to have the same name", :bundler => "2" do
+ install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "activesupport"
G
update_repo2 { build_gem "activesupport", "3.0" }
- bundle "update --source activesupport"
- expect(the_bundle).to include_gems "activesupport 3.0"
+ bundle! "update --source activesupport"
+ expect(the_bundle).not_to include_gem "activesupport 3.0"
+ end
+
+ context "with unlock_source_unlocks_spec set to false" do
+ before { bundle! "config unlock_source_unlocks_spec false" }
+
+ it "should not update gems not included in the source that happen to have the same name" do
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "activesupport"
+ G
+ update_repo2 { build_gem "activesupport", "3.0" }
+
+ bundle "update --source activesupport"
+ expect(the_bundle).not_to include_gems "activesupport 3.0"
+ end
end
end
@@ -213,7 +277,7 @@ RSpec.describe "bundle update" do
G
end
- it "should not update the child dependencies of a gem that has the same name as the source" do
+ it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 2" do
update_repo2 do
build_gem "fred", "2.0"
build_gem "harry", "2.0" do |s|
@@ -225,6 +289,18 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gems "harry 2.0"
expect(the_bundle).to include_gems "fred 1.0"
end
+
+ it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "2" do
+ update_repo2 do
+ build_gem "fred", "2.0"
+ build_gem "harry", "2.0" do |s|
+ s.add_dependency "fred"
+ end
+ end
+
+ bundle "update --source harry"
+ expect(the_bundle).to include_gems "harry 1.0", "fred 1.0"
+ end
end
context "when there is a child dependency that appears elsewhere in the dependency graph" do
@@ -246,7 +322,7 @@ RSpec.describe "bundle update" do
G
end
- it "should not update the child dependencies of a gem that has the same name as the source" do
+ it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 2" do
update_repo2 do
build_gem "george", "2.0"
build_gem "harry", "2.0" do |s|
@@ -259,6 +335,18 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gems "fred 1.0"
expect(the_bundle).to include_gems "george 1.0"
end
+
+ it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "2" do
+ update_repo2 do
+ build_gem "george", "2.0"
+ build_gem "harry", "2.0" do |s|
+ s.add_dependency "george"
+ end
+ end
+
+ bundle "update --source harry"
+ expect(the_bundle).to include_gems "harry 1.0", "fred 1.0", "george 1.0"
+ end
end
end
@@ -285,6 +373,24 @@ RSpec.describe "bundle update in more complicated situations" do
expect(the_bundle).to include_gems "thin 2.0", "rack 1.2", "rack-obama 1.0"
end
+ it "will warn when some explicitly updated gems are not updated" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo2}"
+
+ gem "thin"
+ gem "rack-obama"
+ G
+
+ update_repo2 do
+ build_gem("thin", "2.0") {|s| s.add_dependency "rack" }
+ build_gem "rack", "10.0"
+ end
+
+ bundle! "update thin rack-obama"
+ expect(last_command.stdboth).to include "Bundler attempted to update rack-obama but its version stayed the same"
+ expect(the_bundle).to include_gems "thin 2.0", "rack 10.0", "rack-obama 1.0"
+ end
+
it "will update only from pinned source" do
install_gemfile <<-G
source "file://#{gem_repo2}"
@@ -313,7 +419,7 @@ RSpec.describe "bundle update without a Gemfile.lock" do
gem "rack", "1.0"
G
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -333,21 +439,23 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler"
G
end
- it "should not explode" do
- bundle "update"
- expect(err).to lack_errors
+ it "should explain that bundler conflicted", :bundler => "< 2" do
+ bundle "update", :all => bundle_update_requires_all?
+ expect(last_command.stdboth).not_to match(/in snapshot/i)
+ expect(last_command.bundler_err).to match(/current Bundler version/i).
+ and match(/perhaps you need to update bundler/i)
end
- it "should explain that bundler conflicted" do
- bundle "update"
- expect(out).not_to match(/in snapshot/i)
- expect(out).to match(/current Bundler version/i)
- expect(out).to match(/perhaps you need to update bundler/i)
+ it "should warn that the newer version of Bundler would conflict", :bundler => "2" do
+ bundle! "update", :all => true
+ expect(last_command.bundler_err).to include("rails (3.0.1) has dependency bundler").
+ and include("so the dependency is being ignored")
+ expect(the_bundle).to include_gem "rails 3.0.1"
end
end
RSpec.describe "bundle update" do
- it "shows the previous version of the gem when updated from rubygems source" do
+ it "shows the previous version of the gem when updated from rubygems source", :bundler => "< 2" do
build_repo2
install_gemfile <<-G
@@ -355,17 +463,52 @@ RSpec.describe "bundle update" do
gem "activesupport"
G
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(out).to include("Using activesupport 2.3.5")
update_repo2 do
build_gem "activesupport", "3.0"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(out).to include("Installing activesupport 3.0 (was 2.3.5)")
end
+ context "with suppress_install_using_messages set" do
+ before { bundle! "config suppress_install_using_messages true" }
+
+ it "only prints `Using` for versions that have changed" do
+ build_repo4 do
+ build_gem "bar"
+ build_gem "foo"
+ end
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo4}"
+ gem "bar"
+ gem "foo"
+ G
+
+ bundle! "update", :all => bundle_update_requires_all?
+ out.gsub!(/RubyGems [\d\.]+ is not threadsafe.*\n?/, "")
+ expect(out).to include "Resolving dependencies...\nBundle updated!"
+
+ update_repo4 do
+ build_gem "foo", "2.0"
+ end
+
+ bundle! "update", :all => bundle_update_requires_all?
+ out.sub!("Removing foo (1.0)\n", "")
+ out.gsub!(/RubyGems [\d\.]+ is not threadsafe.*\n?/, "")
+ expect(out).to include strip_whitespace(<<-EOS).strip
+ Resolving dependencies...
+ Fetching foo 2.0 (was 1.0)
+ Installing foo 2.0 (was 1.0)
+ Bundle updated
+ EOS
+ end
+ end
+
it "shows error message when Gemfile.lock is not preset and gem is specified" do
install_gemfile <<-G
source "file://#{gem_repo2}"
@@ -403,7 +546,7 @@ RSpec.describe "bundle update --ruby" do
specs:
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
@@ -429,7 +572,7 @@ RSpec.describe "bundle update --ruby" do
specs:
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
@@ -473,7 +616,7 @@ RSpec.describe "bundle update --ruby" do
specs:
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
@@ -487,22 +630,43 @@ RSpec.describe "bundle update --ruby" do
end
end
+RSpec.describe "bundle update --bundler" do
+ it "updates the bundler version in the lockfile without re-resolving" do
+ build_repo4 do
+ build_gem "rack", "1.0"
+ end
+
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gem "rack"
+ G
+ lockfile lockfile.sub(Bundler::VERSION, "1.0.0")
+
+ FileUtils.rm_r gem_repo4
+
+ bundle! :update, :bundler => true, :verbose => true
+ expect(the_bundle).to include_gem "rack 1.0"
+
+ expect(the_bundle.locked_gems.bundler_version).to eq v(Bundler::VERSION)
+ end
+end
+
# these specs are slow and focus on integration and therefore are not exhaustive. unit specs elsewhere handle that.
RSpec.describe "bundle update conservative" do
context "patch and minor options" do
before do
build_repo4 do
- build_gem "foo", %w(1.4.3 1.4.4) do |s|
+ build_gem "foo", %w[1.4.3 1.4.4] do |s|
s.add_dependency "bar", "~> 2.0"
end
- build_gem "foo", %w(1.4.5 1.5.0) do |s|
+ build_gem "foo", %w[1.4.5 1.5.0] do |s|
s.add_dependency "bar", "~> 2.1"
end
- build_gem "foo", %w(1.5.1) do |s|
+ build_gem "foo", %w[1.5.1] do |s|
s.add_dependency "bar", "~> 3.0"
end
- build_gem "bar", %w(2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0)
- build_gem "qux", %w(1.0.0 1.0.1 1.1.0 2.0.0)
+ build_gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
+ build_gem "qux", %w[1.0.0 1.0.1 1.1.0 2.0.0]
end
# establish a lockfile set to 1.4.3
@@ -524,13 +688,13 @@ RSpec.describe "bundle update conservative" do
context "patch preferred" do
it "single gem updates dependent gem to minor" do
- bundle "update --patch foo"
+ bundle! "update --patch foo"
expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.0"
end
it "update all" do
- bundle "update --patch"
+ bundle! "update --patch", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.1"
end
@@ -538,7 +702,7 @@ RSpec.describe "bundle update conservative" do
context "minor preferred" do
it "single gem updates dependent gem to major" do
- bundle "update --minor foo"
+ bundle! "update --minor foo"
expect(the_bundle).to include_gems "foo 1.5.1", "bar 3.0.0", "qux 1.0.0"
end
@@ -546,13 +710,13 @@ RSpec.describe "bundle update conservative" do
context "strict" do
it "patch preferred" do
- bundle "update --patch foo bar --strict"
+ bundle! "update --patch foo bar --strict"
expect(the_bundle).to include_gems "foo 1.4.4", "bar 2.0.5", "qux 1.0.0"
end
it "minor preferred" do
- bundle "update --minor --strict"
+ bundle! "update --minor --strict", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "foo 1.5.0", "bar 2.1.1", "qux 1.1.0"
end
@@ -562,18 +726,18 @@ RSpec.describe "bundle update conservative" do
context "eager unlocking" do
before do
build_repo4 do
- build_gem "isolated_owner", %w(1.0.1 1.0.2) do |s|
+ build_gem "isolated_owner", %w[1.0.1 1.0.2] do |s|
s.add_dependency "isolated_dep", "~> 2.0"
end
- build_gem "isolated_dep", %w(2.0.1 2.0.2)
+ build_gem "isolated_dep", %w[2.0.1 2.0.2]
- build_gem "shared_owner_a", %w(3.0.1 3.0.2) do |s|
+ build_gem "shared_owner_a", %w[3.0.1 3.0.2] do |s|
s.add_dependency "shared_dep", "~> 5.0"
end
- build_gem "shared_owner_b", %w(4.0.1 4.0.2) do |s|
+ build_gem "shared_owner_b", %w[4.0.1 4.0.2] do |s|
s.add_dependency "shared_dep", "~> 5.0"
end
- build_gem "shared_dep", %w(5.0.1 5.0.2)
+ build_gem "shared_dep", %w[5.0.1 5.0.2]
end
gemfile <<-G
@@ -649,9 +813,9 @@ RSpec.describe "bundle update conservative" do
end
it "raises if too many flags are provided" do
- bundle "update --patch --minor"
+ bundle "update --patch --minor", :all => bundle_update_requires_all?
- expect(out).to eq "Provide only one of the following options: minor, patch"
+ expect(last_command.bundler_err).to eq "Provide only one of the following options: minor, patch"
end
end
end
diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb
new file mode 100644
index 0000000000..b919c25e0f
--- /dev/null
+++ b/spec/bundler/commands/version_spec.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+RSpec.describe "bundle version" do
+ context "with -v" do
+ it "outputs the version", :bundler => "< 2" do
+ bundle! "-v"
+ expect(out).to eq("Bundler version #{Bundler::VERSION}")
+ end
+
+ it "outputs the version", :bundler => "2" do
+ bundle! "-v"
+ expect(out).to eq(Bundler::VERSION)
+ end
+ end
+
+ context "with --version" do
+ it "outputs the version", :bundler => "< 2" do
+ bundle! "--version"
+ expect(out).to eq("Bundler version #{Bundler::VERSION}")
+ end
+
+ it "outputs the version", :bundler => "2" do
+ bundle! "--version"
+ expect(out).to eq(Bundler::VERSION)
+ end
+ end
+
+ context "with version" do
+ it "outputs the version with build metadata", :bundler => "< 2" do
+ bundle! "version"
+ expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ end
+
+ it "outputs the version with build metadata", :bundler => "2" do
+ bundle! "version"
+ expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
+ end
+ end
+end
diff --git a/spec/bundler/commands/viz_spec.rb b/spec/bundler/commands/viz_spec.rb
index 77112aace4..0e8667eaa7 100644
--- a/spec/bundler/commands/viz_spec.rb
+++ b/spec/bundler/commands/viz_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do
let(:ruby_graphviz) do
diff --git a/spec/bundler/install/allow_offline_install_spec.rb b/spec/bundler/install/allow_offline_install_spec.rb
index 1bca055c9f..d4bb595771 100644
--- a/spec/bundler/install/allow_offline_install_spec.rb
+++ b/spec/bundler/install/allow_offline_install_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with :allow_offline_install" do
before do
@@ -27,8 +26,9 @@ RSpec.describe "bundle install with :allow_offline_install" do
context "with cached data locally" do
it "will install from the compact index" do
- system_gems ["rack-1.0.0"]
+ system_gems ["rack-1.0.0"], :path => :bundle_path
+ bundle! "config clean false"
install_gemfile! <<-G, :artifice => "compact_index"
source "http://testgemserver.local"
gem "rack-obama"
@@ -42,8 +42,8 @@ RSpec.describe "bundle install with :allow_offline_install" do
gem "rack-obama"
G
- bundle! :update, :artifice => "fail"
- expect(out).to include("Using the cached data for the new index because of a network error")
+ bundle! :update, :artifice => "fail", :all => true
+ expect(last_command.stdboth).to include "Using the cached data for the new index because of a network error"
expect(the_bundle).to include_gems("rack-obama 1.0", "rack 1.0.0")
end
@@ -76,7 +76,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
gem "a", :git => #{git.path.to_s.dump}
G
- break_git_remote_ops! { bundle! :update }
+ break_git_remote_ops! { bundle! :update, :all => true }
expect(out).to include("Using cached git data because of network errors")
expect(the_bundle).to be_locked
diff --git a/spec/bundler/install/binstubs_spec.rb b/spec/bundler/install/binstubs_spec.rb
index a1a9ab167d..23eb691ab8 100644
--- a/spec/bundler/install/binstubs_spec.rb
+++ b/spec/bundler/install/binstubs_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "bundle install" do
+RSpec.describe "bundle install", :bundler => "< 2" do
describe "when system_bindir is set" do
# On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if
# you want to avoid sudo installs for system gems with OS X's default ruby
@@ -21,7 +20,7 @@ RSpec.describe "bundle install" do
end
end
- describe "when multiple gems contain the same exe" do
+ describe "when multiple gems contain the same exe", :bundler => "< 2" do
before do
build_repo2 do
build_gem "fake", "14" do |s|
@@ -36,12 +35,6 @@ RSpec.describe "bundle install" do
G
end
- it "prints a deprecation notice" do
- bundle "config major_deprecations true"
- gembin("rackup")
- expect(out).to include("Bundler is using a binstub that was created for a different gem.")
- end
-
it "loads the correct spec's executable" do
gembin("rackup")
expect(out).to eq("1.2")
diff --git a/spec/bundler/install/bundler_spec.rb b/spec/bundler/install/bundler_spec.rb
index c1ce57e60e..08b7e2b673 100644
--- a/spec/bundler/install/bundler_spec.rb
+++ b/spec/bundler/install/bundler_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
describe "with bundler dependencies" do
@@ -38,8 +37,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 0.9.2)
@@ -49,9 +46,9 @@ RSpec.describe "bundle install" do
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
- Could not find gem 'bundler (= 0.9.2)' in any of the sources
+ Could not find gem 'bundler (= 0.9.2)' in any
E
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
it "works for gems with multiple versions in its dependencies" do
@@ -99,8 +96,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activemerchant was resolved to 1.0, which depends on
@@ -109,7 +104,7 @@ RSpec.describe "bundle install" do
rails_fail was resolved to 1.0, which depends on
activesupport (= 1.2.3)
E
- expect(out).to include(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
it "causes a conflict if a child dependency conflicts with the Gemfile" do
@@ -120,8 +115,6 @@ RSpec.describe "bundle install" do
G
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activesupport (= 2.3.5)
@@ -129,19 +122,55 @@ RSpec.describe "bundle install" do
rails_fail was resolved to 1.0, which depends on
activesupport (= 1.2.3)
E
- expect(out).to include(nice_error)
+ expect(last_command.bundler_err).to include(nice_error)
end
- it "can install dependencies with newer bundler version" do
- install_gemfile <<-G
+ it "can install dependencies with newer bundler version with system gems", :ruby => "> 2" do
+ bundle! "config path.system true"
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
+ gem "rails", "3.0"
+ G
+
+ simulate_bundler_version "99999999.99.1"
+
+ bundle! "check", :env => { "BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD" => "1" }
+ expect(out).to include("The Gemfile's dependencies are satisfied")
+ end
+
+ it "can install dependencies with newer bundler version with a local path", :ruby => "> 2" do
+ bundle! "config path .bundle"
+ install_gemfile! <<-G
source "file://#{gem_repo2}"
gem "rails", "3.0"
G
- simulate_bundler_version "10.0.0"
+ simulate_bundler_version "99999999.99.1"
- bundle "check"
+ bundle! "check", :env => { "BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD" => "1" }
expect(out).to include("The Gemfile's dependencies are satisfied")
end
+
+ context "with allow_bundler_dependency_conflicts set" do
+ before { bundle! "config allow_bundler_dependency_conflicts true" }
+
+ it "are forced to the current bundler version with warnings when no compatible version is found" do
+ build_repo4 do
+ build_gem "requires_nonexistant_bundler" do |s|
+ s.add_runtime_dependency "bundler", "99.99.99.99"
+ end
+ end
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo4}"
+ gem "requires_nonexistant_bundler"
+ G
+
+ expect(out).to include "requires_nonexistant_bundler (1.0) has dependency bundler (= 99.99.99.99), " \
+ "which is unsatisfied by the current bundler version #{Bundler::VERSION}, so the dependency is being ignored"
+
+ expect(the_bundle).to include_gems "bundler #{Bundler::VERSION}", "requires_nonexistant_bundler 1.0"
+ end
+ end
end
end
diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb
index bcbd57bc4f..3b9d68982a 100644
--- a/spec/bundler/install/deploy_spec.rb
+++ b/spec/bundler/install/deploy_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "install with --deployment or --frozen" do
before do
@@ -9,44 +8,48 @@ RSpec.describe "install with --deployment or --frozen" do
G
end
- it "fails without a lockfile and says that --deployment requires a lock" do
- bundle "install --deployment"
- expect(out).to include("The --deployment flag requires a Gemfile.lock")
- end
+ context "with CLI flags", :bundler => "< 2" do
+ it "fails without a lockfile and says that --deployment requires a lock" do
+ bundle "install --deployment"
+ expect(out).to include("The --deployment flag requires a Gemfile.lock")
+ end
- it "fails without a lockfile and says that --frozen requires a lock" do
- bundle "install --frozen"
- expect(out).to include("The --frozen flag requires a Gemfile.lock")
- end
+ it "fails without a lockfile and says that --frozen requires a lock" do
+ bundle "install --frozen"
+ expect(out).to include("The --frozen flag requires a Gemfile.lock")
+ end
- it "disallows --deployment --system" do
- bundle "install --deployment --system"
- expect(out).to include("You have specified both --deployment")
- expect(out).to include("Please choose only one option")
- expect(exitstatus).to eq(15) if exitstatus
- end
+ it "disallows --deployment --system" do
+ bundle "install --deployment --system"
+ expect(out).to include("You have specified both --deployment")
+ expect(out).to include("Please choose only one option")
+ expect(exitstatus).to eq(15) if exitstatus
+ end
- it "disallows --deployment --path --system" do
- bundle "install --deployment --path . --system"
- expect(out).to include("You have specified both --path")
- expect(out).to include("as well as --system")
- expect(out).to include("Please choose only one option")
- expect(exitstatus).to eq(15) if exitstatus
- end
+ it "disallows --deployment --path --system" do
+ bundle "install --deployment --path . --system"
+ expect(out).to include("You have specified both --path")
+ expect(out).to include("as well as --system")
+ expect(out).to include("Please choose only one option")
+ expect(exitstatus).to eq(15) if exitstatus
+ end
- it "works after you try to deploy without a lock" do
- bundle "install --deployment"
- bundle :install
- expect(exitstatus).to eq(0) if exitstatus
- expect(the_bundle).to include_gems "rack 1.0"
+ it "works after you try to deploy without a lock" do
+ bundle "install --deployment"
+ bundle! :install
+ expect(the_bundle).to include_gems "rack 1.0"
+ end
end
it "still works if you are not in the app directory and specify --gemfile" do
bundle "install"
- Dir.chdir tmp
- simulate_new_machine
- bundle "install --gemfile #{tmp}/bundled_app/Gemfile --deployment"
- Dir.chdir bundled_app
+ Dir.chdir tmp do
+ simulate_new_machine
+ bundle! :install,
+ forgotten_command_line_options(:gemfile => "#{tmp}/bundled_app/Gemfile",
+ :deployment => true,
+ :path => "vendor/bundle")
+ end
expect(the_bundle).to include_gems "rack 1.0"
end
@@ -58,15 +61,13 @@ RSpec.describe "install with --deployment or --frozen" do
end
G
bundle :install
- bundle "install --deployment --without test"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! :install, forgotten_command_line_options(:deployment => true, :without => "test")
end
- it "works when you bundle exec bundle" do
+ it "works when you bundle exec bundle", :ruby_repo do
bundle :install
bundle "install --deployment"
- bundle "exec bundle check"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! "exec bundle check"
end
it "works when using path gems from the same path and the version is specified" do
@@ -78,7 +79,7 @@ RSpec.describe "install with --deployment or --frozen" do
G
bundle! :install
- bundle! "install --deployment"
+ bundle! :install, forgotten_command_line_options(:deployment => true)
end
it "works when there are credentials in the source URL" do
@@ -88,21 +89,18 @@ RSpec.describe "install with --deployment or --frozen" do
gem "rack-obama", ">= 1.0"
G
- bundle "install --deployment", :artifice => "endpoint_strict_basic_authentication"
-
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! :install, forgotten_command_line_options(:deployment => true).merge(:artifice => "endpoint_strict_basic_authentication")
end
it "works with sources given by a block" do
- install_gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}" do
gem "rack"
end
G
- bundle "install --deployment"
+ bundle! :install, forgotten_command_line_options(:deployment => true)
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "rack 1.0"
end
@@ -111,14 +109,16 @@ RSpec.describe "install with --deployment or --frozen" do
bundle "install"
end
- it "works with the --deployment flag if you didn't change anything" do
- bundle "install --deployment"
- expect(exitstatus).to eq(0) if exitstatus
+ it "works with the --deployment flag if you didn't change anything", :bundler => "< 2" do
+ bundle! "install --deployment"
end
- it "works with the --frozen flag if you didn't change anything" do
- bundle "install --frozen"
- expect(exitstatus).to eq(0) if exitstatus
+ it "works with the --frozen flag if you didn't change anything", :bundler => "< 2" do
+ bundle! "install --frozen"
+ end
+
+ it "works with BUNDLE_FROZEN if you didn't change anything" do
+ bundle! :install, :env => { "BUNDLE_FROZEN" => "true" }
end
it "explodes with the --deployment flag if you make a change and don't check in the lockfile" do
@@ -128,7 +128,7 @@ RSpec.describe "install with --deployment or --frozen" do
gem "rack-obama"
G
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("deployment mode")
expect(out).to include("You have added to the Gemfile")
expect(out).to include("* rack-obama")
@@ -136,7 +136,36 @@ RSpec.describe "install with --deployment or --frozen" do
expect(out).not_to include("You have changed in the Gemfile")
end
- it "can have --frozen set via an environment variable" do
+ it "works if a path gem is missing but is in a without group" do
+ build_lib "path_gem"
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rake"
+ gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development
+ G
+ expect(the_bundle).to include_gems "path_gem 1.0"
+ FileUtils.rm_r lib_path("path_gem-1.0")
+
+ bundle! :install, forgotten_command_line_options(:path => ".bundle", :without => "development", :deployment => true).merge(:env => { :DEBUG => "1" })
+ run! "puts :WIN"
+ expect(out).to eq("WIN")
+ end
+
+ it "explodes if a path gem is missing" do
+ build_lib "path_gem"
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rake"
+ gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development
+ G
+ expect(the_bundle).to include_gems "path_gem 1.0"
+ FileUtils.rm_r lib_path("path_gem-1.0")
+
+ bundle :install, forgotten_command_line_options(:path => ".bundle", :deployment => true)
+ expect(out).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.")
+ end
+
+ it "can have --frozen set via an environment variable", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -152,6 +181,22 @@ RSpec.describe "install with --deployment or --frozen" do
expect(out).not_to include("You have changed in the Gemfile")
end
+ it "can have --deployment set via an environment variable" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ gem "rack-obama"
+ G
+
+ ENV["BUNDLE_DEPLOYMENT"] = "true"
+ bundle "install"
+ expect(out).to include("deployment mode")
+ expect(out).to include("You have added to the Gemfile")
+ expect(out).to include("* rack-obama")
+ expect(out).not_to include("You have deleted from the Gemfile")
+ expect(out).not_to include("You have changed in the Gemfile")
+ end
+
it "can have --frozen set to false via an environment variable" do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -160,20 +205,21 @@ RSpec.describe "install with --deployment or --frozen" do
G
ENV["BUNDLE_FROZEN"] = "false"
+ ENV["BUNDLE_DEPLOYMENT"] = "false"
bundle "install"
expect(out).not_to include("deployment mode")
expect(out).not_to include("You have added to the Gemfile")
expect(out).not_to include("* rack-obama")
end
- it "explodes with the --frozen flag if you make a change and don't check in the lockfile" do
+ it "explodes with the --frozen flag if you make a change and don't check in the lockfile", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
gem "rack-obama", "1.1"
G
- bundle "install --frozen"
+ bundle :install, forgotten_command_line_options(:frozen => true)
expect(out).to include("deployment mode")
expect(out).to include("You have added to the Gemfile")
expect(out).to include("* rack-obama (= 1.1)")
@@ -187,7 +233,7 @@ RSpec.describe "install with --deployment or --frozen" do
gem "activesupport"
G
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("deployment mode")
expect(out).to include("You have added to the Gemfile:\n* activesupport\n\n")
expect(out).to include("You have deleted from the Gemfile:\n* rack")
@@ -200,7 +246,7 @@ RSpec.describe "install with --deployment or --frozen" do
gem "rack", :git => "git://hubz.com"
G
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("deployment mode")
expect(out).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)")
expect(out).not_to include("You have changed in the Gemfile")
@@ -219,7 +265,7 @@ RSpec.describe "install with --deployment or --frozen" do
gem "rack"
G
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("deployment mode")
expect(out).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}")
expect(out).not_to include("You have added to the Gemfile")
@@ -242,15 +288,93 @@ RSpec.describe "install with --deployment or --frozen" do
gem "foo", :git => "#{lib_path("rack")}"
G
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("deployment mode")
expect(out).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`")
expect(out).not_to include("You have added to the Gemfile")
expect(out).not_to include("You have deleted from the Gemfile")
end
+ context "when replacing a host with the same host with credentials" do
+ let(:success_message) do
+ if Bundler::VERSION.split(".", 2).first == "1"
+ "Could not reach host localgemserver.test"
+ else
+ "Bundle complete!"
+ end
+ end
+
+ before do
+ install_gemfile <<-G
+ source "http://user_name:password@localgemserver.test/"
+ gem "rack"
+ G
+
+ lockfile <<-G
+ GEM
+ remote: http://localgemserver.test/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{local}
+
+ DEPENDENCIES
+ rack
+ G
+ end
+
+ it "prevents the replace by default" do
+ bundle :install, forgotten_command_line_options(:deployment => true)
+
+ expect(out).to match(/The list of sources changed/)
+ end
+
+ context "when allow_deployment_source_credential_changes is true" do
+ before { bundle! "config allow_deployment_source_credential_changes true" }
+
+ it "allows the replace" do
+ bundle :install, forgotten_command_line_options(:deployment => true)
+
+ expect(out).to match(/#{success_message}/)
+ end
+ end
+
+ context "when allow_deployment_source_credential_changes is false" do
+ before { bundle! "config allow_deployment_source_credential_changes false" }
+
+ it "prevents the replace" do
+ bundle :install, forgotten_command_line_options(:deployment => true)
+
+ expect(out).to match(/The list of sources changed/)
+ end
+ end
+
+ context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is true" do
+ before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "true" }
+
+ it "allows the replace" do
+ bundle :install, forgotten_command_line_options(:deployment => true)
+
+ expect(out).to match(/#{success_message}/)
+ end
+ end
+
+ context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is false" do
+ before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" }
+
+ it "prevents the replace" do
+ bundle :install, forgotten_command_line_options(:deployment => true)
+
+ expect(out).to match(/The list of sources changed/)
+ end
+ end
+ end
+
it "remembers that the bundle is frozen at runtime" do
- bundle "install --deployment"
+ bundle! :lock
+
+ bundle! "config deployment true"
gemfile <<-G
source "file://#{gem_repo1}"
@@ -281,19 +405,17 @@ You have deleted from the Gemfile:
bundle! :install
expect(the_bundle).to include_gems "foo 1.0"
- bundle! "package --all"
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo")).to be_directory
bundle! "install --local"
- expect(out).to include("Using foo 1.0 from source at")
- expect(out).to include("vendor/cache/foo")
+ expect(out).to include("Updating files in vendor/cache")
simulate_new_machine
- bundle! "install --deployment --verbose"
+ bundle! "install --verbose", forgotten_command_line_options(:deployment => true)
expect(out).not_to include("You are trying to install in deployment mode after changing your Gemfile")
expect(out).not_to include("You have added to the Gemfile")
expect(out).not_to include("You have deleted from the Gemfile")
- expect(out).to include("Using foo 1.0 from source at")
expect(out).to include("vendor/cache/foo")
expect(the_bundle).to include_gems "foo 1.0"
end
diff --git a/spec/bundler/install/failure_spec.rb b/spec/bundler/install/failure_spec.rb
index 738b2cf1bd..896138c659 100644
--- a/spec/bundler/install/failure_spec.rb
+++ b/spec/bundler/install/failure_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
context "installing a gem fails" do
@@ -19,7 +18,7 @@ RSpec.describe "bundle install" do
source "file:#{gem_repo2}"
gem "rails"
G
- expect(out).to end_with(<<-M.strip)
+ expect(last_command.bundler_err).to end_with(<<-M.strip)
An error occurred while installing activesupport (2.3.2), and Bundler cannot continue.
Make sure that `gem install activesupport -v '2.3.2'` succeeds before bundling.
diff --git a/spec/bundler/install/force_spec.rb b/spec/bundler/install/force_spec.rb
index dc4956a7ae..52fa4f0d61 100644
--- a/spec/bundler/install/force_spec.rb
+++ b/spec/bundler/install/force_spec.rb
@@ -1,66 +1,61 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
- describe "with --force" do
- before :each do
- gemfile <<-G
- source "file://#{gem_repo1}"
- gem "rack"
- G
- end
+ %w[force redownload].each do |flag|
+ describe_opts = {}
+ describe_opts[:bundler] = "< 2" if flag == "force"
+ describe "with --#{flag}", describe_opts do
+ before :each do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ end
- it "re-installs installed gems" do
- rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb")
+ it "re-installs installed gems" do
+ rack_lib = default_bundle_path("gems/rack-1.0.0/lib/rack.rb")
- bundle "install"
- rack_lib.open("w") {|f| f.write("blah blah blah") }
- bundle "install --force"
+ bundle! :install
+ rack_lib.open("w") {|f| f.write("blah blah blah") }
+ bundle! :install, flag => true
- expect(exitstatus).to eq(0) if exitstatus
- expect(out).to include "Using bundler"
- expect(out).to include "Installing rack 1.0.0"
- expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n")
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
+ expect(out).to include "Installing rack 1.0.0"
+ expect(rack_lib.open(&:read)).to eq("RACK = '1.0.0'\n")
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
- it "works on first bundle install" do
- bundle "install --force"
+ it "works on first bundle install" do
+ bundle! :install, flag => true
- expect(exitstatus).to eq(0) if exitstatus
- expect(out).to include "Using bundler"
- expect(out).to include "Installing rack 1.0.0"
- expect(the_bundle).to include_gems "rack 1.0.0"
- end
+ expect(out).to include "Installing rack 1.0.0"
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
- context "with a git gem" do
- let!(:ref) { build_git("foo", "1.0").ref_for("HEAD", 11) }
+ context "with a git gem" do
+ let!(:ref) { build_git("foo", "1.0").ref_for("HEAD", 11) }
- before do
- gemfile <<-G
- gem "foo", :git => "#{lib_path("foo-1.0")}"
- G
- end
+ before do
+ gemfile <<-G
+ gem "foo", :git => "#{lib_path("foo-1.0")}"
+ G
+ end
- it "re-installs installed gems" do
- foo_lib = default_bundle_path("bundler/gems/foo-1.0-#{ref}/lib/foo.rb")
+ it "re-installs installed gems" do
+ foo_lib = default_bundle_path("bundler/gems/foo-1.0-#{ref}/lib/foo.rb")
- bundle! "install"
- foo_lib.open("w") {|f| f.write("blah blah blah") }
- bundle! "install --force"
+ bundle! :install
+ foo_lib.open("w") {|f| f.write("blah blah blah") }
+ bundle! :install, flag => true
- expect(out).to include "Using bundler"
- expect(out).to include "Using foo 1.0 from #{lib_path("foo-1.0")} (at master@#{ref[0, 7]})"
- expect(foo_lib.open(&:read)).to eq("FOO = '1.0'\n")
- expect(the_bundle).to include_gems "foo 1.0"
- end
+ expect(foo_lib.open(&:read)).to eq("FOO = '1.0'\n")
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
- it "works on first bundle install" do
- bundle! "install --force"
+ it "works on first bundle install" do
+ bundle! :install, flag => true
- expect(out).to include "Using bundler"
- expect(out).to include "Using foo 1.0 from #{lib_path("foo-1.0")} (at master@#{ref[0, 7]})"
- expect(the_bundle).to include_gems "foo 1.0"
+ expect(the_bundle).to include_gems "foo 1.0"
+ end
end
end
end
diff --git a/spec/bundler/install/gemfile/eval_gemfile_spec.rb b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
index f02223d34d..035d3692aa 100644
--- a/spec/bundler/install/gemfile/eval_gemfile_spec.rb
+++ b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
before do
@@ -21,8 +20,9 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
eval_gemfile 'Gemfile-other'
G
expect(out).to include("Resolving dependencies")
- expect(out).to include("Using gunks 0.0.1 from source at `gems/gunks`")
expect(out).to include("Bundle complete")
+
+ expect(the_bundle).to include_gem "gunks 0.0.1", :source => "path@#{bundled_app("gems", "gunks")}"
end
end
@@ -47,7 +47,7 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
# parsed lockfile and the evaluated gemfile.
it "bundles with --deployment" do
bundle! :install
- bundle! "install --deployment"
+ bundle! :install, forgotten_command_line_options(:deployment => true)
end
end
@@ -60,8 +60,23 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
gemspec :path => 'gems/gunks'
G
expect(out).to include("Resolving dependencies")
- expect(out).to include("Using gunks 0.0.1 from source at `gems/gunks`")
expect(out).to include("Bundle complete")
+
+ expect(the_bundle).to include_gem "gunks 0.0.1", :source => "path@#{bundled_app("gems", "gunks")}"
+ end
+ end
+
+ context "eval-ed Gemfile references other gemfiles" do
+ it "works with relative paths" do
+ create_file "other/Gemfile-other", "gem 'rack'"
+ create_file "other/Gemfile", "eval_gemfile 'Gemfile-other'"
+ create_file "Gemfile-alt", <<-G
+ source "file:#{gem_repo1}"
+ eval_gemfile "other/Gemfile"
+ G
+ install_gemfile! "eval_gemfile File.expand_path('Gemfile-alt')"
+
+ expect(the_bundle).to include_gem "rack 1.0.0"
end
end
end
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index 1ea613c9d2..1dc016ed23 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -1,10 +1,11 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install from an existing gemspec" do
before(:each) do
- build_gem "bar", :to_system => true
- build_gem "bar-dev", :to_system => true
+ build_repo2 do
+ build_gem "bar"
+ build_gem "bar-dev"
+ end
end
it "should install runtime and development dependencies" do
@@ -40,8 +41,10 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should handle a list of requirements" do
- build_gem "baz", "1.0", :to_system => true
- build_gem "baz", "1.1", :to_system => true
+ update_repo2 do
+ build_gem "baz", "1.0"
+ build_gem "baz", "1.1"
+ end
build_lib("foo", :path => tmp.join("foo")) do |s|
s.write("Gemfile", "source :rubygems\ngemspec")
@@ -58,11 +61,11 @@ RSpec.describe "bundle install from an existing gemspec" do
it "should raise if there are no gemspecs available" do
build_lib("foo", :path => tmp.join("foo"), :gemspec => false)
- error = install_gemfile(<<-G)
+ install_gemfile(<<-G)
source "file://#{gem_repo2}"
gemspec :path => '#{tmp.join("foo")}'
G
- expect(error).to match(/There are no gemspecs at #{tmp.join('foo')}/)
+ expect(last_command.bundler_err).to match(/There are no gemspecs at #{tmp.join('foo')}/)
end
it "should raise if there are too many gemspecs available" do
@@ -70,11 +73,11 @@ RSpec.describe "bundle install from an existing gemspec" do
s.write("foo2.gemspec", build_spec("foo", "4.0").first.to_ruby)
end
- error = install_gemfile(<<-G)
+ install_gemfile(<<-G)
source "file://#{gem_repo2}"
gemspec :path => '#{tmp.join("foo")}'
G
- expect(error).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
+ expect(last_command.bundler_err).to match(/There are multiple gemspecs at #{tmp.join('foo')}/)
end
it "should pick a specific gemspec" do
@@ -142,7 +145,9 @@ RSpec.describe "bundle install from an existing gemspec" do
G
bundle! "install", :verbose => true
- expect(out).to include("Found no changes, using resolution from the lockfile")
+
+ message = "Found no changes, using resolution from the lockfile"
+ expect(out.scan(message).size).to eq(1)
end
it "should match a lockfile without needing to re-resolve with development dependencies" do
@@ -159,7 +164,9 @@ RSpec.describe "bundle install from an existing gemspec" do
G
bundle! "install", :verbose => true
- expect(out).to include("Found no changes, using resolution from the lockfile")
+
+ message = "Found no changes, using resolution from the lockfile"
+ expect(out.scan(message).size).to eq(1)
end
it "should match a lockfile on non-ruby platforms with a transitive platform dependency" do
@@ -170,7 +177,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_dependency "platform_specific"
end
- install_gem "platform_specific-1.0-java"
+ system_gems "platform_specific-1.0-java", :path => :bundle_path, :keep_path => true
install_gemfile! <<-G
gemspec :path => '#{tmp.join("foo")}'
@@ -189,15 +196,16 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile <<-G
gemspec :path => '#{tmp.join("foo")}'
G
- expect(@err).not_to match(/ahh/)
+ expect(last_command.stdboth).not_to include("ahh")
end
it "allows the gemspec to activate other gems" do
+ ENV["BUNDLE_PATH__SYSTEM"] = "true"
# see https://github.com/bundler/bundler/issues/5409
#
# issue was caused by rubygems having an unresolved gem during a require,
# so emulate that
- system_gems %w(rack-1.0.0 rack-0.9.1 rack-obama-1.0)
+ system_gems %w[rack-1.0.0 rack-0.9.1 rack-obama-1.0]
build_lib("foo", :path => bundled_app)
gemspec = bundled_app("foo.gemspec").read
@@ -217,10 +225,10 @@ RSpec.describe "bundle install from an existing gemspec" do
s.version = "1.0.0"
s.add_dependency "bar", "= 1.0.0"
end
- build_gem "deps", :to_system => true do |s|
+ build_gem "deps", :to_bundle => true do |s|
s.add_dependency "foo", "= 0.0.1"
end
- build_gem "foo", "0.0.1", :to_system => true
+ build_gem "foo", "0.0.1", :to_bundle => true
install_gemfile <<-G
source "file://#{gem_repo2}"
@@ -236,7 +244,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.version = "1.0.0"
s.add_dependency "bar", "= 1.0.0"
end
- build_repo2 do
+ update_repo2 do
build_gem "deps" do |s|
s.add_dependency "foo", "= 0.0.1"
end
@@ -273,7 +281,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_dependency "activesupport", ">= 1.0.1"
end
- bundle "install --deployment"
+ bundle :install, forgotten_command_line_options(:deployment => true)
expect(out).to include("changed")
end
@@ -415,7 +423,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end
end
- %w(ruby jruby).each do |platform|
+ %w[ruby jruby].each do |platform|
simulate_platform(platform) do
install_gemfile <<-G
source "file://#{gem_repo2}"
@@ -425,7 +433,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end
end
- context "on ruby" do
+ context "on ruby", :bundler => "< 2" do
before do
simulate_platform("ruby")
bundle :install
@@ -525,6 +533,107 @@ RSpec.describe "bundle install from an existing gemspec" do
end
end
end
+
+ context "on ruby", :bundler => "2" do
+ before do
+ simulate_platform("ruby")
+ bundle :install
+ end
+
+ context "as a runtime dependency" do
+ it "keeps java dependencies in the lockfile" do
+ expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
+ expect(lockfile).to eq strip_whitespace(<<-L)
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+ platform_specific (1.0)
+ platform_specific (1.0-java)
+
+ PATH
+ remote: .
+ specs:
+ foo (1.0)
+ platform_specific
+
+ PLATFORMS
+ java
+ ruby
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+ end
+
+ context "as a development dependency" do
+ let(:platform_specific_type) { :development }
+
+ it "keeps java dependencies in the lockfile" do
+ expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
+ expect(lockfile).to eq strip_whitespace(<<-L)
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+ platform_specific (1.0)
+ platform_specific (1.0-java)
+
+ PATH
+ remote: .
+ specs:
+ foo (1.0)
+
+ PLATFORMS
+ java
+ ruby
+
+ DEPENDENCIES
+ foo!
+ platform_specific
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+ end
+
+ context "with an indirect platform-specific development dependency" do
+ let(:platform_specific_type) { :development }
+ let(:dependency) { "indirect_platform_specific" }
+
+ it "keeps java dependencies in the lockfile" do
+ expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY"
+ expect(lockfile).to eq strip_whitespace(<<-L)
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+ indirect_platform_specific (1.0)
+ platform_specific
+ platform_specific (1.0)
+ platform_specific (1.0-java)
+
+ PATH
+ remote: .
+ specs:
+ foo (1.0)
+
+ PLATFORMS
+ java
+ ruby
+
+ DEPENDENCIES
+ foo!
+ indirect_platform_specific
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+ end
+ end
end
end
@@ -551,7 +660,7 @@ RSpec.describe "bundle install from an existing gemspec" do
it "installs the ruby platform gemspec and skips dev deps with --without development" do
simulate_platform "ruby"
- install_gemfile! <<-G, :without => "development"
+ install_gemfile! <<-G, forgotten_command_line_options(:without => "development")
source "file://#{gem_repo1}"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
G
diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb
index 5868c76570..57d83a5295 100644
--- a/spec/bundler/install/gemfile/git_spec.rb
+++ b/spec/bundler/install/gemfile/git_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with git sources" do
describe "when floating on master" do
@@ -27,8 +26,15 @@ RSpec.describe "bundle install with git sources" do
expect(out).to eq("WIN")
end
- it "caches the git repo" do
- expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"].size).to eq(1)
+ it "caches the git repo", :bundler => "< 2" do
+ expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to have_attributes :size => 1
+ end
+
+ it "caches the git repo globally" do
+ simulate_new_machine
+ bundle! "config global_gem_cache true"
+ bundle! :install
+ expect(Dir["#{home}/.bundle/cache/git/foo-1.0-*"]).to have_attributes :size => 1
end
it "caches the evaluated gemspec" do
@@ -81,7 +87,7 @@ RSpec.describe "bundle install with git sources" do
gem "foo", "1.1", :git => "#{lib_path("foo-1.0")}"
G
- expect(out).to include("Source contains 'foo' at: 1.0 ruby")
+ expect(out).to include("The source contains 'foo' at: 1.0")
end
it "complains with version and platform if pinned specs don't exist in the git repo" do
@@ -97,7 +103,7 @@ RSpec.describe "bundle install with git sources" do
end
G
- expect(out).to include("Source contains 'only_java' at: 1.0 java")
+ expect(out).to include("The source contains 'only_java' at: 1.0 java")
end
it "complains with multiple versions and platforms if pinned specs don't exist in the git repo" do
@@ -118,7 +124,7 @@ RSpec.describe "bundle install with git sources" do
end
G
- expect(out).to include("Source contains 'only_java' at: 1.0 java, 1.1 java")
+ expect(out).to include("The source contains 'only_java' at: 1.0 java, 1.1 java")
end
it "still works after moving the application directory" do
@@ -207,6 +213,95 @@ RSpec.describe "bundle install with git sources" do
expect(out).to eq("WIN")
end
+
+ it "works when the revision is a non-head ref" do
+ # want to ensure we don't fallback to master
+ update_git "foo", :path => lib_path("foo-1.0") do |s|
+ s.write("lib/foo.rb", "raise 'FAIL'")
+ end
+
+ Dir.chdir(lib_path("foo-1.0")) do
+ `git update-ref -m 'Bundler Spec!' refs/bundler/1 master~1`
+ end
+
+ # want to ensure we don't fallback to HEAD
+ update_git "foo", :path => lib_path("foo-1.0"), :branch => "rando" do |s|
+ s.write("lib/foo.rb", "raise 'FAIL'")
+ end
+
+ install_gemfile! <<-G
+ git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do
+ gem "foo"
+ end
+ G
+ expect(err).to lack_errors
+
+ run! <<-RUBY
+ require 'foo'
+ puts "WIN" if defined?(FOO)
+ RUBY
+
+ expect(out).to eq("WIN")
+ end
+
+ it "works when the revision is a non-head ref and it was previously downloaded" do
+ install_gemfile! <<-G
+ git "#{lib_path("foo-1.0")}" do
+ gem "foo"
+ end
+ G
+
+ # want to ensure we don't fallback to master
+ update_git "foo", :path => lib_path("foo-1.0") do |s|
+ s.write("lib/foo.rb", "raise 'FAIL'")
+ end
+
+ Dir.chdir(lib_path("foo-1.0")) do
+ `git update-ref -m 'Bundler Spec!' refs/bundler/1 master~1`
+ end
+
+ # want to ensure we don't fallback to HEAD
+ update_git "foo", :path => lib_path("foo-1.0"), :branch => "rando" do |s|
+ s.write("lib/foo.rb", "raise 'FAIL'")
+ end
+
+ install_gemfile! <<-G
+ git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do
+ gem "foo"
+ end
+ G
+ expect(err).to lack_errors
+
+ run! <<-RUBY
+ require 'foo'
+ puts "WIN" if defined?(FOO)
+ RUBY
+
+ expect(out).to eq("WIN")
+ end
+
+ it "does not download random non-head refs" do
+ Dir.chdir(lib_path("foo-1.0")) do
+ sys_exec!("git update-ref -m 'Bundler Spec!' refs/bundler/1 master~1")
+ end
+
+ bundle! "config global_gem_cache true"
+
+ install_gemfile! <<-G
+ git "#{lib_path("foo-1.0")}" do
+ gem "foo"
+ end
+ G
+
+ # ensure we also git fetch after cloning
+ bundle! :update, :all => bundle_update_requires_all?
+
+ Dir.chdir(Dir[home(".bundle/cache/git/foo-*")].first) do
+ sys_exec("git ls-remote .")
+ end
+
+ expect(out).not_to include("refs/bundler/1")
+ end
end
describe "when specifying a branch" do
@@ -311,9 +406,8 @@ RSpec.describe "bundle install with git sources" do
gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master"
G
- bundle %(config local.rack #{lib_path("local-rack")})
- bundle :install
- expect(out).to match(/at #{lib_path('local-rack')}/)
+ bundle! %(config local.rack #{lib_path("local-rack")})
+ bundle! :install
run "require 'rack'"
expect(out).to eq("LOCAL")
@@ -704,14 +798,14 @@ RSpec.describe "bundle install with git sources" do
s.write "lib/forced.rb", "FORCED = '1.1'"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "forced 1.1"
Dir.chdir(lib_path("forced-1.0")) do
`git reset --hard HEAD^`
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "forced 1.0"
end
@@ -808,6 +902,7 @@ RSpec.describe "bundle install with git sources" do
it "prints a friendly error if a file blocks the git repo" do
build_git "foo"
+ FileUtils.mkdir_p(default_bundle_path)
FileUtils.touch(default_bundle_path("bundler"))
install_gemfile <<-G
@@ -937,8 +1032,7 @@ RSpec.describe "bundle install with git sources" do
simulate_new_machine
- bundle "install --deployment"
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! :install, forgotten_command_line_options(:deployment => true)
end
end
@@ -1034,7 +1128,7 @@ RSpec.describe "bundle install with git sources" do
run! <<-R
puts $:.grep(/ext/)
R
- expect(out).to eq(Pathname.glob(system_gem_path("bundler/gems/extensions/**/foo-1.0-*")).first.to_s)
+ expect(out).to eq(Pathname.glob(default_bundle_path("bundler/gems/extensions/**/foo-1.0-*")).first.to_s)
end
it "does not use old extension after ref changes", :ruby_repo do
@@ -1058,11 +1152,11 @@ RSpec.describe "bundle install with git sources" do
end
`git commit -m 'commit for iteration #{i}' ext/foo.c`
end
- git_sha = git_reader.ref_for("HEAD")
+ git_commit_sha = git_reader.ref_for("HEAD")
install_gemfile <<-G
source "file://#{gem_repo1}"
- gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{git_sha}"
+ gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{git_commit_sha}"
G
run <<-R
@@ -1090,7 +1184,7 @@ RSpec.describe "bundle install with git sources" do
gem "foo", :git => "#{lib_path("foo-1.0")}"
G
- expect(out).to end_with(<<-M.strip)
+ expect(last_command.bundler_err).to end_with(<<-M.strip)
An error occurred while installing foo (1.0), and Bundler cannot continue.
In Gemfile:
@@ -1174,9 +1268,10 @@ In Gemfile:
G
with_path_as("") do
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
end
- expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
+ expect(last_command.bundler_err).
+ to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
end
it "installs a packaged git gem successfully" do
@@ -1187,18 +1282,17 @@ In Gemfile:
gem 'foo'
end
G
- bundle "package --all"
+ bundle :package, forgotten_command_line_options([:all, :cache_all] => true)
simulate_new_machine
- bundle "install", :env => { "PATH" => "" }
+ bundle! "install", :env => { "PATH" => "" }
expect(out).to_not include("You need to install git to be able to use gems from git repositories.")
- expect(exitstatus).to be_zero if exitstatus
end
end
- describe "when the git source is overriden with a local git repo" do
+ describe "when the git source is overridden with a local git repo" do
before do
- bundle "config --global local.foo #{lib_path("foo")}"
+ bundle! "config --global local.foo #{lib_path("foo")}"
end
describe "and git output is colorized" do
@@ -1233,9 +1327,8 @@ In Gemfile:
G
bundle :install
- expect(out).to_not include("password1")
- expect(err).to_not include("password1")
- expect(out).to include("Fetching https://user1@github.com/company/private-repo")
+ expect(last_command.stdboth).to_not include("password1")
+ expect(last_command.stdout).to include("Fetching https://user1@github.com/company/private-repo")
end
end
@@ -1250,9 +1343,8 @@ In Gemfile:
G
bundle :install
- expect(out).to_not include("oauth_token")
- expect(err).to_not include("oauth_token")
- expect(out).to include("Fetching https://x-oauth-basic@github.com/company/private-repo")
+ expect(last_command.stdboth).to_not include("oauth_token")
+ expect(last_command.stdout).to include("Fetching https://x-oauth-basic@github.com/company/private-repo")
end
end
end
diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb
index a3a5eeefdf..19c379e188 100644
--- a/spec/bundler/install/gemfile/groups_spec.rb
+++ b/spec/bundler/install/gemfile/groups_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with groups" do
describe "installing with no options" do
@@ -87,7 +86,7 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle :install, :without => "emo"
+ bundle! :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
end
@@ -97,20 +96,20 @@ RSpec.describe "bundle install with groups" do
end
it "does not install gems from the previously excluded group" do
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "does not say it installed gems from the excluded group" do
- bundle :install, :without => "emo"
+ bundle! :install, forgotten_command_line_options(:without => "emo")
expect(out).not_to include("activesupport")
end
it "allows Bundler.setup for specific groups" do
- bundle :install, :without => "emo"
- run("require 'rack'; puts RACK", :default)
+ bundle :install, forgotten_command_line_options(:without => "emo")
+ run!("require 'rack'; puts RACK", :default)
expect(out).to eq("1.0.0")
end
@@ -123,15 +122,15 @@ RSpec.describe "bundle install with groups" do
end
G
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.2", :groups => [:default]
end
it "still works on a different machine and excludes gems" do
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
simulate_new_machine
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "rack 1.0.0", :groups => [:default]
expect(the_bundle).not_to include_gems "activesupport 2.3.5", :groups => [:default]
@@ -150,14 +149,14 @@ RSpec.describe "bundle install with groups" do
end
it "clears without when passed an empty list" do
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
- bundle 'install --without ""'
+ bundle :install, forgotten_command_line_options(:without => "")
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "doesn't clear without when nothing is passed" do
- bundle :install, :without => "emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
bundle :install
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
@@ -169,12 +168,12 @@ RSpec.describe "bundle install with groups" do
end
it "does install gems from the optional group when requested" do
- bundle :install, :with => "debugging"
+ bundle :install, forgotten_command_line_options(:with => "debugging")
expect(the_bundle).to include_gems "thin 1.0"
end
it "does install gems from the previously requested group" do
- bundle :install, :with => "debugging"
+ bundle :install, forgotten_command_line_options(:with => "debugging")
expect(the_bundle).to include_gems "thin 1.0"
bundle :install
expect(the_bundle).to include_gems "thin 1.0"
@@ -188,41 +187,55 @@ RSpec.describe "bundle install with groups" do
end
it "clears with when passed an empty list" do
- bundle :install, :with => "debugging"
- bundle 'install --with ""'
+ bundle :install, forgotten_command_line_options(:with => "debugging")
+ bundle :install, forgotten_command_line_options(:with => "")
expect(the_bundle).not_to include_gems "thin 1.0"
end
- it "does remove groups from without when passed at with" do
- bundle :install, :without => "emo"
- bundle :install, :with => "emo"
+ it "does remove groups from without when passed at --with", :bundler => "< 2" do
+ bundle :install, forgotten_command_line_options(:without => "emo")
+ bundle :install, forgotten_command_line_options(:with => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
- it "does remove groups from with when passed at without" do
- bundle :install, :with => "debugging"
- bundle :install, :without => "debugging"
- expect(the_bundle).not_to include_gems "thin 1.0"
+ it "does remove groups from with when passed at --without", :bundler => "< 2" do
+ bundle :install, forgotten_command_line_options(:with => "debugging")
+ bundle :install, forgotten_command_line_options(:without => "debugging")
+ expect(the_bundle).not_to include_gem "thin 1.0"
end
- it "errors out when passing a group to with and without" do
- bundle :install, :with => "emo debugging", :without => "emo"
+ it "errors out when passing a group to with and without via CLI flags", :bundler => "< 2" do
+ bundle :install, forgotten_command_line_options(:with => "emo debugging", :without => "emo")
+ expect(last_command).to be_failure
expect(out).to include("The offending groups are: emo")
end
+ it "allows the BUNDLE_WITH setting to override BUNDLE_WITHOUT" do
+ ENV["BUNDLE_WITH"] = "debugging"
+
+ bundle! :install
+ expect(the_bundle).to include_gem "thin 1.0"
+
+ ENV["BUNDLE_WITHOUT"] = "debugging"
+ expect(the_bundle).to include_gem "thin 1.0"
+
+ bundle! :install
+ expect(the_bundle).to include_gem "thin 1.0"
+ end
+
it "can add and remove a group at the same time" do
- bundle :install, :with => "debugging", :without => "emo"
+ bundle :install, forgotten_command_line_options(:with => "debugging", :without => "emo")
expect(the_bundle).to include_gems "thin 1.0"
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "does have no effect when listing a not optional group in with" do
- bundle :install, :with => "emo"
+ bundle :install, forgotten_command_line_options(:with => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "does have no effect when listing an optional group in without" do
- bundle :install, :without => "debugging"
+ bundle :install, forgotten_command_line_options(:without => "debugging")
expect(the_bundle).not_to include_gems "thin 1.0"
end
end
@@ -239,12 +252,12 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle :install, :without => "emo lolercoaster"
+ bundle! :install, forgotten_command_line_options(:without => "emo lolercoaster")
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "installs the gem if any of its groups are installed" do
- bundle "install --without emo"
+ bundle! :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end
@@ -265,22 +278,22 @@ RSpec.describe "bundle install with groups" do
end
it "installs the gem w/ option --without emo" do
- bundle "install --without emo"
+ bundle :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "installs the gem w/ option --without lolercoaster" do
- bundle "install --without lolercoaster"
+ bundle :install, forgotten_command_line_options(:without => "lolercoaster")
expect(the_bundle).to include_gems "activesupport 2.3.5"
end
it "does not install the gem w/ option --without emo lolercoaster" do
- bundle "install --without emo lolercoaster"
+ bundle :install, forgotten_command_line_options(:without => "emo lolercoaster")
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
it "does not install the gem w/ option --without 'emo lolercoaster'" do
- bundle "install --without 'emo lolercoaster'"
+ bundle :install, forgotten_command_line_options(:without => "'emo lolercoaster'")
expect(the_bundle).not_to include_gems "activesupport 2.3.5"
end
end
@@ -300,12 +313,12 @@ RSpec.describe "bundle install with groups" do
end
it "installs gems in the default group" do
- bundle :install, :without => "emo lolercoaster"
+ bundle! :install, forgotten_command_line_options(:without => "emo lolercoaster")
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "installs the gem if any of its groups are installed" do
- bundle "install --without emo"
+ bundle! :install, forgotten_command_line_options(:without => "emo")
expect(the_bundle).to include_gems "rack 1.0.0", "activesupport 2.3.5"
end
end
@@ -340,7 +353,7 @@ RSpec.describe "bundle install with groups" do
before(:each) do
build_repo2
system_gems "rack-0.9.1" do
- install_gemfile <<-G, :without => :rack
+ install_gemfile <<-G, forgotten_command_line_options(:without => "rack")
source "file://#{gem_repo2}"
gem "rack"
@@ -364,8 +377,8 @@ RSpec.describe "bundle install with groups" do
it "does not hit the remote a second time" do
FileUtils.rm_rf gem_repo2
- bundle "install --without rack"
- expect(err).to lack_errors
+ bundle! :install, forgotten_command_line_options(:without => "rack").merge(:verbose => true)
+ expect(last_command.stdboth).not_to match(/fetching/i)
end
end
end
diff --git a/spec/bundler/install/gemfile/install_if.rb b/spec/bundler/install/gemfile/install_if.rb
index b1717ad583..1319051fdb 100644
--- a/spec/bundler/install/gemfile/install_if.rb
+++ b/spec/bundler/install/gemfile/install_if.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
describe "bundle install with install_if conditionals" do
it "follows the install_if DSL" do
diff --git a/spec/bundler/install/gemfile/lockfile_spec.rb b/spec/bundler/install/gemfile/lockfile_spec.rb
new file mode 100644
index 0000000000..dc1baca6ea
--- /dev/null
+++ b/spec/bundler/install/gemfile/lockfile_spec.rb
@@ -0,0 +1,48 @@
+# frozen_string_literal: true
+
+RSpec.describe "bundle install with a lockfile present" do
+ let(:gf) { <<-G }
+ source "file://#{gem_repo1}"
+
+ gem "rack", "1.0.0"
+ G
+
+ subject do
+ install_gemfile(gf)
+ end
+
+ context "gemfile evaluation" do
+ let(:gf) { super() + "\n\n File.open('evals', 'a') {|f| f << %(1\n) } unless ENV['BUNDLER_SPEC_NO_APPEND']" }
+
+ context "with plugins disabled" do
+ before do
+ bundle! "config plugins false"
+ subject
+ end
+
+ it "does not evaluate the gemfile twice" do
+ bundle! :install
+
+ with_env_vars("BUNDLER_SPEC_NO_APPEND" => "1") { expect(the_bundle).to include_gem "rack 1.0.0" }
+
+ # The first eval is from the initial install, we're testing that the
+ # second install doesn't double-eval
+ expect(bundled_app("evals").read.lines.to_a.size).to eq(2)
+ end
+
+ context "when the gem is not installed" do
+ before { FileUtils.rm_rf ".bundle" }
+
+ it "does not evaluate the gemfile twice" do
+ bundle! :install
+
+ with_env_vars("BUNDLER_SPEC_NO_APPEND" => "1") { expect(the_bundle).to include_gem "rack 1.0.0" }
+
+ # The first eval is from the initial install, we're testing that the
+ # second install doesn't double-eval
+ expect(bundled_app("evals").read.lines.to_a.size).to eq(2)
+ end
+ end
+ end
+ end
+end
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index a1c41aebbb..f7789e7ea5 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -1,8 +1,7 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with explicit source paths" do
- it "fetches gems" do
+ it "fetches gems with a global path source", :bundler => "< 2" do
build_lib "foo"
install_gemfile <<-G
@@ -13,6 +12,18 @@ RSpec.describe "bundle install with explicit source paths" do
expect(the_bundle).to include_gems("foo 1.0")
end
+ it "fetches gems" do
+ build_lib "foo"
+
+ install_gemfile <<-G
+ path "#{lib_path("foo-1.0")}" do
+ gem 'foo'
+ end
+ G
+
+ expect(the_bundle).to include_gems("foo 1.0")
+ end
+
it "supports pinned paths" do
build_lib "foo"
@@ -79,7 +90,7 @@ RSpec.describe "bundle install with explicit source paths" do
gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__)
G
- bundle "install --frozen"
+ bundle! :install, forgotten_command_line_options(:frozen => true)
expect(exitstatus).to eq(0) if exitstatus
end
@@ -270,8 +281,9 @@ RSpec.describe "bundle install with explicit source paths" do
end
install_gemfile <<-G
- path "#{lib_path("foo-1.0")}"
- gem 'foo'
+ path "#{lib_path("foo-1.0")}" do
+ gem 'foo'
+ end
G
expect(the_bundle).to include_gems "foo 1.0"
@@ -591,5 +603,28 @@ RSpec.describe "bundle install with explicit source paths" do
:requires => [lib_path("install_hooks.rb")]
expect(out).to include("failed for foo-1.0")
end
+
+ it "loads plugins from the path gem" do
+ foo_file = home("foo_plugin_loaded")
+ bar_file = home("bar_plugin_loaded")
+ expect(foo_file).not_to be_file
+ expect(bar_file).not_to be_file
+
+ build_lib "foo" do |s|
+ s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{foo_file}')")
+ end
+
+ build_git "bar" do |s|
+ s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{bar_file}')")
+ end
+
+ install_gemfile! <<-G
+ gem "foo", :path => "#{lib_path("foo-1.0")}"
+ gem "bar", :path => "#{lib_path("bar-1.0")}"
+ G
+
+ expect(foo_file).to be_file
+ expect(bar_file).to be_file
+ end
end
end
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index c6eaec7ca6..d7d4e0a53c 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install across platforms" do
it "maintains the same lockfile if all gems are compatible across platforms" do
@@ -88,7 +87,7 @@ RSpec.describe "bundle install across platforms" do
expect(the_bundle).to include_gems "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
end
- it "works with gems that have extra platform-specific runtime dependencies" do
+ it "works with gems that have extra platform-specific runtime dependencies", :bundler => "< 2" do
simulate_platform x64_mac
update_repo2 do
@@ -121,12 +120,12 @@ RSpec.describe "bundle install across platforms" do
gem "rack", "1.0.0"
G
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, new_version))
- bundle "install --path vendor/bundle"
+ bundle! :install
expect(vendored_gems("gems/rack-1.0.0")).to exist
end
end
@@ -200,7 +199,7 @@ RSpec.describe "bundle install with platform conditionals" do
end
G
- bundle :show
+ bundle :list
expect(exitstatus).to eq(0) if exitstatus
end
diff --git a/spec/bundler/install/gemfile/ruby_spec.rb b/spec/bundler/install/gemfile/ruby_spec.rb
index b9d9683758..24fe021fa3 100644
--- a/spec/bundler/install/gemfile/ruby_spec.rb
+++ b/spec/bundler/install/gemfile/ruby_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "ruby requirement" do
def locked_ruby_version
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index c5375b4abf..0b837f87a1 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with gems on multiple sources" do
# repo1 is built automatically before all of the specs run
@@ -29,7 +28,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config major_deprecations true"
end
- it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first" do
+ it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 2" do
bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@@ -59,7 +58,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config major_deprecations true"
end
- it "warns about ambiguous gems, but installs anyway" do
+ it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do
bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@@ -79,6 +78,10 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "rack", "1.0.0" do |s|
s.write "lib/rack.rb", "RACK = 'FAIL'"
end
+
+ build_gem "rack-obama" do |s|
+ s.add_dependency "rack"
+ end
end
gemfile <<-G
@@ -92,21 +95,20 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs the gems without any warning" do
- bundle :install
+ bundle! :install
expect(out).not_to include("Warning")
expect(the_bundle).to include_gems("rack-obama 1.0.0")
expect(the_bundle).to include_gems("rack 1.0.0", :source => "remote1")
end
it "can cache and deploy" do
- bundle :package
+ bundle! :package
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
expect(bundled_app("vendor/cache/rack-obama-1.0.gem")).to exist
- bundle "install --deployment"
+ bundle! :install, forgotten_command_line_options(:deployment => true)
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0")
end
end
@@ -119,6 +121,10 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "rack", "1.0.0" do |s|
s.write "lib/rack.rb", "RACK = 'FAIL'"
end
+
+ build_gem "rack-obama" do |s|
+ s.add_dependency "rack"
+ end
end
gemfile <<-G
@@ -135,7 +141,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "with an indirect dependency" do
+ context "when a pinned gem has an indirect dependency" do
before do
build_repo gem_repo3 do
build_gem "depends_on_rack", "1.0.1" do |s|
@@ -181,10 +187,27 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- it "installs from the same source without any warning" do
- bundle :install
- expect(out).not_to include("Warning")
- expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
+ context "when lockfile_uses_separate_rubygems_sources is set" do
+ before do
+ bundle! "config lockfile_uses_separate_rubygems_sources true"
+ bundle! "config disable_multisource true"
+ end
+
+ it "installs from the same source without any warning" do
+ bundle! :install
+
+ expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
+
+ # when there is already a lock file, and the gems are missing, so try again
+ system_gems []
+ bundle! :install
+
+ expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
+ end
end
end
end
@@ -225,7 +248,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "installs from the other source and warns about ambiguous gems" do
+ it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do
bundle "config major_deprecations true"
bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@@ -253,7 +276,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "installs the dependency from the pinned source without warning" do
+ it "installs the dependency from the pinned source without warning", :bundler => "< 2" do
bundle :install
expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
@@ -271,6 +294,86 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
+ context "when a top-level gem has an indirect dependency" do
+ context "when lockfile_uses_separate_rubygems_sources is set" do
+ before do
+ bundle! "config lockfile_uses_separate_rubygems_sources true"
+ bundle! "config disable_multisource true"
+ end
+
+ before do
+ build_repo gem_repo2 do
+ build_gem "depends_on_rack", "1.0.1" do |s|
+ s.add_dependency "rack"
+ end
+ end
+
+ build_repo gem_repo3 do
+ build_gem "unrelated_gem", "1.0.0"
+ end
+
+ gemfile <<-G
+ source "file://#{gem_repo2}"
+
+ gem "depends_on_rack"
+
+ source "file://#{gem_repo3}" do
+ gem "unrelated_gem"
+ end
+ G
+ end
+
+ context "and the dependency is only in the top-level source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0"
+ end
+ end
+
+ it "installs all gems without warning" do
+ bundle :install
+ expect(out).not_to include("Warning")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ end
+ end
+
+ context "and the dependency is only in a pinned source" do
+ before do
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0" do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
+ end
+ end
+ end
+
+ it "does not find the dependency" do
+ bundle :install
+ expect(out).to include("Could not find gem 'rack', which is required by gem 'depends_on_rack', in any of the relevant sources")
+ end
+ end
+
+ context "and the dependency is in both the top-level and a pinned source" do
+ before do
+ update_repo gem_repo2 do
+ build_gem "rack", "1.0.0"
+ end
+
+ update_repo gem_repo3 do
+ build_gem "rack", "1.0.0" do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
+ end
+ end
+ end
+
+ it "installs the dependency from the top-level source without warning" do
+ bundle :install
+ expect(out).not_to include("Warning")
+ expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
+ end
+ end
+ end
+ end
+
context "with a gem that is only found in the wrong source" do
before do
build_repo gem_repo3 do
@@ -291,7 +394,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "with an existing lockfile" do
before do
- system_gems "rack-0.9.1", "rack-1.0.0"
+ system_gems "rack-0.9.1", "rack-1.0.0", :path => :bundle_path
lockfile <<-L
GEM
@@ -394,7 +497,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
rack
L
- bundle "install --path ../gems/system"
+ bundle! :install, forgotten_command_line_options(:path => "../gems/system")
# 4. Then we add some new versions...
update_repo4 do
@@ -413,8 +516,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
# 6. Which should update foo to 0.2, but not the (locked) bar 0.1
- expect(the_bundle).to include_gems("foo 0.2")
- expect(the_bundle).to include_gems("bar 0.1")
+ expect(the_bundle).to include_gems("foo 0.2", "bar 0.1")
end
end
diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb
index cc6c82c0ff..9c725416d5 100644
--- a/spec/bundler/install/gemfile/specific_platform_spec.rb
+++ b/spec/bundler/install/gemfile/specific_platform_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with specific_platform enabled" do
before do
@@ -61,10 +60,10 @@ RSpec.describe "bundle install with specific_platform enabled" do
install_gemfile!(google_protobuf)
expect(the_bundle.locked_gems.platforms).to eq([pl("ruby"), pl("x86_64-darwin-15")])
expect(the_bundle).to include_gem("google-protobuf 3.0.0.alpha.5.0.5.1 universal-darwin")
- expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w(
+ expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[
google-protobuf-3.0.0.alpha.5.0.5.1
google-protobuf-3.0.0.alpha.5.0.5.1-universal-darwin
- ))
+ ])
end
it "caches both the universal-darwin and ruby gems when --all-platforms is passed" do
@@ -93,11 +92,11 @@ RSpec.describe "bundle install with specific_platform enabled" do
bundle! "lock --add-platform=#{x64_mingw}"
expect(the_bundle.locked_gems.platforms).to eq([rb, x64_mingw, pl("x86_64-darwin-15")])
- expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w(
+ expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[
google-protobuf-3.0.0.alpha.5.0.5.1
google-protobuf-3.0.0.alpha.5.0.5.1-universal-darwin
google-protobuf-3.0.0.alpha.5.0.5.1-x64-mingw32
- ))
+ ])
end
it "falls back on plain ruby when that version doesnt have a platform-specific gem" do
@@ -105,10 +104,10 @@ RSpec.describe "bundle install with specific_platform enabled" do
bundle! "lock --add-platform=#{java}"
expect(the_bundle.locked_gems.platforms).to eq([java, rb, pl("x86_64-darwin-15")])
- expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w(
+ expect(the_bundle.locked_gems.specs.map(&:full_name)).to eq(%w[
google-protobuf-3.0.0.alpha.5.0.5.1
google-protobuf-3.0.0.alpha.5.0.5.1-universal-darwin
- ))
+ ])
end
end
end
diff --git a/spec/bundler/install/gemfile_spec.rb b/spec/bundler/install/gemfile_spec.rb
index bc49053081..945d9f485d 100644
--- a/spec/bundler/install/gemfile_spec.rb
+++ b/spec/bundler/install/gemfile_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
context "with duplicated gems" do
@@ -37,7 +36,7 @@ RSpec.describe "bundle install" do
end
it "uses the gemfile to install" do
bundle "install"
- bundle "show"
+ bundle "list"
expect(out).to include("rack (1.0.0)")
end
@@ -45,7 +44,7 @@ RSpec.describe "bundle install" do
bundled_app("subdir").mkpath
Dir.chdir(bundled_app("subdir")) do
bundle "install"
- bundle "show"
+ bundle "list"
expect(out).to include("rack (1.0.0)")
end
@@ -67,6 +66,22 @@ RSpec.describe "bundle install" do
end
end
+ context "with prefer_gems_rb set" do
+ before { bundle! "config prefer_gems_rb true" }
+
+ it "prefers gems.rb to Gemfile" do
+ create_file("gems.rb", "gem 'bundler'")
+ create_file("Gemfile", "raise 'wrong Gemfile!'")
+
+ bundle! :install
+
+ expect(bundled_app("gems.rb")).to be_file
+ expect(bundled_app("Gemfile.lock")).not_to be_file
+
+ expect(the_bundle).to include_gem "bundler #{Bundler::VERSION}"
+ end
+ end
+
context "with engine specified in symbol" do
it "does not raise any error parsing Gemfile" do
simulate_ruby_version "2.3.0" do
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 825185c82e..07700f5030 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "compact index api" do
let(:source_hostname) { "localgemserver.test" }
@@ -61,7 +60,7 @@ RSpec.describe "compact index api" do
# can't use `include_gems` here since the `require` will conflict on a
# case-insensitive FS
run! "Bundler.require; puts Gem.loaded_specs.values_at('rack', 'Rack').map(&:full_name)"
- expect(out).to eq("rack-1.0\nRack-0.1")
+ expect(last_command.stdout).to eq("rack-1.0\nRack-0.1")
end
it "should handle multiple gem dependencies on the same gem" do
@@ -81,7 +80,7 @@ RSpec.describe "compact index api" do
G
bundle! :install, :artifice => "compact_index"
- bundle "install --deployment", :artifice => "compact_index"
+ bundle! :install, forgotten_command_line_options(:deployment => true, :path => "vendor/bundle").merge(:artifice => "compact_index")
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -130,9 +129,8 @@ RSpec.describe "compact index api" do
G
bundle "install", :artifice => "compact_index"
- bundle "install --deployment", :artifice => "compact_index"
+ bundle! :install, forgotten_command_line_options(:deployment => true).merge(:artifice => "compact_index")
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems("foo 1.0")
end
@@ -175,7 +173,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "falls back when the user's home directory does not exist or is not writable" do
- ENV["HOME"] = nil
+ ENV["HOME"] = tmp("missing_home").to_s
gemfile <<-G
source "#{source_uri}"
@@ -249,13 +247,29 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle "update --full-index", :artifice => "compact_index"
+ bundle! "update --full-index", :artifice => "compact_index", :all => bundle_update_requires_all?
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
end
- it "fetches again when more dependencies are found in subsequent sources" do
+ it "does not double check for gems that are only installed locally" do
+ system_gems %w[rack-1.0.0 thin-1.0 net_a-1.0]
+ bundle! "config --local path.system true"
+ ENV["BUNDLER_SPEC_ALL_REQUESTS"] = strip_whitespace(<<-EOS).strip
+ #{source_uri}/versions
+ #{source_uri}/info/rack
+ EOS
+
+ install_gemfile! <<-G, :artifice => "compact_index", :verbose => true
+ source "#{source_uri}"
+ gem "rack"
+ G
+
+ expect(last_command.stdboth).not_to include "Double checking"
+ end
+
+ it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 2" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -270,7 +284,25 @@ The checksum of /versions does not match the checksum provided by the server! So
G
bundle! :install, :artifice => "compact_index_extra"
- expect(the_bundle).to include_gems "back_deps 1.0"
+ expect(the_bundle).to include_gems "back_deps 1.0", "foo 1.0"
+ end
+
+ it "fetches again when more dependencies are found in subsequent sources with source blocks" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ install_gemfile! <<-G, :artifice => "compact_index_extra", :verbose => true
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ expect(the_bundle).to include_gems "back_deps 1.0", "foo 1.0"
end
it "fetches gem versions even when those gems are already installed" do
@@ -296,7 +328,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "rack 1.2"
end
- it "considers all possible versions of dependencies from all api gem sources" do
+ it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 2" do
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
@@ -320,6 +352,31 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "activesupport 1.2.3"
end
+ it "considers all possible versions of dependencies from all api gem sources when using blocks", :bundler => "< 2" do
+ # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
+ # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
+ # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
+ # repo and installs it.
+ build_repo4 do
+ build_gem "activesupport", "1.2.0"
+ build_gem "somegem", "1.0.0" do |s|
+ s.add_dependency "activesupport", "1.2.3" # This version exists only in repo1
+ end
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem 'somegem', '1.0.0'
+ end
+ G
+
+ bundle! :install, :artifice => "compact_index_extra_api"
+
+ expect(the_bundle).to include_gems "somegem 1.0.0"
+ expect(the_bundle).to include_gems "activesupport 1.2.3"
+ end
+
it "prints API output properly with back deps" do
build_repo2 do
build_gem "back_deps" do |s|
@@ -330,8 +387,9 @@ The checksum of /versions does not match the checksum provided by the server! So
gemfile <<-G
source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
G
bundle! :install, :artifice => "compact_index_extra"
@@ -356,14 +414,39 @@ The checksum of /versions does not match the checksum provided by the server! So
gemfile <<-G
source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
G
bundle! :install, :artifice => "compact_index_extra_missing"
expect(the_bundle).to include_gems "back_deps 1.0"
end
+ it "does not fetch every spec if the index of gems is large when doing back deps & everything is the compact index" do
+ build_repo4 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ build_gem "missing"
+ # need to hit the limit
+ 1.upto(Bundler::Source::Rubygems::API_REQUEST_LIMIT) do |i|
+ build_gem "gem#{i}"
+ end
+
+ FileUtils.rm_rf Dir[gem_repo4("gems/foo-*.gem")]
+ end
+
+ install_gemfile! <<-G, :artifice => "compact_index_extra_api_missing"
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ expect(the_bundle).to include_gem "back_deps 1.0"
+ end
+
it "uses the endpoint if all sources support it" do
gemfile <<-G
source "#{source_uri}"
@@ -375,7 +458,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "foo 1.0"
end
- it "fetches again when more dependencies are found in subsequent sources using --deployment" do
+ it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 2" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -395,6 +478,27 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "back_deps 1.0"
end
+ it "fetches again when more dependencies are found in subsequent sources using --deployment with blocks" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ bundle! :install, :artifice => "compact_index_extra"
+
+ bundle "install --deployment", :artifice => "compact_index_extra"
+ expect(the_bundle).to include_gems "back_deps 1.0"
+ end
+
it "does not refetch if the only unmet dependency is bundler" do
gemfile <<-G
source "#{source_uri}"
@@ -418,7 +522,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "rails 2.3.2"
end
- it "installs the binstubs" do
+ it "installs the binstubs", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -430,7 +534,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(out).to eq("1.0.0")
end
- it "installs the bins when using --path and uses autoclean" do
+ it "installs the bins when using --path and uses autoclean", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -441,7 +545,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(vendored_gems("bin/rackup")).to exist
end
- it "installs the bins when using --path and uses bundle clean" do
+ it "installs the bins when using --path and uses bundle clean", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -516,7 +620,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(out).not_to include("#{user}:#{password}")
end
- it "strips http basic auth creds when warning about ambiguous sources" do
+ it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 2" do
gemfile <<-G
source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}"
@@ -613,7 +717,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
end
- context "when ruby is compiled without openssl" do
+ context "when ruby is compiled without openssl", :ruby_repo do
before do
# Install a monkeypatch that reproduces the effects of openssl being
# missing when the fetcher runs, as happens in real life. The reason
@@ -640,7 +744,7 @@ The checksum of /versions does not match the checksum provided by the server! So
context "when SSL certificate verification fails" do
it "explains what happened" do
# Install a monkeypatch that reproduces the effects of openssl raising
- # a certificate validation error when Rubygems tries to connect.
+ # a certificate validation error when RubyGems tries to connect.
gemfile <<-G
class Net::HTTP
def start
@@ -741,7 +845,7 @@ The checksum of /versions does not match the checksum provided by the server! So
and include("The checksum for the downloaded `rack-1.0.0.gem` does not match the checksum given by the server.").
and include("This means the contents of the downloaded gem is different from what was uploaded to the server, and could be a potential security issue.").
and include("To resolve this issue:").
- and include("1. delete the downloaded gem located at: `#{system_gem_path}/gems/rack-1.0.0/rack-1.0.0.gem`").
+ and include("1. delete the downloaded gem located at: `#{default_bundle_path}/gems/rack-1.0.0/rack-1.0.0.gem`").
and include("2. run `bundle install`").
and include("If you wish to continue installing the downloaded gem, and are certain it does not pose a security issue despite the mismatching checksum, do the following:").
and include("1. run `bundle config disable_checksum_validation true` to turn off checksum verification").
diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb
index d2de0d358b..fe696f38c3 100644
--- a/spec/bundler/install/gems/dependency_api_spec.rb
+++ b/spec/bundler/install/gems/dependency_api_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "gemcutter's dependency API" do
let(:source_hostname) { "localgemserver.test" }
@@ -61,7 +60,7 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle :install, :artifice => "endpoint"
- bundle "install --deployment", :artifice => "endpoint"
+ bundle! :install, forgotten_command_line_options(:deployment => true, :path => "vendor/bundle").merge(:artifice => "endpoint")
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -110,9 +109,8 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle "install", :artifice => "endpoint"
- bundle "install --deployment", :artifice => "endpoint"
+ bundle! :install, forgotten_command_line_options(:deployment => true).merge(:artifice => "endpoint")
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems("foo 1.0")
end
@@ -239,13 +237,13 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle "update --full-index", :artifice => "endpoint"
+ bundle! "update --full-index", :artifice => "endpoint", :all => bundle_update_requires_all?
expect(out).to include("Fetching source index from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
end
end
- it "fetches again when more dependencies are found in subsequent sources" do
+ it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 2" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -260,7 +258,26 @@ RSpec.describe "gemcutter's dependency API" do
G
bundle :install, :artifice => "endpoint_extra"
- expect(the_bundle).to include_gems "back_deps 1.0"
+ expect(the_bundle).to include_gems "back_deps 1.0", "foo 1.0"
+ end
+
+ it "fetches again when more dependencies are found in subsequent sources using blocks" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ bundle :install, :artifice => "endpoint_extra"
+ expect(the_bundle).to include_gems "back_deps 1.0", "foo 1.0"
end
it "fetches gem versions even when those gems are already installed" do
@@ -285,7 +302,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "rack 1.2"
end
- it "considers all possible versions of dependencies from all api gem sources" do
+ it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 2" do
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
@@ -303,6 +320,31 @@ RSpec.describe "gemcutter's dependency API" do
gem 'somegem', '1.0.0'
G
+ bundle! :install, :artifice => "endpoint_extra_api"
+
+ expect(the_bundle).to include_gems "somegem 1.0.0"
+ expect(the_bundle).to include_gems "activesupport 1.2.3"
+ end
+
+ it "considers all possible versions of dependencies from all api gem sources using blocks" do
+ # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
+ # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
+ # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
+ # repo and installs it.
+ build_repo4 do
+ build_gem "activesupport", "1.2.0"
+ build_gem "somegem", "1.0.0" do |s|
+ s.add_dependency "activesupport", "1.2.3" # This version exists only in repo1
+ end
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem 'somegem', '1.0.0'
+ end
+ G
+
bundle :install, :artifice => "endpoint_extra_api"
expect(the_bundle).to include_gems "somegem 1.0.0"
@@ -319,17 +361,18 @@ RSpec.describe "gemcutter's dependency API" do
gemfile <<-G
source "#{source_uri}"
- source "#{source_uri}/extra"
- gem "back_deps"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
G
bundle :install, :artifice => "endpoint_extra"
- expect(out).to include("Fetching gem metadata from http://localgemserver.test/..")
+ expect(out).to include("Fetching gem metadata from http://localgemserver.test/.")
expect(out).to include("Fetching source index from http://localgemserver.test/extra")
end
- it "does not fetch every spec if the index of gems is large when doing back deps" do
+ it "does not fetch every spec if the index of gems is large when doing back deps", :bundler => "< 2" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -353,6 +396,31 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "back_deps 1.0"
end
+ it "does not fetch every spec if the index of gems is large when doing back deps using blocks" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ build_gem "missing"
+ # need to hit the limit
+ 1.upto(Bundler::Source::Rubygems::API_REQUEST_LIMIT) do |i|
+ build_gem "gem#{i}"
+ end
+
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ bundle :install, :artifice => "endpoint_extra_missing"
+ expect(the_bundle).to include_gems "back_deps 1.0"
+ end
+
it "uses the endpoint if all sources support it" do
gemfile <<-G
source "#{source_uri}"
@@ -364,7 +432,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "foo 1.0"
end
- it "fetches again when more dependencies are found in subsequent sources using --deployment" do
+ it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 2" do
build_repo2 do
build_gem "back_deps" do |s|
s.add_dependency "foo"
@@ -384,6 +452,27 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "back_deps 1.0"
end
+ it "fetches again when more dependencies are found in subsequent sources using --deployment with blocks" do
+ build_repo2 do
+ build_gem "back_deps" do |s|
+ s.add_dependency "foo"
+ end
+ FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
+ end
+
+ gemfile <<-G
+ source "#{source_uri}"
+ source "#{source_uri}/extra" do
+ gem "back_deps"
+ end
+ G
+
+ bundle :install, :artifice => "endpoint_extra"
+
+ bundle "install --deployment", :artifice => "endpoint_extra"
+ expect(the_bundle).to include_gems "back_deps 1.0"
+ end
+
it "does not refetch if the only unmet dependency is bundler" do
gemfile <<-G
source "#{source_uri}"
@@ -407,7 +496,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "rails 2.3.2"
end
- it "installs the binstubs" do
+ it "installs the binstubs", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -419,7 +508,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to eq("1.0.0")
end
- it "installs the bins when using --path and uses autoclean" do
+ it "installs the bins when using --path and uses autoclean", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -430,7 +519,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(vendored_gems("bin/rackup")).to exist
end
- it "installs the bins when using --path and uses bundle clean" do
+ it "installs the bins when using --path and uses bundle clean", :bundler => "< 2" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@@ -505,7 +594,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).not_to include("#{user}:#{password}")
end
- it "strips http basic auth creds when warning about ambiguous sources" do
+ it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 2" do
gemfile <<-G
source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}"
@@ -602,7 +691,7 @@ RSpec.describe "gemcutter's dependency API" do
end
end
- context "when ruby is compiled without openssl" do
+ context "when ruby is compiled without openssl", :ruby_repo do
before do
# Install a monkeypatch that reproduces the effects of openssl being
# missing when the fetcher runs, as happens in real life. The reason
@@ -629,7 +718,7 @@ RSpec.describe "gemcutter's dependency API" do
context "when SSL certificate verification fails" do
it "explains what happened" do
# Install a monkeypatch that reproduces the effects of openssl raising
- # a certificate validation error when Rubygems tries to connect.
+ # a certificate validation error when RubyGems tries to connect.
gemfile <<-G
class Net::HTTP
def start
diff --git a/spec/bundler/install/gems/env_spec.rb b/spec/bundler/install/gems/env_spec.rb
index 9b1d8e5424..0dccbbfd24 100644
--- a/spec/bundler/install/gems/env_spec.rb
+++ b/spec/bundler/install/gems/env_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with ENV conditionals" do
describe "when just setting an ENV key as a string" do
diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb
index 2c2d3c16a1..f6af806154 100644
--- a/spec/bundler/install/gems/flex_spec.rb
+++ b/spec/bundler/install/gems/flex_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle flex_install" do
it "installs the gems as expected" do
@@ -194,8 +193,6 @@ RSpec.describe "bundle flex_install" do
it "suggests bundle update when the Gemfile requires different versions than the lock" do
nice_error = <<-E.strip.gsub(/^ {8}/, "")
- Fetching source index from file:#{gem_repo2}/
- Resolving dependencies...
Bundler could not find compatible versions for gem "rack":
In snapshot (Gemfile.lock):
rack (= 0.9.1)
@@ -212,7 +209,7 @@ RSpec.describe "bundle flex_install" do
E
bundle :install, :retry => 0
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to end_with(nice_error)
end
end
@@ -247,13 +244,13 @@ RSpec.describe "bundle flex_install" do
end
describe "when adding a new source" do
- it "updates the lockfile" do
+ it "updates the lockfile", :bundler => "< 2" do
build_repo2
- install_gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- install_gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
source "file://#{gem_repo2}"
gem "rack"
@@ -276,6 +273,41 @@ RSpec.describe "bundle flex_install" do
#{Bundler::VERSION}
L
end
+
+ it "updates the lockfile", :bundler => "2" do
+ build_repo2
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ source "file://#{gem_repo2}" do
+ end
+ gem "rack"
+ G
+
+ lockfile_should_be <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
end
# This was written to test github issue #636
diff --git a/spec/bundler/install/gems/mirror_spec.rb b/spec/bundler/install/gems/mirror_spec.rb
index 798156fb12..a8516a28c3 100644
--- a/spec/bundler/install/gems/mirror_spec.rb
+++ b/spec/bundler/install/gems/mirror_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with a mirror configured" do
describe "when the mirror does not match the gem source" do
diff --git a/spec/bundler/install/gems/native_extensions_spec.rb b/spec/bundler/install/gems/native_extensions_spec.rb
index dcf67e976e..ea616f60d3 100644
--- a/spec/bundler/install/gems/native_extensions_spec.rb
+++ b/spec/bundler/install/gems/native_extensions_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "installing a gem with native extensions", :ruby_repo do
it "installs" do
@@ -84,7 +83,6 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
G
expect(out).not_to include("extconf.rb failed")
- expect(out).to include("Using c_extension 1.0")
run! "Bundler.require; puts CExtension.new.its_true"
expect(out).to eq("true")
diff --git a/spec/bundler/install/gems/post_install_spec.rb b/spec/bundler/install/gems/post_install_spec.rb
index c3ea3e7c51..c6e348fb65 100644
--- a/spec/bundler/install/gems/post_install_spec.rb
+++ b/spec/bundler/install/gems/post_install_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
context "with gem sources" do
diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb
index 7a341fd14f..23e3caaefc 100644
--- a/spec/bundler/install/gems/resolving_spec.rb
+++ b/spec/bundler/install/gems/resolving_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with install-time dependencies" do
it "installs gems with implicit rake dependencies", :ruby_repo do
@@ -92,8 +91,10 @@ RSpec.describe "bundle install with install-time dependencies" do
bundle :install, :env => { "DEBUG_RESOLVER_TREE" => "1" }
- expect(err).to include(" net_b")
- expect(err).to include(" net_build_extensions (1.0)")
+ expect(err).to include(" net_b").
+ and include("Starting resolution").
+ and include("Finished resolution").
+ and include("Attempting to activate")
end
end
end
@@ -141,9 +142,6 @@ RSpec.describe "bundle install with install-time dependencies" do
expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
nice_error = strip_whitespace(<<-E).strip
- Fetching gem metadata from http://localgemserver.test/.
- Fetching version metadata from http://localgemserver.test/
- Resolving dependencies...
Bundler could not find compatible versions for gem "ruby\0":
In Gemfile:
ruby\0 (#{error_message_requirement})
@@ -151,9 +149,10 @@ RSpec.describe "bundle install with install-time dependencies" do
require_ruby was resolved to 1.0, which depends on
ruby\0 (> 9000)
- Could not find gem 'ruby\0 (> 9000)', which is required by gem 'require_ruby', in any of the sources.
+ Could not find gem 'ruby\0 (> 9000)', which is required by gem 'require_ruby', in any of the relevant sources:
+ the local ruby installation
E
- expect(out).to eq(nice_error)
+ expect(last_command.bundler_err).to end_with(nice_error)
end
end
diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb
index 9a79a05b32..551f07848d 100644
--- a/spec/bundler/install/gems/standalone_spec.rb
+++ b/spec/bundler/install/gems/standalone_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.shared_examples "bundle install --standalone" do
shared_examples "common functionality" do
@@ -51,10 +50,11 @@ RSpec.shared_examples "bundle install --standalone" do
describe "with simple gems" do
before do
- install_gemfile <<-G, :standalone => true
+ gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
G
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
end
let(:expected_gems) do
@@ -69,7 +69,7 @@ RSpec.shared_examples "bundle install --standalone" do
describe "with gems with native extension", :ruby_repo do
before do
- install_gemfile <<-G, :standalone => true
+ install_gemfile <<-G, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
source "file://#{gem_repo1}"
gem "very_simple_binary"
G
@@ -101,7 +101,7 @@ RSpec.shared_examples "bundle install --standalone" do
end
G
end
- install_gemfile <<-G, :standalone => true
+ install_gemfile <<-G, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
gem "bar", :git => "#{lib_path("bar-1.0")}"
G
end
@@ -116,11 +116,12 @@ RSpec.shared_examples "bundle install --standalone" do
before do
build_git "devise", "1.0"
- install_gemfile <<-G, :standalone => true
+ gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
gem "devise", :git => "#{lib_path("devise-1.0")}"
G
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
end
let(:expected_gems) do
@@ -138,7 +139,7 @@ RSpec.shared_examples "bundle install --standalone" do
before do
build_git "devise", "1.0"
- install_gemfile <<-G, :standalone => true
+ gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
@@ -147,6 +148,7 @@ RSpec.shared_examples "bundle install --standalone" do
gem "rack-test"
end
G
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
end
let(:expected_gems) do
@@ -159,7 +161,7 @@ RSpec.shared_examples "bundle install --standalone" do
include_examples "common functionality"
it "allows creating a standalone file with limited groups" do
- bundle "install --standalone default"
+ bundle! "install", forgotten_command_line_options(:path => "bundle").merge(:standalone => "default")
Dir.chdir(bundled_app) do
load_error_ruby <<-RUBY, "spec", :no_lib => true
@@ -172,12 +174,12 @@ RSpec.shared_examples "bundle install --standalone" do
RUBY
end
- expect(out).to eq("2.3.2")
- expect(err).to eq("ZOMG LOAD ERROR")
+ expect(last_command.stdout).to eq("2.3.2")
+ expect(last_command.stderr).to eq("ZOMG LOAD ERROR")
end
it "allows --without to limit the groups used in a standalone" do
- bundle "install --standalone --without test"
+ bundle! :install, forgotten_command_line_options(:path => "bundle", :without => "test").merge(:standalone => true)
Dir.chdir(bundled_app) do
load_error_ruby <<-RUBY, "spec", :no_lib => true
@@ -190,12 +192,12 @@ RSpec.shared_examples "bundle install --standalone" do
RUBY
end
- expect(out).to eq("2.3.2")
- expect(err).to eq("ZOMG LOAD ERROR")
+ expect(last_command.stdout).to eq("2.3.2")
+ expect(last_command.stderr).to eq("ZOMG LOAD ERROR")
end
it "allows --path to change the location of the standalone bundle" do
- bundle "install --standalone --path path/to/bundle"
+ bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true)
Dir.chdir(bundled_app) do
ruby <<-RUBY, :no_lib => true
@@ -207,12 +209,12 @@ RSpec.shared_examples "bundle install --standalone" do
RUBY
end
- expect(out).to eq("2.3.2")
+ expect(last_command.stdout).to eq("2.3.2")
end
it "allows remembered --without to limit the groups used in a standalone" do
- bundle "install --without test"
- bundle "install --standalone"
+ bundle! :install, forgotten_command_line_options(:without => "test")
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true)
Dir.chdir(bundled_app) do
load_error_ruby <<-RUBY, "spec", :no_lib => true
@@ -225,8 +227,8 @@ RSpec.shared_examples "bundle install --standalone" do
RUBY
end
- expect(out).to eq("2.3.2")
- expect(err).to eq("ZOMG LOAD ERROR")
+ expect(last_command.stdout).to eq("2.3.2")
+ expect(last_command.stderr).to eq("ZOMG LOAD ERROR")
end
end
@@ -239,7 +241,7 @@ RSpec.shared_examples "bundle install --standalone" do
source "#{source_uri}"
gem "rails"
G
- bundle "install --standalone", :artifice => "endpoint"
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true, :artifice => "endpoint")
end
let(:expected_gems) do
@@ -253,12 +255,13 @@ RSpec.shared_examples "bundle install --standalone" do
end
end
- describe "with --binstubs" do
+ describe "with --binstubs", :bundler => "< 2" do
before do
- install_gemfile <<-G, :standalone => true, :binstubs => true
+ gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
G
+ bundle! :install, forgotten_command_line_options(:path => "bundle").merge(:standalone => true, :binstubs => true)
end
let(:expected_gems) do
diff --git a/spec/bundler/install/gems/sudo_spec.rb b/spec/bundler/install/gems/sudo_spec.rb
index 13abffc14e..ae94eee9c6 100644
--- a/spec/bundler/install/gems/sudo_spec.rb
+++ b/spec/bundler/install/gems/sudo_spec.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "when using sudo", :sudo => true do
describe "and BUNDLE_PATH is writable" do
context "but BUNDLE_PATH/build_info is not writable" do
before do
+ bundle! "config path.system true"
subdir = system_gem_path("cache")
subdir.mkpath
sudo "chmod u-w #{subdir}"
@@ -25,6 +25,7 @@ RSpec.describe "when using sudo", :sudo => true do
describe "and GEM_HOME is owned by root" do
before :each do
+ bundle! "config path.system true"
chown_system_gems_to_root
end
@@ -83,7 +84,7 @@ RSpec.describe "when using sudo", :sudo => true do
expect(the_bundle).to include_gems "rack 1.0"
end
- it "installs extensions/ compiled by Rubygems 2.2", :rubygems => "2.2" do
+ it "installs extensions/ compiled by RubyGems 2.2", :rubygems => "2.2" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "very_simple_binary"
@@ -128,6 +129,7 @@ RSpec.describe "when using sudo", :sudo => true do
describe "and GEM_HOME is not writable" do
it "installs" do
+ bundle! "config path.system true"
gem_home = tmp("sudo_gem_home")
sudo "mkdir -p #{gem_home}"
sudo "chmod ugo-w #{gem_home}"
@@ -162,16 +164,9 @@ RSpec.describe "when using sudo", :sudo => true do
end
end
- context "when silence_root_warning is passed as an option" do
- it "skips the warning" do
- bundle :install, :sudo => true, :silence_root_warning => true
- expect(out).to_not include(warning)
- end
- end
-
context "when silence_root_warning = false" do
it "warns against that" do
- bundle :install, :sudo => true, :silence_root_warning => false
+ bundle :install, :sudo => true, :env => { "BUNDLE_SILENCE_ROOT_WARNING" => "false" }
expect(out).to include(warning)
end
end
diff --git a/spec/bundler/install/gems/win32_spec.rb b/spec/bundler/install/gems/win32_spec.rb
index cdad9a8821..ad758b94fa 100644
--- a/spec/bundler/install/gems/win32_spec.rb
+++ b/spec/bundler/install/gems/win32_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install with win32-generated lockfile" do
it "should read lockfile" do
diff --git a/spec/bundler/install/gemspecs_spec.rb b/spec/bundler/install/gemspecs_spec.rb
index 97eaf149c1..0c1ed99097 100644
--- a/spec/bundler/install/gemspecs_spec.rb
+++ b/spec/bundler/install/gemspecs_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
describe "when a gem has a YAML gemspec" do
@@ -34,8 +33,8 @@ RSpec.describe "bundle install" do
gem 'rack'
G
- FileUtils.mkdir_p "#{tmp}/gems/system/specifications"
- File.open("#{tmp}/gems/system/specifications/rack-1.0.0.gemspec", "w+") do |f|
+ FileUtils.mkdir_p "#{default_bundle_path}/specifications"
+ File.open("#{default_bundle_path}/specifications/rack-1.0.0.gemspec", "w+") do |f|
spec = Gem::Specification.new do |s|
s.name = "rack"
s.version = "1.0.0"
diff --git a/spec/bundler/install/git_spec.rb b/spec/bundler/install/git_spec.rb
index 04f2380b45..6ae718c2a4 100644
--- a/spec/bundler/install/git_spec.rb
+++ b/spec/bundler/install/git_spec.rb
@@ -1,21 +1,20 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
context "git sources" do
- it "displays the revision hash of the gem repository" do
+ it "displays the revision hash of the gem repository", :bundler => "< 2" do
build_git "foo", "1.0", :path => lib_path("foo")
install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo")}"
G
- bundle :install
+ bundle! :install
expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master@#{revision_for(lib_path("foo"))[0..6]})")
expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
end
- it "displays the ref of the gem repository when using branch~num as a ref" do
+ it "displays the ref of the gem repository when using branch~num as a ref", :bundler => "< 2" do
build_git "foo", "1.0", :path => lib_path("foo")
rev = revision_for(lib_path("foo"))[0..6]
update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true
@@ -32,13 +31,13 @@ RSpec.describe "bundle install" do
update_git "foo", "4.0", :path => lib_path("foo"), :gemspec => true
- bundle! :update
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).to include("Using foo 2.0 (was 1.0) from #{lib_path("foo")} (at master~2@#{rev2})")
expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
end
- it "should check out git repos that are missing but not being installed" do
- build_git "foo"
+ it "should allows git repos that are missing but not being installed" do
+ revision = build_git("foo").ref_for("HEAD")
gemfile <<-G
gem "foo", :git => "file://#{lib_path("foo-1.0")}", :group => :development
@@ -47,6 +46,7 @@ RSpec.describe "bundle install" do
lockfile <<-L
GIT
remote: file://#{lib_path("foo-1.0")}
+ revision: #{revision}
specs:
foo (1.0)
@@ -57,10 +57,9 @@ RSpec.describe "bundle install" do
foo!
L
- bundle "install --path=vendor/bundle --without development"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle", :without => "development")
expect(out).to include("Bundle complete!")
- expect(vendored_gems("bundler/gems/foo-1.0-#{revision_for(lib_path("foo-1.0"))[0..11]}")).to be_directory
end
end
end
diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb
new file mode 100644
index 0000000000..7696dc788f
--- /dev/null
+++ b/spec/bundler/install/global_cache_spec.rb
@@ -0,0 +1,235 @@
+# frozen_string_literal: true
+
+RSpec.describe "global gem caching" do
+ before { bundle! "config global_gem_cache true" }
+
+ describe "using the cross-application user cache" do
+ let(:source) { "http://localgemserver.test" }
+ let(:source2) { "http://gemserver.example.org" }
+
+ def source_global_cache(*segments)
+ home(".bundle", "cache", "gems", "localgemserver.test.80.dd34752a738ee965a2a4298dc16db6c5", *segments)
+ end
+
+ def source2_global_cache(*segments)
+ home(".bundle", "cache", "gems", "gemserver.example.org.80.1ae1663619ffe0a3c9d97712f44c705b", *segments)
+ end
+
+ it "caches gems into the global cache on download" do
+ install_gemfile! <<-G, :artifice => "compact_index"
+ source "#{source}"
+ gem "rack"
+ G
+
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ end
+
+ it "uses globally cached gems if they exist" do
+ source_global_cache.mkpath
+ FileUtils.cp(gem_repo1("gems/rack-1.0.0.gem"), source_global_cache("rack-1.0.0.gem"))
+
+ install_gemfile! <<-G, :artifice => "compact_index_no_gem"
+ source "#{source}"
+ gem "rack"
+ G
+
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
+
+ describe "when the same gem from different sources is installed" do
+ it "should use the appropriate one from the global cache" do
+ install_gemfile! <<-G, :artifice => "compact_index"
+ source "#{source}"
+ gem "rack"
+ G
+
+ FileUtils.rm_r(default_bundle_path)
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ # rack 1.0.0 is not installed and it is in the global cache
+
+ install_gemfile! <<-G, :artifice => "compact_index"
+ source "#{source2}"
+ gem "rack", "0.9.1"
+ G
+
+ FileUtils.rm_r(default_bundle_path)
+ expect(the_bundle).not_to include_gems "rack 0.9.1"
+ expect(source2_global_cache("rack-0.9.1.gem")).to exist
+ # rack 0.9.1 is not installed and it is in the global cache
+
+ gemfile <<-G
+ source "#{source}"
+ gem "rack", "1.0.0"
+ G
+
+ bundle! :install, :artifice => "compact_index_no_gem"
+ # rack 1.0.0 is installed and rack 0.9.1 is not
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ expect(the_bundle).not_to include_gems "rack 0.9.1"
+ FileUtils.rm_r(default_bundle_path)
+
+ gemfile <<-G
+ source "#{source2}"
+ gem "rack", "0.9.1"
+ G
+
+ bundle! :install, :artifice => "compact_index_no_gem"
+ # rack 0.9.1 is installed and rack 1.0.0 is not
+ expect(the_bundle).to include_gems "rack 0.9.1"
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ end
+
+ it "should not install if the wrong source is provided" do
+ gemfile <<-G
+ source "#{source}"
+ gem "rack"
+ G
+
+ bundle! :install, :artifice => "compact_index"
+ FileUtils.rm_r(default_bundle_path)
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ # rack 1.0.0 is not installed and it is in the global cache
+
+ gemfile <<-G
+ source "#{source2}"
+ gem "rack", "0.9.1"
+ G
+
+ bundle! :install, :artifice => "compact_index"
+ FileUtils.rm_r(default_bundle_path)
+ expect(the_bundle).not_to include_gems "rack 0.9.1"
+ expect(source2_global_cache("rack-0.9.1.gem")).to exist
+ # rack 0.9.1 is not installed and it is in the global cache
+
+ gemfile <<-G
+ source "#{source2}"
+ gem "rack", "1.0.0"
+ G
+
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source2_global_cache("rack-0.9.1.gem")).to exist
+ bundle :install, :artifice => "compact_index_no_gem"
+ expect(out).to include("Internal Server Error 500")
+ # rack 1.0.0 is not installed and rack 0.9.1 is not
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(the_bundle).not_to include_gems "rack 0.9.1"
+
+ gemfile <<-G
+ source "#{source}"
+ gem "rack", "0.9.1"
+ G
+
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source2_global_cache("rack-0.9.1.gem")).to exist
+ bundle :install, :artifice => "compact_index_no_gem"
+ expect(out).to include("Internal Server Error 500")
+ # rack 0.9.1 is not installed and rack 1.0.0 is not
+ expect(the_bundle).not_to include_gems "rack 0.9.1"
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ end
+ end
+
+ describe "when installing gems from a different directory" do
+ it "uses the global cache as a source" do
+ install_gemfile! <<-G, :artifice => "compact_index"
+ source "#{source}"
+ gem "rack"
+ gem "activesupport"
+ G
+
+ # Both gems are installed and in the global cache
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ expect(the_bundle).to include_gems "activesupport 2.3.5"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source_global_cache("activesupport-2.3.5.gem")).to exist
+ FileUtils.rm_r(default_bundle_path)
+ # Both gems are now only in the global cache
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(the_bundle).not_to include_gems "activesupport 2.3.5"
+
+ install_gemfile! <<-G, :artifice => "compact_index_no_gem"
+ source "#{source}"
+ gem "rack"
+ G
+
+ # rack is installed and both are in the global cache
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ expect(the_bundle).not_to include_gems "activesupport 2.3.5"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source_global_cache("activesupport-2.3.5.gem")).to exist
+
+ Dir.chdir bundled_app2 do
+ create_file bundled_app2("gems.rb"), <<-G
+ source "#{source}"
+ gem "activesupport"
+ G
+
+ # Neither gem is installed and both are in the global cache
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(the_bundle).not_to include_gems "activesupport 2.3.5"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source_global_cache("activesupport-2.3.5.gem")).to exist
+
+ # Install using the global cache instead of by downloading the .gem
+ # from the server
+ bundle! :install, :artifice => "compact_index_no_gem"
+
+ # activesupport is installed and both are in the global cache
+ expect(the_bundle).not_to include_gems "rack 1.0.0"
+ expect(the_bundle).to include_gems "activesupport 2.3.5"
+ expect(source_global_cache("rack-1.0.0.gem")).to exist
+ expect(source_global_cache("activesupport-2.3.5.gem")).to exist
+ end
+ end
+ end
+ end
+
+ describe "extension caching", :rubygems => "2.2", :ruby_repo do
+ it "works" do
+ build_git "very_simple_git_binary", &:add_c_extension
+ build_lib "very_simple_path_binary", &:add_c_extension
+ revision = revision_for(lib_path("very_simple_git_binary-1.0"))[0, 12]
+
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
+
+ gem "very_simple_binary"
+ gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}"
+ gem "very_simple_path_binary", :path => "#{lib_path("very_simple_path_binary-1.0")}"
+ G
+
+ gem_binary_cache = home(".bundle", "cache", "extensions", specific_local_platform.to_s, Bundler.ruby_scope,
+ Digest(:MD5).hexdigest("#{gem_repo1}/"), "very_simple_binary-1.0")
+ git_binary_cache = home(".bundle", "cache", "extensions", specific_local_platform.to_s, Bundler.ruby_scope,
+ "very_simple_git_binary-1.0-#{revision}", "very_simple_git_binary-1.0")
+
+ cached_extensions = Pathname.glob(home(".bundle", "cache", "extensions", "*", "*", "*", "*", "*")).sort
+ expect(cached_extensions).to eq [gem_binary_cache, git_binary_cache].sort
+
+ run! <<-R
+ require 'very_simple_binary_c'; puts ::VERY_SIMPLE_BINARY_IN_C
+ require 'very_simple_git_binary_c'; puts ::VERY_SIMPLE_GIT_BINARY_IN_C
+ R
+ expect(out).to eq "VERY_SIMPLE_BINARY_IN_C\nVERY_SIMPLE_GIT_BINARY_IN_C"
+
+ FileUtils.rm Dir[home(".bundle", "cache", "extensions", "**", "*binary_c*")]
+
+ gem_binary_cache.join("very_simple_binary_c.rb").open("w") {|f| f << "puts File.basename(__FILE__)" }
+ git_binary_cache.join("very_simple_git_binary_c.rb").open("w") {|f| f << "puts File.basename(__FILE__)" }
+
+ bundle! "config --local path different_path"
+ bundle! :install
+
+ expect(Dir[home(".bundle", "cache", "extensions", "**", "*binary_c*")]).to all(end_with(".rb"))
+
+ run! <<-R
+ require 'very_simple_binary_c'
+ require 'very_simple_git_binary_c'
+ R
+ expect(out).to eq "very_simple_binary_c.rb\nvery_simple_git_binary_c.rb"
+ end
+ end
+end
diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb
index 7a501d42b3..fc39068f6a 100644
--- a/spec/bundler/install/path_spec.rb
+++ b/spec/bundler/install/path_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
describe "with --path" do
@@ -14,8 +13,8 @@ RSpec.describe "bundle install" do
G
end
- it "does not use available system gems with bundle --path vendor/bundle" do
- bundle "install --path vendor/bundle"
+ it "does not use available system gems with bundle --path vendor/bundle", :bundler => "< 2" do
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -24,25 +23,25 @@ RSpec.describe "bundle install" do
dir.mkpath
Dir.chdir(dir) do
- bundle "install --path vendor/bundle"
- expect(out).to include("installed into ./vendor/bundle")
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
+ expect(out).to include("installed into `./vendor/bundle`")
end
dir.rmtree
end
it "prints a warning to let the user know what has happened with bundle --path vendor/bundle" do
- bundle "install --path vendor/bundle"
- expect(out).to include("gems are installed into ./vendor")
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
+ expect(out).to include("gems are installed into `./vendor/bundle`")
end
- it "disallows --path vendor/bundle --system" do
+ it "disallows --path vendor/bundle --system", :bundler => "< 2" do
bundle "install --path vendor/bundle --system"
expect(out).to include("Please choose only one option.")
expect(exitstatus).to eq(15) if exitstatus
end
- it "remembers to disable system gems after the first time with bundle --path vendor/bundle" do
+ it "remembers to disable system gems after the first time with bundle --path vendor/bundle", :bundler => "< 2" do
bundle "install --path vendor/bundle"
FileUtils.rm_rf bundled_app("vendor")
bundle "install"
@@ -75,7 +74,7 @@ RSpec.describe "bundle install" do
[:env, :global].each do |type|
it "installs gems to a path if one is specified" do
set_bundle_path(type, bundled_app("vendor2").to_s)
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
expect(bundled_app("vendor2")).not_to be_directory
@@ -114,7 +113,7 @@ RSpec.describe "bundle install" do
end
it "sets BUNDLE_PATH as the first argument to bundle install" do
- bundle "install --path ./vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "./vendor/bundle")
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -123,7 +122,7 @@ RSpec.describe "bundle install" do
it "disables system gems when passing a path to install" do
# This is so that vendored gems can be distributed to others
build_gem "rack", "1.1.0", :to_system => true
- bundle "install --path ./vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "./vendor/bundle")
expect(vendored_gems("gems/rack-1.0.0")).to be_directory
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -139,7 +138,7 @@ RSpec.describe "bundle install" do
gem "very_simple_binary"
G
- bundle "install --path ./vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "./vendor/bundle")
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
expect(vendored_gems("extensions")).to be_directory
@@ -150,7 +149,7 @@ RSpec.describe "bundle install" do
run "require 'very_simple_binary_c'"
expect(err).to include("Bundler::GemNotFound")
- bundle "install --path ./vendor/bundle"
+ bundle :install, forgotten_command_line_options(:path => "./vendor/bundle")
expect(vendored_gems("gems/very_simple_binary-1.0")).to be_directory
expect(vendored_gems("extensions")).to be_directory
@@ -171,7 +170,7 @@ RSpec.describe "bundle install" do
gem "rack"
G
- bundle "install --path bundle"
+ bundle :install, forgotten_command_line_options(:path => "bundle")
expect(out).to match(/file already exists/)
end
end
diff --git a/spec/bundler/install/post_bundle_message_spec.rb b/spec/bundler/install/post_bundle_message_spec.rb
index 4453e4190f..a953847bac 100644
--- a/spec/bundler/install/post_bundle_message_spec.rb
+++ b/spec/bundler/install/post_bundle_message_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "post bundle message" do
before :each do
@@ -14,11 +13,13 @@ RSpec.describe "post bundle message" do
G
end
- let(:bundle_show_message) { "Use `bundle info [gemname]` to see where a bundled gem is installed." }
- let(:bundle_deployment_message) { "Bundled gems are installed into ./vendor" }
- let(:bundle_complete_message) { "Bundle complete!" }
- let(:bundle_updated_message) { "Bundle updated!" }
- let(:installed_gems_stats) { "4 Gemfile dependencies, 5 gems now installed." }
+ let(:bundle_path) { "./.bundle" }
+ let(:bundle_show_system_message) { "Use `bundle info [gemname]` to see where a bundled gem is installed." }
+ let(:bundle_show_path_message) { "Bundled gems are installed into `#{bundle_path}`" }
+ let(:bundle_complete_message) { "Bundle complete!" }
+ let(:bundle_updated_message) { "Bundle updated!" }
+ let(:installed_gems_stats) { "4 Gemfile dependencies, 5 gems now installed." }
+ let(:bundle_show_message) { Bundler::VERSION.split(".").first.to_i < 2 ? bundle_show_system_message : bundle_show_path_message }
describe "for fresh bundle install" do
it "without any options" do
@@ -30,7 +31,7 @@ RSpec.describe "post bundle message" do
end
it "with --without one group" do
- bundle "install --without emo"
+ bundle! :install, forgotten_command_line_options(:without => "emo")
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_complete_message)
@@ -38,7 +39,7 @@ RSpec.describe "post bundle message" do
end
it "with --without two groups" do
- bundle "install --without emo test"
+ bundle! :install, forgotten_command_line_options(:without => "emo test")
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_complete_message)
@@ -46,7 +47,7 @@ RSpec.describe "post bundle message" do
end
it "with --without more groups" do
- bundle "install --without emo obama test"
+ bundle! :install, forgotten_command_line_options(:without => "emo obama test")
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo, obama and test were not installed")
expect(out).to include(bundle_complete_message)
@@ -54,51 +55,53 @@ RSpec.describe "post bundle message" do
end
describe "with --path and" do
+ let(:bundle_path) { "./vendor" }
+
it "without any options" do
- bundle "install --path vendor"
- expect(out).to include(bundle_deployment_message)
+ bundle! :install, forgotten_command_line_options(:path => "vendor")
+ expect(out).to include(bundle_show_path_message)
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
end
it "with --without one group" do
- bundle "install --without emo --path vendor"
- expect(out).to include(bundle_deployment_message)
+ bundle! :install, forgotten_command_line_options(:without => "emo", :path => "vendor")
+ expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_complete_message)
end
it "with --without two groups" do
- bundle "install --without emo test --path vendor"
- expect(out).to include(bundle_deployment_message)
+ bundle! :install, forgotten_command_line_options(:without => "emo test", :path => "vendor")
+ expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_complete_message)
end
it "with --without more groups" do
- bundle "install --without emo obama test --path vendor"
- expect(out).to include(bundle_deployment_message)
+ bundle! :install, forgotten_command_line_options(:without => "emo obama test", :path => "vendor")
+ expect(out).to include(bundle_show_path_message)
expect(out).to include("Gems in the groups emo, obama and test were not installed")
expect(out).to include(bundle_complete_message)
end
it "with an absolute --path inside the cwd" do
- bundle "install --path #{bundled_app}/cache"
- expect(out).to include("Bundled gems are installed into ./cache")
+ bundle! :install, forgotten_command_line_options(:path => bundled_app("cache"))
+ expect(out).to include("Bundled gems are installed into `./cache`")
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
end
it "with an absolute --path outside the cwd" do
- bundle "install --path #{bundled_app}_cache"
- expect(out).to include("Bundled gems are installed into #{bundled_app}_cache")
+ bundle! :install, forgotten_command_line_options(:path => tmp("not_bundled_app"))
+ expect(out).to include("Bundled gems are installed into `#{tmp("not_bundled_app")}`")
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
end
end
describe "with misspelled or non-existent gem name" do
- it "should report a helpful error message" do
+ it "should report a helpful error message", :bundler => "< 2" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -107,6 +110,18 @@ RSpec.describe "post bundle message" do
expect(out).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile.")
end
+ it "should report a helpful error message", :bundler => "2" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ gem "not-a-gem", :group => :development
+ G
+ expect(out).to include <<-EOS.strip
+Could not find gem 'not-a-gem' in rubygems repository file:#{gem_repo1}/ or installed locally.
+The source does not contain any versions of 'not-a-gem'
+ EOS
+ end
+
it "should report a helpful error message with reference to cache if available" do
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -119,7 +134,8 @@ RSpec.describe "post bundle message" do
gem "rack"
gem "not-a-gem", :group => :development
G
- expect(out).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile or in gems cached in vendor/cache.")
+ expect(out).to include("Could not find gem 'not-a-gem' in").
+ and include("or in gems cached in vendor/cache.")
end
end
end
@@ -134,8 +150,8 @@ RSpec.describe "post bundle message" do
end
it "with --without one group" do
- bundle "install --without emo"
- bundle :install
+ bundle! :install, forgotten_command_line_options(:without => "emo")
+ bundle! :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_complete_message)
@@ -143,15 +159,15 @@ RSpec.describe "post bundle message" do
end
it "with --without two groups" do
- bundle "install --without emo test"
- bundle :install
+ bundle! :install, forgotten_command_line_options(:without => "emo test")
+ bundle! :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_complete_message)
end
it "with --without more groups" do
- bundle "install --without emo obama test"
+ bundle! :install, forgotten_command_line_options(:without => "emo obama test")
bundle :install
expect(out).to include(bundle_show_message)
expect(out).to include("Gems in the groups emo, obama and test were not installed")
@@ -161,28 +177,28 @@ RSpec.describe "post bundle message" do
describe "for bundle update" do
it "without any options" do
- bundle :update
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).not_to include("Gems in the groups")
expect(out).to include(bundle_updated_message)
end
it "with --without one group" do
- bundle :install, :without => :emo
- bundle :update
+ bundle! :install, forgotten_command_line_options(:without => "emo")
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).to include("Gems in the group emo were not installed")
expect(out).to include(bundle_updated_message)
end
it "with --without two groups" do
- bundle "install --without emo test"
- bundle :update
+ bundle! :install, forgotten_command_line_options(:without => "emo test")
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).to include("Gems in the groups emo and test were not installed")
expect(out).to include(bundle_updated_message)
end
it "with --without more groups" do
- bundle "install --without emo obama test"
- bundle :update
+ bundle! :install, forgotten_command_line_options(:without => "emo obama test")
+ bundle! :update, :all => bundle_update_requires_all?
expect(out).to include("Gems in the groups emo, obama and test were not installed")
expect(out).to include(bundle_updated_message)
end
diff --git a/spec/bundler/install/prereleases_spec.rb b/spec/bundler/install/prereleases_spec.rb
index 6c32094d90..7af8c3b304 100644
--- a/spec/bundler/install/prereleases_spec.rb
+++ b/spec/bundler/install/prereleases_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle install" do
describe "when prerelease gems are available" do
diff --git a/spec/bundler/install/process_lock_spec.rb b/spec/bundler/install/process_lock_spec.rb
new file mode 100644
index 0000000000..02217f493b
--- /dev/null
+++ b/spec/bundler/install/process_lock_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+RSpec.describe "process lock spec" do
+ describe "when an install operation is already holding a process lock" do
+ before { FileUtils.mkdir_p(default_bundle_path) }
+
+ it "will not run a second concurrent bundle install until the lock is released" do
+ thread = Thread.new do
+ Bundler::ProcessLock.lock(default_bundle_path) do
+ sleep 1 # ignore quality_spec
+ expect(the_bundle).not_to include_gems "rack 1.0"
+ end
+ end
+
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ thread.join
+ expect(the_bundle).to include_gems "rack 1.0"
+ end
+ end
+end
diff --git a/spec/bundler/install/security_policy_spec.rb b/spec/bundler/install/security_policy_spec.rb
index ab531bdad6..7be09d6bd4 100644
--- a/spec/bundler/install/security_policy_spec.rb
+++ b/spec/bundler/install/security_policy_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "rubygems/security"
# unfortunately, testing signed gems with a provided CA is extremely difficult
@@ -24,7 +24,7 @@ RSpec.describe "policies with unsigned gems" do
it "will fail when given invalid security policy" do
bundle "install --trust-policy=InvalidPolicyName"
- expect(out).to include("Rubygems doesn't know about trust policy")
+ expect(out).to include("RubyGems doesn't know about trust policy")
end
it "will fail with High Security setting due to presence of unsigned gem" do
@@ -32,7 +32,7 @@ RSpec.describe "policies with unsigned gems" do
expect(out).to include("security policy didn't allow")
end
- # This spec will fail on Rubygems 2 rc1 due to a bug in policy.rb. the bug is fixed in rc3.
+ # This spec will fail on RubyGems 2 rc1 due to a bug in policy.rb. the bug is fixed in rc3.
it "will fail with Medium Security setting due to presence of unsigned gem", :unless => ENV["RGV"] == "v2.0.0.rc.1" do
bundle "install --trust-policy=MediumSecurity"
expect(out).to include("security policy didn't allow")
diff --git a/spec/bundler/install/yanked_spec.rb b/spec/bundler/install/yanked_spec.rb
index d42978ce4c..7c4b98bfdf 100644
--- a/spec/bundler/install/yanked_spec.rb
+++ b/spec/bundler/install/yanked_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.context "when installing a bundle that includes yanked gems" do
before(:each) do
@@ -38,7 +37,7 @@ RSpec.context "when installing a bundle that includes yanked gems" do
G
expect(out).not_to include("Your bundle is locked to foo (10.0.0)")
- expect(out).to include("Could not find gem 'foo (= 10.0.0)' in any of the gem sources")
+ expect(out).to include("Could not find gem 'foo (= 10.0.0)' in")
end
end
diff --git a/spec/bundler/lock/git_spec.rb b/spec/bundler/lock/git_spec.rb
index b36f61338d..14b80483ee 100644
--- a/spec/bundler/lock/git_spec.rb
+++ b/spec/bundler/lock/git_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle lock with git gems" do
before :each do
@@ -30,6 +29,6 @@ RSpec.describe "bundle lock with git gems" do
run <<-RUBY
puts Bundler.rubygems.find_name('foo').first.full_gem_path
RUBY
- expect(out).to eq(bundle("show foo"))
+ expect(out).to eq(bundle("info foo --path"))
end
end
diff --git a/spec/bundler/lock/lockfile_bundler_1_spec.rb b/spec/bundler/lock/lockfile_bundler_1_spec.rb
new file mode 100644
index 0000000000..3be45e29dc
--- /dev/null
+++ b/spec/bundler/lock/lockfile_bundler_1_spec.rb
@@ -0,0 +1,1386 @@
+# frozen_string_literal: true
+
+RSpec.describe "the lockfile format", :bundler => "< 2" do
+ include Bundler::GemHelpers
+
+ before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" }
+
+ it "generates a simple lockfile for a single source, gem" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "updates the lockfile's bundler version if current ver. is newer" do
+ lockfile <<-L
+ GIT
+ remote: git://github.com/nex3/haml.git
+ revision: 8a2271f
+ specs:
+
+ GEM
+ remote: file://#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ omg!
+ rack
+
+ BUNDLED WITH
+ 1.8.2
+ L
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not update the lockfile's bundler version if nothing changed during bundle install" do
+ version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"
+
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{version}
+ L
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{version}
+ G
+ end
+
+ it "updates the lockfile's bundler version if not present" do
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+ L
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack", "> 0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack (> 0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "outputs a warning if the current is older than lockfile's bundler version" do
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ 9999999.1.0
+ L
+
+ simulate_bundler_version "9999999.0.0" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+ end
+
+ warning_message = "the running version of Bundler (9999999.0.0) is older " \
+ "than the version that created the lockfile (9999999.1.0)"
+ expect(out.scan(warning_message).size).to eq(1)
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+ #{specific_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ 9999999.1.0
+ G
+ end
+
+ it "errors if the current is a major version older than lockfile's bundler version" do
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ 9999999.0.0
+ L
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ expect(exitstatus > 0) if exitstatus
+ expect(out).to include("You must use Bundler 9999999 or greater with this lockfile.")
+ end
+
+ it "shows a friendly error when running with a new bundler 2 lockfile" do
+ lockfile <<-L
+ GEM
+ remote: https://rails-assets.org/
+ specs:
+ rails-assets-bootstrap (3.3.4)
+ rails-assets-jquery (>= 1.9.1)
+ rails-assets-jquery (2.1.4)
+
+ GEM
+ remote: https://rubygems.org/
+ specs:
+ rake (10.4.2)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rails-assets-bootstrap!
+ rake
+
+ BUNDLED WITH
+ 9999999.0.0
+ L
+
+ install_gemfile <<-G
+ source 'https://rubygems.org'
+ gem 'rake'
+
+ source 'https://rails-assets.org' do
+ gem 'rails-assets-bootstrap'
+ end
+ G
+
+ expect(exitstatus > 0) if exitstatus
+ expect(out).to include("You must use Bundler 9999999 or greater with this lockfile.")
+ end
+
+ it "warns when updating bundler major version" do
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ 1.10.0
+ L
+
+ simulate_bundler_version "9999999.0.0" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+ end
+
+ expect(out).to include("Warning: the lockfile is being updated to Bundler " \
+ "9999999, after which you will be unable to return to Bundler 1.")
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+ #{specific_local_platform}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ 9999999.0.0
+ G
+ end
+
+ it "generates a simple lockfile for a single source, gem with dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack-obama"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack-obama
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates a simple lockfile for a single source, gem with a version requirement" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack-obama", ">= 1.0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack-obama (>= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates a lockfile wihout credentials for a configured source" do
+ bundle "config http://localgemserver.test/ user:pass"
+
+ install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
+ source "http://localgemserver.test/"
+ source "http://user:pass@othergemserver.test/"
+
+ gem "rack-obama", ">= 1.0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: http://localgemserver.test/
+ remote: http://user:pass@othergemserver.test/
+ specs:
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack-obama (>= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates lockfiles with multiple requirements" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "net-sftp"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ net-sftp (1.1.1)
+ net-ssh (>= 1.0.0, < 1.99.0)
+ net-ssh (1.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ net-sftp
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+
+ expect(the_bundle).to include_gems "net-sftp 1.1.1", "net-ssh 1.0.0"
+ end
+
+ it "generates a simple lockfile for a single pinned source, gem with a version requirement" do
+ git = build_git "foo"
+
+ install_gemfile <<-G
+ gem "foo", :git => "#{lib_path("foo-1.0")}"
+ G
+
+ lockfile_should_be <<-G
+ GIT
+ remote: #{lib_path("foo-1.0")}
+ revision: #{git.ref_for("master")}
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not asplode when a platform specific dependency is present and the Gemfile has not been resolved on that platform" do
+ build_lib "omg", :path => lib_path("omg")
+
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ platforms :#{not_local_tag} do
+ gem "omg", :path => "#{lib_path("omg")}"
+ end
+
+ gem "rack"
+ G
+
+ lockfile <<-L
+ GIT
+ remote: git://github.com/nex3/haml.git
+ revision: 8a2271f
+ specs:
+
+ GEM
+ remote: file://#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{not_local}
+
+ DEPENDENCIES
+ omg!
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ bundle "install"
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
+
+ it "serializes global git sources" do
+ git = build_git "foo"
+
+ install_gemfile <<-G
+ git "#{lib_path("foo-1.0")}" do
+ gem "foo"
+ end
+ G
+
+ lockfile_should_be <<-G
+ GIT
+ remote: #{lib_path("foo-1.0")}
+ revision: #{git.ref_for("master")}
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates a lockfile with a ref for a single pinned source, git gem with a branch requirement" do
+ git = build_git "foo"
+ update_git "foo", :branch => "omg"
+
+ install_gemfile <<-G
+ gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg"
+ G
+
+ lockfile_should_be <<-G
+ GIT
+ remote: #{lib_path("foo-1.0")}
+ revision: #{git.ref_for("omg")}
+ branch: omg
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates a lockfile with a ref for a single pinned source, git gem with a tag requirement" do
+ git = build_git "foo"
+ update_git "foo", :tag => "omg"
+
+ install_gemfile <<-G
+ gem "foo", :git => "#{lib_path("foo-1.0")}", :tag => "omg"
+ G
+
+ lockfile_should_be <<-G
+ GIT
+ remote: #{lib_path("foo-1.0")}
+ revision: #{git.ref_for("omg")}
+ tag: omg
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "serializes pinned path sources to the lockfile" do
+ build_lib "foo"
+
+ install_gemfile <<-G
+ gem "foo", :path => "#{lib_path("foo-1.0")}"
+ G
+
+ lockfile_should_be <<-G
+ PATH
+ remote: #{lib_path("foo-1.0")}
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "serializes pinned path sources to the lockfile even when packaging" do
+ build_lib "foo"
+
+ install_gemfile! <<-G
+ gem "foo", :path => "#{lib_path("foo-1.0")}"
+ G
+
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
+ bundle! :install, :local => true
+
+ lockfile_should_be <<-G
+ PATH
+ remote: #{lib_path("foo-1.0")}
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "sorts serialized sources by type" do
+ build_lib "foo"
+ bar = build_git "bar"
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "foo", :path => "#{lib_path("foo-1.0")}"
+ gem "bar", :git => "#{lib_path("bar-1.0")}"
+ G
+
+ lockfile_should_be <<-G
+ GIT
+ remote: #{lib_path("bar-1.0")}
+ revision: #{bar.ref_for("master")}
+ specs:
+ bar (1.0)
+
+ PATH
+ remote: #{lib_path("foo-1.0")}
+ specs:
+ foo (1.0)
+
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ bar!
+ foo!
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "lists gems alphabetically" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "thin"
+ gem "actionpack"
+ gem "rack-obama"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ actionpack (2.3.2)
+ activesupport (= 2.3.2)
+ activesupport (2.3.2)
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+ thin (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ actionpack
+ rack-obama
+ thin
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "orders dependencies' dependencies in alphabetical order" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rails"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ actionmailer (2.3.2)
+ activesupport (= 2.3.2)
+ actionpack (2.3.2)
+ activesupport (= 2.3.2)
+ activerecord (2.3.2)
+ activesupport (= 2.3.2)
+ activeresource (2.3.2)
+ activesupport (= 2.3.2)
+ activesupport (2.3.2)
+ rails (2.3.2)
+ actionmailer (= 2.3.2)
+ actionpack (= 2.3.2)
+ activerecord (= 2.3.2)
+ activeresource (= 2.3.2)
+ rake (= 10.0.2)
+ rake (10.0.2)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rails
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "orders dependencies by version" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem 'double_deps'
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ double_deps (1.0)
+ net-ssh
+ net-ssh (>= 1.0.0)
+ net-ssh (1.0)
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ double_deps
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add the :require option to the lockfile" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack-obama", ">= 1.0", :require => "rack/obama"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack-obama (>= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add the :group option to the lockfile" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack-obama", ">= 1.0", :group => :test
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+ rack-obama (1.0)
+ rack
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ rack-obama (>= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "stores relative paths when the path is provided in a relative fashion and in Gemfile dir" do
+ build_lib "foo", :path => bundled_app("foo")
+
+ install_gemfile <<-G
+ path "foo"
+ gem "foo"
+ G
+
+ lockfile_should_be <<-G
+ PATH
+ remote: foo
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "stores relative paths when the path is provided in a relative fashion and is above Gemfile dir" do
+ build_lib "foo", :path => bundled_app(File.join("..", "foo"))
+
+ install_gemfile <<-G
+ path "../foo"
+ gem "foo"
+ G
+
+ lockfile_should_be <<-G
+ PATH
+ remote: ../foo
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "stores relative paths when the path is provided in an absolute fashion but is relative" do
+ build_lib "foo", :path => bundled_app("foo")
+
+ install_gemfile <<-G
+ path File.expand_path("../foo", __FILE__)
+ gem "foo"
+ G
+
+ lockfile_should_be <<-G
+ PATH
+ remote: foo
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "stores relative paths when the path is provided for gemspec" do
+ build_lib("foo", :path => tmp.join("foo"))
+
+ install_gemfile <<-G
+ gemspec :path => "../foo"
+ G
+
+ lockfile_should_be <<-G
+ PATH
+ remote: ../foo
+ specs:
+ foo (1.0)
+
+ GEM
+ specs:
+
+ PLATFORMS
+ #{generic_local_platform}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "keeps existing platforms in the lockfile" do
+ lockfile <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ java
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ platforms = ["java", generic_local_platform.to_s].sort
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{platforms[0]}
+ #{platforms[1]}
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "persists the spec's platform to the lockfile" do
+ build_gem "platform_specific", "1.0.0", :to_system => true do |s|
+ s.platform = Gem::Platform.new("universal-java-16")
+ end
+
+ simulate_platform "universal-java-16"
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "platform_specific"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ platform_specific (1.0-java)
+
+ PLATFORMS
+ java
+
+ DEPENDENCIES
+ platform_specific
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add duplicate gems" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ gem "activesupport"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ activesupport (2.3.5)
+ rack (1.0.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ activesupport
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add duplicate dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ gem "rack"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add duplicate dependencies with versions" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0"
+ gem "rack", "1.0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack (= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "does not add duplicate dependencies in different groups" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0", :group => :one
+ gem "rack", "1.0", :group => :two
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack (= 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "raises if two different versions are used" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0"
+ gem "rack", "1.1"
+ G
+
+ expect(bundled_app("Gemfile.lock")).not_to exist
+ expect(out).to include "rack (= 1.0) and rack (= 1.1)"
+ end
+
+ it "raises if two different sources are used" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ gem "rack", :git => "git://hubz.com"
+ G
+
+ expect(bundled_app("Gemfile.lock")).not_to exist
+ expect(out).to include "rack (>= 0) should come from an unspecified source and git://hubz.com (at master)"
+ end
+
+ it "works correctly with multiple version dependencies" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack", "> 0.9", "< 1.0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (0.9.1)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack (> 0.9, < 1.0)
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "captures the Ruby version in the lockfile" do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ ruby '#{RUBY_VERSION}'
+ gem "rack", "> 0.9", "< 1.0"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (0.9.1)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack (> 0.9, < 1.0)
+
+ RUBY VERSION
+ ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ # Some versions of the Bundler 1.1 RC series introduced corrupted
+ # lockfiles. There were two major problems:
+ #
+ # * multiple copies of the same GIT section appeared in the lockfile
+ # * when this happened, those sections got multiple copies of gems
+ # in those sections.
+ it "fixes corrupted lockfiles" do
+ build_git "omg", :path => lib_path("omg")
+ revision = revision_for(lib_path("omg"))
+
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "omg", :git => "#{lib_path("omg")}", :branch => 'master'
+ G
+
+ bundle "install --path vendor"
+ expect(the_bundle).to include_gems "omg 1.0"
+
+ # Create a Gemfile.lock that has duplicate GIT sections
+ lockfile <<-L
+ GIT
+ remote: #{lib_path("omg")}
+ revision: #{revision}
+ branch: master
+ specs:
+ omg (1.0)
+
+ GIT
+ remote: #{lib_path("omg")}
+ revision: #{revision}
+ branch: master
+ specs:
+ omg (1.0)
+
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+
+ PLATFORMS
+ #{local}
+
+ DEPENDENCIES
+ omg!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ FileUtils.rm_rf(bundled_app("vendor"))
+ bundle "install"
+ expect(the_bundle).to include_gems "omg 1.0"
+
+ # Confirm that duplicate specs do not appear
+ expect(File.read(bundled_app("Gemfile.lock"))).to eq(strip_whitespace(<<-L))
+ GIT
+ remote: #{lib_path("omg")}
+ revision: #{revision}
+ branch: master
+ specs:
+ omg (1.0)
+
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+
+ PLATFORMS
+ #{local}
+
+ DEPENDENCIES
+ omg!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+
+ it "raises a helpful error message when the lockfile is missing deps" do
+ lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack_middleware (1.0)
+
+ PLATFORMS
+ #{local}
+
+ DEPENDENCIES
+ rack_middleware
+ L
+
+ install_gemfile <<-G
+ source "file:#{gem_repo1}"
+ gem "rack_middleware"
+ G
+
+ expect(out).to include("Downloading rack_middleware-1.0 revealed dependencies not in the API or the lockfile (#{Gem::Dependency.new("rack", "= 0.9.1")}).").
+ and include("Either installing with `--full-index` or running `bundle update rack_middleware` should fix the problem.")
+ end
+
+ describe "a line ending" do
+ def set_lockfile_mtime_to_known_value
+ time = Time.local(2000, 1, 1, 0, 0, 0)
+ File.utime(time, time, bundled_app("Gemfile.lock"))
+ end
+ before(:each) do
+ build_repo2
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ G
+ set_lockfile_mtime_to_known_value
+ end
+
+ it "generates Gemfile.lock with \\n line endings" do
+ expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n")
+ expect(the_bundle).to include_gems "rack 1.0"
+ end
+
+ context "during updates" do
+ it "preserves Gemfile.lock \\n line endings" do
+ update_repo2
+
+ expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) }
+ expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n")
+ expect(the_bundle).to include_gems "rack 1.2"
+ end
+
+ it "preserves Gemfile.lock \\n\\r line endings" do
+ update_repo2
+ win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
+ File.open(bundled_app("Gemfile.lock"), "wb") {|f| f.puts(win_lock) }
+ set_lockfile_mtime_to_known_value
+
+ expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) }
+ expect(File.read(bundled_app("Gemfile.lock"))).to match("\r\n")
+ expect(the_bundle).to include_gems "rack 1.2"
+ end
+ end
+
+ context "when nothing changes" do
+ it "preserves Gemfile.lock \\n line endings" do
+ expect do
+ ruby <<-RUBY
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup
+ RUBY
+ end.not_to change { File.mtime(bundled_app("Gemfile.lock")) }
+ end
+
+ it "preserves Gemfile.lock \\n\\r line endings" do
+ win_lock = File.read(bundled_app("Gemfile.lock")).gsub(/\n/, "\r\n")
+ File.open(bundled_app("Gemfile.lock"), "wb") {|f| f.puts(win_lock) }
+ set_lockfile_mtime_to_known_value
+
+ expect do
+ ruby <<-RUBY
+ require 'rubygems'
+ require 'bundler'
+ Bundler.setup
+ RUBY
+ end.not_to change { File.mtime(bundled_app("Gemfile.lock")) }
+ end
+ end
+ end
+
+ it "refuses to install if Gemfile.lock contains conflict markers" do
+ lockfile <<-L
+ GEM
+ remote: file://#{gem_repo1}/
+ specs:
+ <<<<<<<
+ rack (1.0.0)
+ =======
+ rack (1.0.1)
+ >>>>>>>
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ install_gemfile(<<-G)
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ expect(last_command.bundler_err).to match(/your Gemfile.lock contains merge conflicts/i)
+ expect(last_command.bundler_err).to match(/git checkout HEAD -- Gemfile.lock/i)
+ end
+end
diff --git a/spec/bundler/lock/lockfile_spec.rb b/spec/bundler/lock/lockfile_spec.rb
index 968c969a55..b4bf81ded2 100644
--- a/spec/bundler/lock/lockfile_spec.rb
+++ b/spec/bundler/lock/lockfile_spec.rb
@@ -1,9 +1,10 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "the lockfile format" do
+RSpec.describe "the lockfile format", :bundler => "2" do
include Bundler::GemHelpers
+ before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" }
+
it "generates a simple lockfile for a single source, gem" do
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -18,7 +19,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -41,7 +42,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
omg!
@@ -64,7 +65,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -75,6 +76,8 @@ RSpec.describe "the lockfile format" do
end
it "does not update the lockfile's bundler version if nothing changed during bundle install" do
+ version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"
+
lockfile <<-L
GEM
remote: file:#{gem_repo1}/
@@ -82,13 +85,13 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
BUNDLED WITH
- 1.10.0
+ #{version}
L
install_gemfile <<-G
@@ -104,13 +107,13 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
BUNDLED WITH
- 1.10.0
+ #{version}
G
end
@@ -122,7 +125,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -141,7 +144,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack (> 0)
@@ -178,7 +181,7 @@ RSpec.describe "the lockfile format" do
warning_message = "the running version of Bundler (9999999.0.0) is older " \
"than the version that created the lockfile (9999999.1.0)"
- expect(out.scan(warning_message).size).to eq(1)
+ expect(last_command.bundler_err).to include warning_message
lockfile_should_be <<-G
GEM
@@ -187,7 +190,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -205,7 +208,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -220,8 +223,8 @@ RSpec.describe "the lockfile format" do
gem "rack"
G
- expect(exitstatus > 0) if exitstatus
- expect(out).to include("You must use Bundler 9999999 or greater with this lockfile.")
+ expect(last_command).to be_failure
+ expect(last_command.bundler_err).to include("You must use Bundler 9999999 or greater with this lockfile.")
end
it "shows a friendly error when running with a new bundler 2 lockfile" do
@@ -258,7 +261,7 @@ RSpec.describe "the lockfile format" do
end
G
- expect(exitstatus > 0) if exitstatus
+ expect(last_command).to be_failure
expect(out).to include("You must use Bundler 9999999 or greater with this lockfile.")
end
@@ -297,7 +300,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -323,7 +326,7 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack-obama
@@ -349,7 +352,7 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack-obama (>= 1.0)
@@ -359,19 +362,28 @@ RSpec.describe "the lockfile format" do
G
end
- it "generates a lockfile wihout credentials for a configured source" do
+ it "generates a lockfile without credentials for a configured source" do
bundle "config http://localgemserver.test/ user:pass"
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
- source "http://localgemserver.test/"
- source "http://user:pass@othergemserver.test/"
+ source "http://localgemserver.test/" do
- gem "rack-obama", ">= 1.0"
+ end
+
+ source "http://user:pass@othergemserver.test/" do
+ gem "rack-obama", ">= 1.0"
+ end
G
lockfile_should_be <<-G
GEM
+ specs:
+
+ GEM
remote: http://localgemserver.test/
+ specs:
+
+ GEM
remote: http://user:pass@othergemserver.test/
specs:
rack (1.0.0)
@@ -379,10 +391,10 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
- rack-obama (>= 1.0)
+ rack-obama (>= 1.0)!
BUNDLED WITH
#{Bundler::VERSION}
@@ -404,7 +416,7 @@ RSpec.describe "the lockfile format" do
net-ssh (1.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
net-sftp
@@ -416,7 +428,7 @@ RSpec.describe "the lockfile format" do
expect(the_bundle).to include_gems "net-sftp 1.1.1", "net-ssh 1.0.0"
end
- it "generates a simple lockfile for a single pinned source, gem with a version requirement" do
+ it "generates a simple lockfile for a single pinned source, gem with a version requirement", :bundler => "< 2" do
git = build_git "foo"
install_gemfile <<-G
@@ -434,7 +446,35 @@ RSpec.describe "the lockfile format" do
specs:
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
+ it "generates a simple lockfile for a single pinned source, gem with a version requirement" do
+ git = build_git "foo"
+
+ install_gemfile <<-G
+ gem "foo", :git => "#{lib_path("foo-1.0")}"
+ G
+
+ lockfile_should_be <<-G
+ GEM
+ specs:
+
+ GIT
+ remote: #{lib_path("foo-1.0")}
+ revision: #{git.ref_for("master")}
+ specs:
+ foo (1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -479,7 +519,7 @@ RSpec.describe "the lockfile format" do
#{Bundler::VERSION}
L
- bundle "install"
+ bundle! "install"
expect(the_bundle).to include_gems "rack 1.0.0"
end
@@ -493,17 +533,17 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
GIT
remote: #{lib_path("foo-1.0")}
revision: #{git.ref_for("master")}
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -522,6 +562,9 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
GIT
remote: #{lib_path("foo-1.0")}
revision: #{git.ref_for("omg")}
@@ -529,11 +572,8 @@ RSpec.describe "the lockfile format" do
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -552,6 +592,9 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
GIT
remote: #{lib_path("foo-1.0")}
revision: #{git.ref_for("omg")}
@@ -559,11 +602,8 @@ RSpec.describe "the lockfile format" do
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -581,16 +621,16 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: #{lib_path("foo-1.0")}
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -607,20 +647,20 @@ RSpec.describe "the lockfile format" do
gem "foo", :path => "#{lib_path("foo-1.0")}"
G
- bundle! "package --all"
- bundle! "install --local"
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
+ bundle! :install, :local => true
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: #{lib_path("foo-1.0")}
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -643,6 +683,11 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
GIT
remote: #{lib_path("bar-1.0")}
revision: #{bar.ref_for("master")}
@@ -654,13 +699,8 @@ RSpec.describe "the lockfile format" do
specs:
foo (1.0)
- GEM
- remote: file:#{gem_repo1}/
- specs:
- rack (1.0.0)
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
bar!
@@ -695,7 +735,7 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
actionpack
@@ -736,7 +776,7 @@ RSpec.describe "the lockfile format" do
rake (10.0.2)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rails
@@ -762,7 +802,7 @@ RSpec.describe "the lockfile format" do
net-ssh (1.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
double_deps
@@ -788,7 +828,7 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack-obama (>= 1.0)
@@ -814,7 +854,7 @@ RSpec.describe "the lockfile format" do
rack
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack-obama (>= 1.0)
@@ -828,24 +868,25 @@ RSpec.describe "the lockfile format" do
build_lib "foo", :path => bundled_app("foo")
install_gemfile <<-G
- path "foo"
- gem "foo"
+ path "foo" do
+ gem "foo"
+ end
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: foo
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
- foo
+ foo!
BUNDLED WITH
#{Bundler::VERSION}
@@ -856,24 +897,25 @@ RSpec.describe "the lockfile format" do
build_lib "foo", :path => bundled_app(File.join("..", "foo"))
install_gemfile <<-G
- path "../foo"
- gem "foo"
+ path "../foo" do
+ gem "foo"
+ end
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: ../foo
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
- foo
+ foo!
BUNDLED WITH
#{Bundler::VERSION}
@@ -884,24 +926,25 @@ RSpec.describe "the lockfile format" do
build_lib "foo", :path => bundled_app("foo")
install_gemfile <<-G
- path File.expand_path("../foo", __FILE__)
- gem "foo"
+ path File.expand_path("../foo", __FILE__) do
+ gem "foo"
+ end
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: foo
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
- foo
+ foo!
BUNDLED WITH
#{Bundler::VERSION}
@@ -916,16 +959,16 @@ RSpec.describe "the lockfile format" do
G
lockfile_should_be <<-G
+ GEM
+ specs:
+
PATH
remote: ../foo
specs:
foo (1.0)
- GEM
- specs:
-
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
foo!
@@ -958,8 +1001,6 @@ RSpec.describe "the lockfile format" do
gem "rack"
G
- platforms = ["java", generic_local_platform.to_s].sort
-
lockfile_should_be <<-G
GEM
remote: file:#{gem_repo1}/
@@ -967,8 +1008,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- #{platforms[0]}
- #{platforms[1]}
+ #{lockfile_platforms "java", generic_local_platform, specific_local_platform}
DEPENDENCIES
rack
@@ -979,25 +1019,29 @@ RSpec.describe "the lockfile format" do
end
it "persists the spec's platform to the lockfile" do
- build_gem "platform_specific", "1.0.0", :to_system => true do |s|
- s.platform = Gem::Platform.new("universal-java-16")
+ build_repo2 do
+ build_gem "platform_specific", "1.0" do |s|
+ s.platform = Gem::Platform.new("universal-java-16")
+ end
end
simulate_platform "universal-java-16"
- install_gemfile <<-G
- source "file://#{gem_repo1}"
+ install_gemfile! <<-G
+ source "file://#{gem_repo2}"
gem "platform_specific"
G
lockfile_should_be <<-G
GEM
- remote: file:#{gem_repo1}/
+ remote: file:#{gem_repo2}/
specs:
platform_specific (1.0-java)
+ platform_specific (1.0-universal-java-16)
PLATFORMS
java
+ universal-java-16
DEPENDENCIES
platform_specific
@@ -1027,7 +1071,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
activesupport
@@ -1052,7 +1096,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -1076,7 +1120,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack (= 1.0)
@@ -1100,7 +1144,7 @@ RSpec.describe "the lockfile format" do
rack (1.0.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack (= 1.0)
@@ -1145,7 +1189,7 @@ RSpec.describe "the lockfile format" do
rack (0.9.1)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack (> 0.9, < 1.0)
@@ -1169,7 +1213,7 @@ RSpec.describe "the lockfile format" do
rack (0.9.1)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack (> 0.9, < 1.0)
@@ -1197,11 +1241,15 @@ RSpec.describe "the lockfile format" do
gem "omg", :git => "#{lib_path("omg")}", :branch => 'master'
G
- bundle "install --path vendor"
+ bundle! :install, forgotten_command_line_options(:path => "vendor")
expect(the_bundle).to include_gems "omg 1.0"
# Create a Gemfile.lock that has duplicate GIT sections
lockfile <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+
GIT
remote: #{lib_path("omg")}
revision: #{revision}
@@ -1216,12 +1264,8 @@ RSpec.describe "the lockfile format" do
specs:
omg (1.0)
- GEM
- remote: file:#{gem_repo1}/
- specs:
-
PLATFORMS
- #{local}
+ #{lockfile_platforms}
DEPENDENCIES
omg!
@@ -1236,6 +1280,10 @@ RSpec.describe "the lockfile format" do
# Confirm that duplicate specs do not appear
expect(File.read(bundled_app("Gemfile.lock"))).to eq(strip_whitespace(<<-L))
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+
GIT
remote: #{lib_path("omg")}
revision: #{revision}
@@ -1243,12 +1291,8 @@ RSpec.describe "the lockfile format" do
specs:
omg (1.0)
- GEM
- remote: file:#{gem_repo1}/
- specs:
-
PLATFORMS
- #{local}
+ #{lockfile_platforms}
DEPENDENCIES
omg!
@@ -1266,7 +1310,7 @@ RSpec.describe "the lockfile format" do
rack_middleware (1.0)
PLATFORMS
- #{local}
+ #{lockfile_platforms}
DEPENDENCIES
rack_middleware
@@ -1305,7 +1349,7 @@ RSpec.describe "the lockfile format" do
it "preserves Gemfile.lock \\n line endings" do
update_repo2
- expect { bundle "update" }.to change { File.mtime(bundled_app("Gemfile.lock")) }
+ expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) }
expect(File.read(bundled_app("Gemfile.lock"))).not_to match("\r\n")
expect(the_bundle).to include_gems "rack 1.2"
end
@@ -1316,7 +1360,7 @@ RSpec.describe "the lockfile format" do
File.open(bundled_app("Gemfile.lock"), "wb") {|f| f.puts(win_lock) }
set_lockfile_mtime_to_known_value
- expect { bundle "update" }.to change { File.mtime(bundled_app("Gemfile.lock")) }
+ expect { bundle "update", :all => true }.to change { File.mtime(bundled_app("Gemfile.lock")) }
expect(File.read(bundled_app("Gemfile.lock"))).to match("\r\n")
expect(the_bundle).to include_gems "rack 1.2"
end
@@ -1361,7 +1405,7 @@ RSpec.describe "the lockfile format" do
>>>>>>>
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -1370,12 +1414,12 @@ RSpec.describe "the lockfile format" do
#{Bundler::VERSION}
L
- error = install_gemfile(<<-G)
+ install_gemfile(<<-G)
source "file://#{gem_repo1}"
gem "rack"
G
- expect(error).to match(/your Gemfile.lock contains merge conflicts/i)
- expect(error).to match(/git checkout HEAD -- Gemfile.lock/i)
+ expect(last_command.bundler_err).to match(/your Gemfile.lock contains merge conflicts/i)
+ expect(last_command.bundler_err).to match(/git checkout HEAD -- Gemfile.lock/i)
end
end
diff --git a/spec/bundler/other/bundle_ruby_spec.rb b/spec/bundler/other/bundle_ruby_spec.rb
index 0ef6f407bf..6cc33f60ac 100644
--- a/spec/bundler/other/bundle_ruby_spec.rb
+++ b/spec/bundler/other/bundle_ruby_spec.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "bundle_ruby", :ruby_repo do
+RSpec.describe "bundle_ruby", :bundler => "< 2" do
context "without patchlevel" do
it "returns the ruby version" do
gemfile <<-G
diff --git a/spec/bundler/other/cli_dispatch_spec.rb b/spec/bundler/other/cli_dispatch_spec.rb
index 8b34a457ef..a9d0bf7462 100644
--- a/spec/bundler/other/cli_dispatch_spec.rb
+++ b/spec/bundler/other/cli_dispatch_spec.rb
@@ -1,22 +1,29 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle command names" do
it "work when given fully" do
bundle "install"
- expect(err).to lack_errors
- expect(out).not_to match(/Ambiguous command/)
+ expect(last_command.bundler_err).to eq("Could not locate Gemfile")
+ expect(last_command.stdboth).not_to include("Ambiguous command")
end
it "work when not ambiguous" do
bundle "ins"
- expect(err).to lack_errors
- expect(out).not_to match(/Ambiguous command/)
+ expect(last_command.bundler_err).to eq("Could not locate Gemfile")
+ expect(last_command.stdboth).not_to include("Ambiguous command")
end
it "print a friendly error when ambiguous" do
bundle "in"
- expect(err).to lack_errors
- expect(out).to match(/Ambiguous command/)
+ expect(last_command.bundler_err).to eq("Ambiguous command in matches [info, init, inject, install]")
+ end
+
+ context "when cache_command_is_package is set" do
+ before { bundle! "config cache_command_is_package true" }
+
+ it "dispatches `bundle cache` to the package command" do
+ bundle "cache --verbose"
+ expect(last_command.stdout).to start_with "Running `bundle package --no-color --verbose`"
+ end
end
end
diff --git a/spec/bundler/other/compatibility_guard_spec.rb b/spec/bundler/other/compatibility_guard_spec.rb
new file mode 100644
index 0000000000..ac05ebd918
--- /dev/null
+++ b/spec/bundler/other/compatibility_guard_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+RSpec.describe "bundler compatibility guard" do
+ context "when the bundler version is 2+" do
+ before { simulate_bundler_version "2.0.a" }
+
+ context "when running on Ruby < 2.3", :ruby => "< 2.3" do
+ before { simulate_rubygems_version "2.6.11" }
+
+ it "raises a friendly error" do
+ bundle :version
+ expect(err).to eq("Bundler 2 requires Ruby 2.3 or later. Either install bundler 1 or update to a supported Ruby version.")
+ end
+ end
+
+ context "when running on RubyGems < 2.5", :ruby => ">= 2.5" do
+ before { simulate_rubygems_version "1.3.6" }
+
+ it "raises a friendly error" do
+ bundle :version
+ expect(err).to eq("Bundler 2 requires RubyGems 2.5 or later. Either install bundler 1 or update to a supported RubyGems version.")
+ end
+ end
+ end
+end
diff --git a/spec/bundler/other/ext_spec.rb b/spec/bundler/other/ext_spec.rb
index 2d6ab941b8..3f6f8b4928 100644
--- a/spec/bundler/other/ext_spec.rb
+++ b/spec/bundler/other/ext_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Gem::Specification#match_platform" do
it "does not match platforms other than the gem platform" do
diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb
index 196fbe0c31..fba177b497 100644
--- a/spec/bundler/other/major_deprecation_spec.rb
+++ b/spec/bundler/other/major_deprecation_spec.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-require "spec_helper"
-RSpec.describe "major deprecations" do
- let(:warnings) { out } # change to err in 2.0
+RSpec.describe "major deprecations", :bundler => "< 2" do
+ let(:warnings) { last_command.bundler_err } # change to err in 2.0
+ let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") }
context "in a .99 version" do
before do
@@ -23,17 +23,18 @@ RSpec.describe "major deprecations" do
before do
bundle "config major_deprecations true"
- install_gemfile <<-G
+ create_file "gems.rb", <<-G
source "file:#{gem_repo1}"
ruby #{RUBY_VERSION.dump}
gem "rack"
G
+ bundle! "install"
end
- describe "bundle_ruby", :ruby_repo do
+ describe "bundle_ruby" do
it "prints a deprecation" do
bundle_ruby
- out.gsub! "\nruby #{RUBY_VERSION}", ""
+ warnings.gsub! "\nruby #{RUBY_VERSION}", ""
expect(warnings).to have_major_deprecation "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`"
end
end
@@ -86,7 +87,24 @@ RSpec.describe "major deprecations" do
describe "bundle update --quiet" do
it "does not print any deprecations" do
bundle :update, :quiet => true
- expect(warnings).not_to have_major_deprecation
+ expect(warnings_without_version_messages).not_to have_major_deprecation
+ end
+ end
+
+ describe "bundle update" do
+ before do
+ create_file("gems.rb", "")
+ bundle! "install"
+ end
+
+ it "warns when no options are given" do
+ bundle! "update"
+ expect(warnings).to have_major_deprecation a_string_including("Pass --all to `bundle update` to update everything")
+ end
+
+ it "does not warn when --all is passed" do
+ bundle! "update --all"
+ expect(warnings_without_version_messages).not_to have_major_deprecation
end
end
@@ -110,17 +128,18 @@ RSpec.describe "major deprecations" do
G
bundle :install
- expect(err).not_to have_major_deprecation
- expect(out).not_to have_major_deprecation
+ expect(warnings_without_version_messages).not_to have_major_deprecation
end
it "should print a Gemfile deprecation warning" do
- install_gemfile <<-G
+ create_file "gems.rb"
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
+ expect(the_bundle).to include_gem "rack 1.0"
- expect(warnings).to have_major_deprecation("gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock.")
+ expect(warnings).to have_major_deprecation a_string_including("gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock.")
end
context "with flags" do
@@ -139,7 +158,8 @@ RSpec.describe "major deprecations" do
context "when Bundler.setup is run in a ruby script" do
it "should print a single deprecation warning" do
- install_gemfile <<-G
+ create_file "gems.rb"
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack", :group => :test
G
@@ -154,7 +174,7 @@ RSpec.describe "major deprecations" do
Bundler.setup
RUBY
- expect(warnings).to have_major_deprecation("gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock.")
+ expect(warnings_without_version_messages).to have_major_deprecation("gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock.")
end
end
@@ -179,17 +199,27 @@ RSpec.describe "major deprecations" do
context "with github gems" do
it "warns about the https change" do
- msg = "The :github option uses the git: protocol, which is not secure. " \
- "Bundler 2.0 will use the https: protocol, which is secure. Enable this change now by " \
- "running `bundle config github.https true`."
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(msg)
+ msg = <<-EOS
+The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
+
+ git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
+
+ EOS
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
subject.gem("sparks", :github => "indirect/sparks")
end
it "upgrades to https on request" do
- Bundler.settings["github.https"] = true
+ Bundler.settings.temporary "github.https" => true
+ msg = <<-EOS
+The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
+
+ git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
+
+ EOS
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks")
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).never
github_uri = "https://github.com/indirect/sparks.git"
expect(subject.dependencies.first.source.uri).to eq(github_uri)
end
@@ -198,12 +228,17 @@ RSpec.describe "major deprecations" do
context "with bitbucket gems" do
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
- msg = "The :bitbucket git source is deprecated, and will be removed " \
- "in Bundler 2.0. Add this code to your Gemfile to ensure it " \
- "continues to work:\n git_source(:bitbucket) do |repo_name|\n " \
- " \"https://\#{user_name}@bitbucket.org/\#{user_name}/\#{repo_name}" \
- ".git\"\n end\n"
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(msg)
+ msg = <<-EOS
+The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add this code to the top of your Gemfile to ensure it continues to work:
+
+ git_source(:bitbucket) do |repo_name|
+ user_name, repo_name = repo_name.split("/")
+ repo_name ||= user_name
+ "https://\#{user_name}@bitbucket.org/\#{user_name}/\#{repo_name}.git"
+ end
+
+ EOS
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails")
end
end
@@ -212,28 +247,27 @@ RSpec.describe "major deprecations" do
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
msg = "The :gist git source is deprecated, and will be removed " \
- "in Bundler 2.0. Add this code to your Gemfile to ensure it " \
- "continues to work:\n git_source(:gist) do |repo_name|\n " \
- " \"https://gist.github.com/\#{repo_name}.git\"\n" \
- " end\n"
- expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(msg)
+ "in Bundler 2.0. Add this code to the top of your Gemfile to ensure it " \
+ "continues to work:\n\n git_source(:gist) {|repo_name| " \
+ "\"https://gist.github.com/\#{repo_name}.git\" }\n\n"
+ expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg)
subject.gem("not-really-a-gem", :gist => "1234")
end
end
end
- context "bundle list" do
+ context "bundle show" do
it "prints a deprecation warning" do
- install_gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle :list
+ bundle! :show
- out.gsub!(/gems included.*?\[DEPRECATED/im, "[DEPRECATED")
+ warnings.gsub!(/gems included.*?\[DEPRECATED/im, "[DEPRECATED")
- expect(warnings).to have_major_deprecation("use `bundle show` instead of `bundle list`")
+ expect(warnings).to have_major_deprecation a_string_including("use `bundle list` instead of `bundle show`")
end
end
@@ -242,7 +276,7 @@ RSpec.describe "major deprecations" do
bundle "console"
expect(warnings).to have_major_deprecation \
- "bundle console will be replaced by `bin/console` generated by `bundle gem <name>`"
+ a_string_including("bundle console will be replaced by `bin/console` generated by `bundle gem <name>`")
end
end
end
diff --git a/spec/bundler/other/platform_spec.rb b/spec/bundler/other/platform_spec.rb
index 6adbcef111..fea5daf5ac 100644
--- a/spec/bundler/other/platform_spec.rb
+++ b/spec/bundler/other/platform_spec.rb
@@ -1,8 +1,13 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle platform" do
context "without flags" do
+ let(:bundle_platform_platforms_string) do
+ platforms = [rb]
+ platforms.unshift(specific_local_platform) if Bundler.feature_flag.bundler_2_mode?
+ platforms.map {|pl| "* #{pl}" }.join("\n")
+ end
+
it "returns all the output" do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -17,7 +22,7 @@ RSpec.describe "bundle platform" do
Your platform is: #{RUBY_PLATFORM}
Your app has gems that work on these platforms:
-* ruby
+#{bundle_platform_platforms_string}
Your Gemfile specifies a Ruby version requirement:
* ruby #{RUBY_VERSION}
@@ -40,7 +45,7 @@ G
Your platform is: #{RUBY_PLATFORM}
Your app has gems that work on these platforms:
-* ruby
+#{bundle_platform_platforms_string}
Your Gemfile specifies a Ruby version requirement:
* ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
@@ -61,7 +66,7 @@ G
Your platform is: #{RUBY_PLATFORM}
Your app has gems that work on these platforms:
-* ruby
+#{bundle_platform_platforms_string}
Your Gemfile does not specify a Ruby version requirement.
G
@@ -81,7 +86,7 @@ G
Your platform is: #{RUBY_PLATFORM}
Your app has gems that work on these platforms:
-* ruby
+#{bundle_platform_platforms_string}
Your Gemfile specifies a Ruby version requirement:
* ruby #{not_local_ruby_version}
@@ -493,7 +498,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
end
@@ -510,7 +515,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0"
end
end
@@ -527,7 +532,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :all => bundle_update_requires_all?
should_be_ruby_version_incorrect
end
@@ -543,7 +548,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :all => bundle_update_requires_all?
should_be_engine_incorrect
end
@@ -560,7 +565,7 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :all => bundle_update_requires_all?
should_be_engine_version_incorrect
end
end
@@ -576,12 +581,12 @@ G
build_gem "activesupport", "3.0"
end
- bundle :update
+ bundle :update, :all => bundle_update_requires_all?
should_be_patchlevel_incorrect
end
end
- context "bundle show" do
+ context "bundle info" do
before do
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -590,32 +595,32 @@ G
end
it "prints path if ruby version is correct" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rails"
#{ruby_version_correct}
G
- bundle "show rails"
+ bundle "info rails --path"
expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s)
end
it "prints path if ruby version is correct for any engine" do
simulate_ruby_engine "jruby" do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rails"
#{ruby_version_correct_engineless}
G
- bundle "show rails"
+ bundle "info rails --path"
expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s)
end
end
- it "fails if ruby version doesn't match" do
+ it "fails if ruby version doesn't match", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
@@ -627,7 +632,7 @@ G
should_be_ruby_version_incorrect
end
- it "fails if engine doesn't match" do
+ it "fails if engine doesn't match", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
@@ -639,7 +644,7 @@ G
should_be_engine_incorrect
end
- it "fails if engine version doesn't match" do
+ it "fails if engine version doesn't match", :bundler => "< 2" do
simulate_ruby_engine "jruby" do
gemfile <<-G
source "file://#{gem_repo1}"
@@ -653,7 +658,7 @@ G
end
end
- it "fails when patchlevel doesn't match" do
+ it "fails when patchlevel doesn't match", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@@ -671,11 +676,10 @@ G
context "bundle cache" do
before do
- gemfile <<-G
+ install_gemfile <<-G
+ source "file:#{gem_repo1}"
gem 'rack'
G
-
- system_gems "rack-1.0.0"
end
it "copies the .gem file to vendor/cache when ruby version matches" do
@@ -691,13 +695,14 @@ G
it "copies the .gem file to vendor/cache when ruby version matches for any engine" do
simulate_ruby_engine "jruby" do
- gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
gem 'rack'
#{ruby_version_correct_engineless}
G
- bundle :cache
+ bundle! :cache
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
end
@@ -752,11 +757,10 @@ G
context "bundle pack" do
before do
- gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
gem 'rack'
G
-
- system_gems "rack-1.0.0"
end
it "copies the .gem file to vendor/cache when ruby version matches" do
@@ -772,7 +776,8 @@ G
it "copies the .gem file to vendor/cache when ruby version matches any engine" do
simulate_ruby_engine "jruby" do
- gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
gem 'rack'
#{ruby_version_correct_engineless}
@@ -834,7 +839,7 @@ G
context "bundle exec" do
before do
ENV["BUNDLER_FORCE_TTY"] = "true"
- system_gems "rack-1.0.0", "rack-0.9.1"
+ system_gems "rack-1.0.0", "rack-0.9.1", :path => :bundle_path
end
it "activates the correct gem when ruby version matches" do
@@ -850,6 +855,7 @@ G
it "activates the correct gem when ruby version matches any engine" do
simulate_ruby_engine "jruby" do
+ system_gems "rack-1.0.0", "rack-0.9.1", :path => :bundle_path
gemfile <<-G
gem "rack", "0.9.1"
@@ -909,7 +915,7 @@ G
end
end
- context "bundle console" do
+ context "bundle console", :bundler => "< 2" do
before do
install_gemfile <<-G
source "file://#{gem_repo1}"
@@ -1174,6 +1180,7 @@ G
it "returns list of outdated gems when the ruby version matches for any engine" do
simulate_ruby_engine "jruby" do
+ bundle! :install
update_repo2 do
build_gem "activesupport", "3.0"
update_git "foo", :path => lib_path("foo")
diff --git a/spec/bundler/other/ssl_cert_spec.rb b/spec/bundler/other/ssl_cert_spec.rb
index 2de4dfdd0c..6d957276fc 100644
--- a/spec/bundler/other/ssl_cert_spec.rb
+++ b/spec/bundler/other/ssl_cert_spec.rb
@@ -1,14 +1,14 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "bundler/ssl_certs/certificate_manager"
RSpec.describe "SSL Certificates", :rubygems_master do
- hosts = %w(
+ hosts = %w[
rubygems.org
index.rubygems.org
rubygems.global.ssl.fastly.net
staging.rubygems.org
- )
+ ]
hosts.each do |host|
it "can securely connect to #{host}", :realworld do
diff --git a/spec/bundler/plugins/command_spec.rb b/spec/bundler/plugins/command_spec.rb
index 6ad782b758..8275351d19 100644
--- a/spec/bundler/plugins/command_spec.rb
+++ b/spec/bundler/plugins/command_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "command plugins" do
before do
diff --git a/spec/bundler/plugins/hook_spec.rb b/spec/bundler/plugins/hook_spec.rb
index 9850d850ac..8bdf61a8ab 100644
--- a/spec/bundler/plugins/hook_spec.rb
+++ b/spec/bundler/plugins/hook_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "hook plugins" do
before do
diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb
index e2d351181c..9304d78062 100644
--- a/spec/bundler/plugins/install_spec.rb
+++ b/spec/bundler/plugins/install_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundler plugin install" do
before do
@@ -58,7 +57,7 @@ RSpec.describe "bundler plugin install" do
end
end
RUBY
- s.require_paths = %w(lib src)
+ s.require_paths = %w[lib src]
s.write("src/fubar.rb")
end
end
diff --git a/spec/bundler/plugins/source/example_spec.rb b/spec/bundler/plugins/source/example_spec.rb
index 2ae34caf73..0dbd9a2a0f 100644
--- a/spec/bundler/plugins/source/example_spec.rb
+++ b/spec/bundler/plugins/source/example_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "real source plugins" do
context "with a minimal source plugin" do
@@ -7,7 +6,7 @@ RSpec.describe "real source plugins" do
build_repo2 do
build_plugin "bundler-source-mpath" do |s|
s.write "plugins.rb", <<-RUBY
- require "fileutils"
+ require "bundler/vendored_fileutils"
require "bundler-source-mpath"
class MPath < Bundler::Plugin::API
@@ -37,6 +36,10 @@ RSpec.describe "real source plugins" do
mkdir_p(install_path.parent)
FileUtils.cp_r(path, install_path)
+ spec_path = install_path.join("\#{spec.full_name}.gemspec")
+ spec_path.open("wb") {|f| f.write spec.to_ruby }
+ spec.loaded_from = spec_path.to_s
+
post_install(spec)
nil
@@ -64,7 +67,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("a-path-gem 1.0")
end
- it "writes to lock file" do
+ it "writes to lock file", :bundler => "< 2" do
bundle "install"
lockfile_should_be <<-G
@@ -89,12 +92,37 @@ RSpec.describe "real source plugins" do
G
end
+ it "writes to lock file", :bundler => "2" do
+ bundle "install"
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+
+ PLUGIN SOURCE
+ remote: #{lib_path("a-path-gem-1.0")}
+ type: mpath
+ specs:
+ a-path-gem (1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ a-path-gem!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
it "provides correct #full_gem_path" do
bundle "install"
run <<-RUBY
puts Bundler.rubygems.find_name('a-path-gem').first.full_gem_path
RUBY
- expect(out).to eq(bundle("show a-path-gem"))
+ expect(out).to eq(bundle("info a-path-gem --path"))
end
it "installs the gem executables" do
@@ -114,10 +142,10 @@ RSpec.describe "real source plugins" do
end
describe "bundle cache/package" do
- let(:uri_hash) { Digest::SHA1.hexdigest(lib_path("a-path-gem-1.0").to_s) }
+ let(:uri_hash) { Digest(:SHA1).hexdigest(lib_path("a-path-gem-1.0").to_s) }
it "copies repository to vendor cache and uses it" do
bundle "install"
- bundle "cache --all"
+ bundle :cache, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}/.git")).not_to exist
@@ -128,8 +156,8 @@ RSpec.describe "real source plugins" do
end
it "copies repository to vendor cache and uses it even when installed with bundle --path" do
- bundle "install --path vendor/bundle"
- bundle "cache --all"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
+ bundle! :cache, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
@@ -138,8 +166,8 @@ RSpec.describe "real source plugins" do
end
it "bundler package copies repository to vendor cache" do
- bundle "install --path vendor/bundle"
- bundle "package --all"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
+ bundle! :package, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/a-path-gem-1.0-#{uri_hash}")).to exist
@@ -173,7 +201,7 @@ RSpec.describe "real source plugins" do
end
it "installs" do
- bundle "install"
+ bundle! "install"
expect(the_bundle).to include_gems("a-path-gem 1.0")
end
@@ -228,6 +256,10 @@ RSpec.describe "real source plugins" do
`git reset --hard \#{revision}`
end
+ spec_path = install_path.join("\#{spec.full_name}.gemspec")
+ spec_path.open("wb") {|f| f.write spec.to_ruby }
+ spec.loaded_from = spec_path.to_s
+
post_install(spec)
nil
@@ -327,7 +359,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("ma-gitp-gem 1.0")
end
- it "writes to lock file" do
+ it "writes to lock file", :bundler => "< 2" do
revision = revision_for(lib_path("ma-gitp-gem-1.0"))
bundle "install"
@@ -354,6 +386,33 @@ RSpec.describe "real source plugins" do
G
end
+ it "writes to lock file", :bundler => "2" do
+ revision = revision_for(lib_path("ma-gitp-gem-1.0"))
+ bundle "install"
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+
+ PLUGIN SOURCE
+ remote: file://#{lib_path("ma-gitp-gem-1.0")}
+ type: gitp
+ revision: #{revision}
+ specs:
+ ma-gitp-gem (1.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ ma-gitp-gem!
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
+
context "with lockfile" do
before do
revision = revision_for(lib_path("ma-gitp-gem-1.0"))
@@ -433,7 +492,7 @@ RSpec.describe "real source plugins" do
end
G
- bundle "cache --all"
+ bundle :cache, forgotten_command_line_options([:all, :cache_all] => true)
expect(bundled_app("vendor/cache/foo-1.0-#{ref}")).to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.git")).not_to exist
expect(bundled_app("vendor/cache/foo-1.0-#{ref}/.bundlecache")).to be_file
diff --git a/spec/bundler/plugins/source_spec.rb b/spec/bundler/plugins/source_spec.rb
index 0448bc409a..543e90eb60 100644
--- a/spec/bundler/plugins/source_spec.rb
+++ b/spec/bundler/plugins/source_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundler source plugin" do
describe "plugins dsl eval for #source with :type option" do
diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb
index b87b4a0731..9fc03b486b 100644
--- a/spec/bundler/quality_spec.rb
+++ b/spec/bundler/quality_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
if defined?(Encoding) && Encoding.default_external.name != "UTF-8"
# Poor man's ruby -E UTF-8, since it works on 1.8.7
@@ -7,17 +6,6 @@ if defined?(Encoding) && Encoding.default_external.name != "UTF-8"
end
RSpec.describe "The library itself" do
- def check_for_spec_defs_with_single_quotes(filename)
- failing_lines = []
-
- File.readlines(filename).each_with_index do |line, number|
- failing_lines << number + 1 if line =~ /^ *(describe|it|context) {1}'{1}/
- end
-
- return if failing_lines.empty?
- "#{filename} uses inconsistent single quotes on lines #{failing_lines.join(", ")}"
- end
-
def check_for_debugging_mechanisms(filename)
debugging_mechanisms_regex = /
(binding\.pry)|
@@ -67,7 +55,7 @@ RSpec.describe "The library itself" do
failing_lines = []
File.readlines(filename).each_with_index do |line, number|
next if line =~ /^\s+#.*\s+\n$/
- next if %w(LICENCE.md).include?(line)
+ next if %w[LICENCE.md].include?(line)
failing_lines << number + 1 if line =~ /\s+\n$/
end
@@ -77,7 +65,7 @@ RSpec.describe "The library itself" do
def check_for_expendable_words(filename)
failing_line_message = []
- useless_words = %w(
+ useless_words = %w[
actually
basically
clearly
@@ -85,12 +73,12 @@ RSpec.describe "The library itself" do
obviously
really
simply
- )
+ ]
pattern = /\b#{Regexp.union(useless_words)}\b/i
File.readlines(filename).each_with_index do |line, number|
next unless word_found = pattern.match(line)
- failing_line_message << "#{filename} has '#{word_found}' on line #{number + 1}. Avoid using these kinds of weak modifiers."
+ failing_line_message << "#{filename}:#{number.succ} has '#{word_found}'. Avoid using these kinds of weak modifiers."
end
failing_line_message unless failing_line_message.empty?
@@ -102,7 +90,7 @@ RSpec.describe "The library itself" do
File.readlines(filename).each_with_index do |line, number|
next unless word_found = specific_pronouns.match(line)
- failing_line_message << "#{filename} has '#{word_found}' on line #{number + 1}. Use more generic pronouns in documentation."
+ failing_line_message << "#{filename}:#{number.succ} has '#{word_found}'. Use more generic pronouns in documentation."
end
failing_line_message unless failing_line_message.empty?
@@ -117,9 +105,9 @@ RSpec.describe "The library itself" do
end
it "has no malformed whitespace", :ruby_repo do
- exempt = /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs|LICENSE/
+ exempt = /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs|LICENSE|vcr_cassettes/
error_messages = []
- Dir.chdir(File.expand_path("../..", __FILE__)) do
+ Dir.chdir(root) do
`git ls-files -z`.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_tab_characters(filename)
@@ -129,22 +117,10 @@ RSpec.describe "The library itself" do
expect(error_messages.compact).to be_well_formed
end
- it "uses double-quotes consistently in specs", :ruby_repo do
- included = /spec/
- error_messages = []
- Dir.chdir(File.expand_path("../", __FILE__)) do
- `git ls-files -z`.split("\x0").each do |filename|
- next unless filename =~ included
- error_messages << check_for_spec_defs_with_single_quotes(filename)
- end
- end
- expect(error_messages.compact).to be_well_formed
- end
-
it "does not include any leftover debugging or development mechanisms", :ruby_repo do
- exempt = %r{quality_spec.rb|support/helpers}
+ exempt = %r{quality_spec.rb|support/helpers|vcr_cassettes|\.md|\.ronn}
error_messages = []
- Dir.chdir(File.expand_path("../", __FILE__)) do
+ Dir.chdir(root) do
`git ls-files -z`.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_debugging_mechanisms(filename)
@@ -155,8 +131,8 @@ RSpec.describe "The library itself" do
it "does not include any unresolved merge conflicts", :ruby_repo do
error_messages = []
- exempt = %r{lock/lockfile_spec|quality_spec}
- Dir.chdir(File.expand_path("../", __FILE__)) do
+ exempt = %r{lock/lockfile_(bundler_1_)?spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser\.rb}
+ Dir.chdir(root) do
`git ls-files -z`.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_git_merge_conflicts(filename)
@@ -168,8 +144,8 @@ RSpec.describe "The library itself" do
it "maintains language quality of the documentation", :ruby_repo do
included = /ronn/
error_messages = []
- Dir.chdir(File.expand_path("../../man", __FILE__)) do
- `git ls-files -z`.split("\x0").each do |filename|
+ Dir.chdir(root) do
+ `git ls-files -z -- man`.split("\x0").each do |filename|
next unless filename =~ included
error_messages << check_for_expendable_words(filename)
error_messages << check_for_specific_pronouns(filename)
@@ -181,8 +157,8 @@ RSpec.describe "The library itself" do
it "maintains language quality of sentences used in source code", :ruby_repo do
error_messages = []
exempt = /vendor/
- Dir.chdir(File.expand_path("../../lib", __FILE__)) do
- `git ls-files -z`.split("\x0").each do |filename|
+ Dir.chdir(root) do
+ `git ls-files -z -- lib`.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_expendable_words(filename)
error_messages << check_for_specific_pronouns(filename)
@@ -192,27 +168,34 @@ RSpec.describe "The library itself" do
end
it "documents all used settings", :ruby_repo do
- exemptions = %w(
+ exemptions = %w[
+ cache_command_is_package
+ console_command
+ default_cli_command
+ deployment_means_frozen
+ forget_cli_options
gem.coc
gem.mit
inline
+ lockfile_uses_separate_rubygems_sources
warned_version
- )
+ ]
all_settings = Hash.new {|h, k| h[k] = [] }
documented_settings = exemptions
Bundler::Settings::BOOL_KEYS.each {|k| all_settings[k] << "in Bundler::Settings::BOOL_KEYS" }
Bundler::Settings::NUMBER_KEYS.each {|k| all_settings[k] << "in Bundler::Settings::NUMBER_KEYS" }
+ Bundler::Settings::ARRAY_KEYS.each {|k| all_settings[k] << "in Bundler::Settings::ARRAY_KEYS" }
- Dir.chdir(File.expand_path("../../lib", __FILE__)) do
+ Dir.chdir(root) do
key_pattern = /([a-z\._-]+)/i
- `git ls-files -z`.split("\x0").each do |filename|
+ `git ls-files -z -- lib`.split("\x0").each do |filename|
File.readlines(filename).each_with_index do |line, number|
- line.scan(/Bundler\.settings\[:#{key_pattern}\]/).flatten.each {|s| all_settings[s] << "referenced at `lib/#{filename}:#{number.succ}`" }
+ line.scan(/Bundler\.settings\[:#{key_pattern}\]/).flatten.each {|s| all_settings[s] << "referenced at `#{filename}:#{number.succ}`" }
end
end
- documented_settings = File.read("../man/bundle-config.ronn").scan(/^\* `#{key_pattern}`/).flatten
+ documented_settings = File.read("man/bundle-config.ronn")[/LIST OF AVAILABLE KEYS.*/m].scan(/^\* `#{key_pattern}`/).flatten
end
documented_settings.each {|s| all_settings.delete(s) }
@@ -222,6 +205,8 @@ RSpec.describe "The library itself" do
end
expect(error_messages.sort).to be_well_formed
+
+ expect(documented_settings).to be_sorted
end
it "can still be built", :ruby_repo do
@@ -229,9 +214,12 @@ RSpec.describe "The library itself" do
begin
gem_command! :build, "bundler.gemspec"
if Bundler.rubygems.provides?(">= 2.4")
+ # there's no way aroudn this warning
+ last_command.stderr.sub!(/^YAML safe loading.*/, "")
+
# older rubygems have weird warnings, and we won't actually be using them
# to build the gem for releases anyways
- expect(err).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
+ expect(last_command.stderr).to be_empty, "bundler should build as a gem without warnings, but\n#{err}"
end
ensure
# clean up the .gem generated
@@ -241,23 +229,24 @@ RSpec.describe "The library itself" do
end
it "does not contain any warnings", :ruby_repo do
- Dir.chdir(root.join("lib")) do
- exclusions = %w(
- bundler/capistrano.rb
- bundler/gem_tasks.rb
- bundler/vlad.rb
- )
- lib_files = `git ls-files -z`.split("\x0").grep(/\.rb$/) - exclusions
- lib_files.reject! {|f| f.start_with?("bundler/vendor") }
+ Dir.chdir(root) do
+ exclusions = %w[
+ lib/bundler/capistrano.rb
+ lib/bundler/deployment.rb
+ lib/bundler/gem_tasks.rb
+ lib/bundler/vlad.rb
+ lib/bundler/templates/gems.rb
+ ]
+ lib_files = `git ls-files -z -- lib`.split("\x0").grep(/\.rb$/) - exclusions
+ lib_files.reject! {|f| f.start_with?("lib/bundler/vendor") }
lib_files.map! {|f| f.chomp(".rb") }
- sys_exec!("ruby -w -I.") do |input, _, _|
+ sys_exec!("ruby -w -Ilib") do |input, _, _|
lib_files.each do |f|
- input.puts "require '#{f}'"
+ input.puts "require '#{f.sub(%r{\Alib/}, "")}'"
end
end
- expect(@err.split("\n")).to be_well_formed
- expect(@out.split("\n")).to be_well_formed
+ expect(last_command.stdboth.split("\n")).to be_well_formed
end
end
end
diff --git a/spec/bundler/realworld/dependency_api_spec.rb b/spec/bundler/realworld/dependency_api_spec.rb
index 468fa3644c..13527ce5d1 100644
--- a/spec/bundler/realworld/dependency_api_spec.rb
+++ b/spec/bundler/realworld/dependency_api_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "gemcutter's dependency API", :realworld => true do
context "when Gemcutter API takes too long to respond" do
@@ -23,6 +22,7 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
@t.run
wait_for_server("127.0.0.1", port)
+ bundle! "config timeout 1"
end
after do
@@ -32,16 +32,11 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
end
it "times out and falls back on the modern index" do
- gemfile <<-G
+ install_gemfile! <<-G, :artifice => nil
source "#{@server_uri}"
gem "rack"
-
- old_v, $VERBOSE = $VERBOSE, nil
- Bundler::Fetcher.api_timeout = 1
- $VERBOSE = old_v
G
- bundle :install
expect(out).to include("Fetching source index from #{@server_uri}/")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/bundler/realworld/edgecases_spec.rb b/spec/bundler/realworld/edgecases_spec.rb
index 302fd57cf0..aa60e20b8a 100644
--- a/spec/bundler/realworld/edgecases_spec.rb
+++ b/spec/bundler/realworld/edgecases_spec.rb
@@ -1,19 +1,22 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
def rubygems_version(name, requirement)
- require "bundler/source/rubygems/remote"
- require "bundler/fetcher"
- source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
- fetcher = Bundler::Fetcher.new(source)
- index = fetcher.specs([name], nil)
- rubygem = index.search(Gem::Dependency.new(name, requirement)).last
- if rubygem.nil?
- raise "Could not find #{name} (#{requirement}) on rubygems.org!\n" \
- "Found specs:\n#{index.send(:specs).inspect}"
- end
- "#{name} (#{rubygem.version})"
+ ruby! <<-RUBY
+ require #{File.expand_path("../../support/artifice/vcr.rb", __FILE__).dump}
+ require "bundler"
+ require "bundler/source/rubygems/remote"
+ require "bundler/fetcher"
+ source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
+ fetcher = Bundler::Fetcher.new(source)
+ index = fetcher.specs([#{name.dump}], nil)
+ rubygem = index.search(Gem::Dependency.new(#{name.dump}, #{requirement.dump})).last
+ if rubygem.nil?
+ raise "Could not find #{name} (#{requirement}) on rubygems.org!\n" \
+ "Found specs:\n\#{index.send(:specs).inspect}"
+ end
+ "#{name} (\#{rubygem.version})"
+ RUBY
end
# there is no rbx-relative-require gem that will install on 1.9
@@ -76,7 +79,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem "gxapi_rails", "< 0.1.0" # 0.1.0 was released way after the test was written
gem 'rack-cache', '1.2.0' # last version that works on Ruby 1.9
G
- bundle :lock
+ bundle! :lock
expect(lockfile).to include("gxapi_rails (0.0.6)")
end
@@ -89,7 +92,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem "activerecord", "~> 3.0"
gem "builder", "~> 2.1.2"
G
- bundle :lock
+ bundle! :lock
expect(lockfile).to include(rubygems_version("i18n", "~> 0.6.0"))
expect(lockfile).to include(rubygems_version("activesupport", "~> 3.0"))
end
@@ -220,9 +223,6 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
DEPENDENCIES
paperclip (~> 5.1.0)
rails (~> 4.2.7.1)
-
- BUNDLED WITH
- 1.13.1
L
bundle! "lock --update paperclip"
@@ -239,7 +239,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem 'rack', '1.0.1'
G
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
expect(err).not_to include("Could not find rake")
expect(err).to lack_errors
end
@@ -247,6 +247,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
it "checks out git repos when the lockfile is corrupted" do
gemfile <<-G
source "https://rubygems.org"
+ git_source(:github) {|repo| "https://github.com/\#{repo}.git" }
gem 'activerecord', :github => 'carlhuda/rails-bundler-test', :branch => 'master'
gem 'activesupport', :github => 'carlhuda/rails-bundler-test', :branch => 'master'
@@ -255,7 +256,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
lockfile <<-L
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -282,7 +283,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
multi_json (~> 1.0)
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -309,7 +310,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
multi_json (~> 1.0)
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -366,9 +367,8 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
activesupport!
L
- bundle :lock
- expect(err).to eq("")
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! :lock
+ expect(last_command.stderr).to lack_errors
end
it "outputs a helpful error message when gems have invalid gemspecs" do
diff --git a/spec/bundler/realworld/gemfile_source_header_spec.rb b/spec/bundler/realworld/gemfile_source_header_spec.rb
index ba888d43bd..59c1916874 100644
--- a/spec/bundler/realworld/gemfile_source_header_spec.rb
+++ b/spec/bundler/realworld/gemfile_source_header_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "thread"
RSpec.describe "fetching dependencies with a mirrored source", :realworld => true, :rubygems => ">= 2.0" do
@@ -23,7 +23,7 @@ RSpec.describe "fetching dependencies with a mirrored source", :realworld => tru
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
diff --git a/spec/bundler/realworld/mirror_probe_spec.rb b/spec/bundler/realworld/mirror_probe_spec.rb
index 93dca0c173..ab74886329 100644
--- a/spec/bundler/realworld/mirror_probe_spec.rb
+++ b/spec/bundler/realworld/mirror_probe_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "thread"
RSpec.describe "fetching dependencies with a not available mirror", :realworld => true do
@@ -32,7 +32,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
@@ -52,7 +52,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
@@ -71,7 +71,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Fetching source index from #{mirror}")
expect(out).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}")
@@ -86,14 +86,15 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
-
- expect(out).to eq "Fetching source index from #{mirror}/
+ bundle :install, :artifice => nil
+ expect(last_command.stdout).to include "Fetching source index from #{mirror}/"
+ expect(last_command.bundler_err).to include <<-EOS.strip
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
-Could not fetch specs from #{mirror}/"
+Could not fetch specs from #{mirror}/
+ EOS
end
end
@@ -108,7 +109,7 @@ Could not fetch specs from #{mirror}/"
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Fetching source index from #{mirror}")
expect(out).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}")
diff --git a/spec/bundler/realworld/parallel_spec.rb b/spec/bundler/realworld/parallel_spec.rb
index 6950bead19..ed4430c68b 100644
--- a/spec/bundler/realworld/parallel_spec.rb
+++ b/spec/bundler/realworld/parallel_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "parallel", :realworld => true, :sometimes => true do
it "installs" do
@@ -18,14 +17,11 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
expect(out).to include("is not threadsafe")
end
- bundle "show activesupport"
+ bundle "info activesupport --path"
expect(out).to match(/activesupport/)
- bundle "show faker"
+ bundle "info faker --path"
expect(out).to match(/faker/)
-
- bundle "config jobs"
- expect(out).to match(/: "4"/)
end
it "updates" do
@@ -42,7 +38,7 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
gem 'i18n', '~> 0.6.0' # Because 0.7+ requires Ruby 1.9.3+
G
- bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }
+ bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }, :all => bundle_update_requires_all?
if Bundler.rubygems.provides?(">= 2.1.0")
expect(out).to match(/[1-3]: /)
@@ -50,14 +46,11 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
expect(out).to include("is not threadsafe")
end
- bundle "show activesupport"
+ bundle "info activesupport --path"
expect(out).to match(/activesupport-3\.2\.\d+/)
- bundle "show faker"
+ bundle "info faker --path"
expect(out).to match(/faker/)
-
- bundle "config jobs"
- expect(out).to match(/: "4"/)
end
it "works with --standalone" do
diff --git a/spec/bundler/resolver/basic_spec.rb b/spec/bundler/resolver/basic_spec.rb
index 9e93847ab5..d5658824ba 100644
--- a/spec/bundler/resolver/basic_spec.rb
+++ b/spec/bundler/resolver/basic_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Resolving" do
before :each do
@@ -9,31 +8,38 @@ RSpec.describe "Resolving" do
it "resolves a single gem" do
dep "rack"
- should_resolve_as %w(rack-1.1)
+ should_resolve_as %w[rack-1.1]
end
it "resolves a gem with dependencies" do
dep "actionpack"
- should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
+ should_resolve_as %w[actionpack-2.3.5 activesupport-2.3.5 rack-1.0]
end
it "resolves a conflicting index" do
@index = a_conflict_index
dep "my_app"
- should_resolve_as %w(activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0)
+ should_resolve_as %w[activemodel-3.2.11 builder-3.0.4 grape-0.2.6 my_app-1.0.0]
end
it "resolves a complex conflicting index" do
@index = a_complex_conflict_index
dep "my_app"
- should_resolve_as %w(a-1.4.0 b-0.3.5 c-3.2 d-0.9.8 my_app-1.1.0)
+ should_resolve_as %w[a-1.4.0 b-0.3.5 c-3.2 d-0.9.8 my_app-1.1.0]
end
it "resolves a index with conflict on child" do
@index = index_with_conflict_on_child
dep "chef_app"
- should_resolve_as %w(berkshelf-2.0.7 chef-10.26 chef_app-1.0.0 json-1.7.7)
+ should_resolve_as %w[berkshelf-2.0.7 chef-10.26 chef_app-1.0.0 json-1.7.7]
+ end
+
+ it "prefers expicitly requested dependencies when resolving an index which would otherwise be ambiguous" do
+ @index = an_ambiguous_index
+ dep "a"
+ dep "b"
+ should_resolve_as %w[a-1.0.0 b-2.0.0 c-1.0.0 d-1.0.0]
end
it "resolves a index with root level conflict on child" do
@@ -42,7 +48,29 @@ RSpec.describe "Resolving" do
dep "activesupport", "~> 3.0"
dep "activerecord", "~> 3.0"
dep "builder", "~> 2.1.2"
- should_resolve_as %w(activesupport-3.0.5 i18n-0.4.2 builder-2.1.2 activerecord-3.0.5 activemodel-3.0.5)
+ should_resolve_as %w[activesupport-3.0.5 i18n-0.4.2 builder-2.1.2 activerecord-3.0.5 activemodel-3.0.5]
+ end
+
+ it "resolves a gem specified with a pre-release version" do
+ dep "activesupport", "~> 3.0.0.beta"
+ dep "activemerchant"
+ should_resolve_as %w[activemerchant-2.3.5 activesupport-3.0.0.beta1]
+ end
+
+ it "doesn't select a pre-release if not specified in the Gemfile" do
+ dep "activesupport"
+ dep "reform"
+ should_resolve_as %w[reform-1.0.0 activesupport-2.3.5]
+ end
+
+ it "doesn't select a pre-release for sub-dependencies" do
+ dep "reform"
+ should_resolve_as %w[reform-1.0.0 activesupport-2.3.5]
+ end
+
+ it "selects a pre-release for sub-dependencies if it's the only option" do
+ dep "need-pre"
+ should_resolve_as %w[need-pre-1.0.0 activesupport-3.0.0.beta1]
end
it "raises an exception if a child dependency is not resolved" do
@@ -55,7 +83,7 @@ RSpec.describe "Resolving" do
it "raises an exception with the minimal set of conflicting dependencies" do
@index = build_index do
- %w(0.9 1.0 2.0).each {|v| gem("a", v) }
+ %w[0.9 1.0 2.0].each {|v| gem("a", v) }
gem("b", "1.0") { dep "a", ">= 2" }
gem("c", "1.0") { dep "a", "< 1" }
end
@@ -88,14 +116,14 @@ Bundler could not find compatible versions for gem "a":
it "should install the latest possible version of a direct requirement with no constraints given" do
@index = a_complicated_index
dep "foo"
- should_resolve_and_include %w(foo-3.0.5)
+ should_resolve_and_include %w[foo-3.0.5]
end
# Issue #3459
it "should install the latest possible version of a direct requirement with constraints given" do
@index = a_complicated_index
dep "foo", ">= 3.0.0"
- should_resolve_and_include %w(foo-3.0.5)
+ should_resolve_and_include %w[foo-3.0.5]
end
it "takes into account required_ruby_version" do
@@ -125,7 +153,7 @@ Bundler could not find compatible versions for gem "a":
deps << Bundler::DepProxy.new(d, "ruby")
end
- should_resolve_and_include %w(foo-1.0.0 bar-1.0.0), [{}, []]
+ should_resolve_and_include %w[foo-1.0.0 bar-1.0.0], [[]]
end
context "conservative" do
@@ -139,7 +167,7 @@ Bundler could not find compatible versions for gem "a":
gem("foo", "1.5.0") { dep "bar", "~> 2.1" }
gem("foo", "1.5.1") { dep "bar", "~> 3.0" }
gem("foo", "2.0.0") { dep "bar", "~> 3.0" }
- gem "bar", %w(2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0)
+ gem "bar", %w[2.0.3 2.0.4 2.0.5 2.1.0 2.1.1 3.0.0]
end
dep "foo"
@@ -147,23 +175,23 @@ Bundler could not find compatible versions for gem "a":
@base = Bundler::SpecSet.new([])
# locked represents versions in lockfile
- @locked = locked(%w(foo 1.4.3), %w(bar 2.0.3))
+ @locked = locked(%w[foo 1.4.3], %w[bar 2.0.3])
end
it "resolves all gems to latest patch" do
# strict is not set, so bar goes up a minor version due to dependency from foo 1.4.5
- should_conservative_resolve_and_include :patch, [], %w(foo-1.4.5 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, [], %w[foo-1.4.5 bar-2.1.1]
end
it "resolves all gems to latest patch strict" do
# strict is set, so foo can only go up to 1.4.4 to avoid bar going up a minor version, and bar can go up to 2.0.5
- should_conservative_resolve_and_include [:patch, :strict], [], %w(foo-1.4.4 bar-2.0.5)
+ should_conservative_resolve_and_include [:patch, :strict], [], %w[foo-1.4.4 bar-2.0.5]
end
it "resolves foo only to latest patch - same dependency case" do
- @locked = locked(%w(foo 1.3.7), %w(bar 2.0.3))
+ @locked = locked(%w[foo 1.3.7], %w[bar 2.0.3])
# bar is locked, and the lock holds here because the dependency on bar doesn't change on the matching foo version.
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.3.8 bar-2.0.3)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.3.8 bar-2.0.3]
end
it "resolves foo only to latest patch - changing dependency not declared case" do
@@ -173,44 +201,44 @@ Bundler could not find compatible versions for gem "a":
# dependency of "bar", "~> 2.1" -- bar-2.1.1 -- is selected. This is not a bug and follows
# the long-standing documented Conservative Updating behavior of bundle install.
# http://bundler.io/v1.12/man/bundle-install.1.html#CONSERVATIVE-UPDATING
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.4.5 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.4.5 bar-2.1.1]
end
it "resolves foo only to latest patch - changing dependency declared case" do
# bar is locked AND a declared dependency in the Gemfile, so it will not move, and therefore
# foo can only move up to 1.4.4.
@base << build_spec("bar", "2.0.3").first
- should_conservative_resolve_and_include :patch, ["foo"], %w(foo-1.4.4 bar-2.0.3)
+ should_conservative_resolve_and_include :patch, ["foo"], %w[foo-1.4.4 bar-2.0.3]
end
it "resolves foo only to latest patch strict" do
# adding strict helps solve the possibly unexpected behavior of bar changing in the prior test case,
# because no versions will be returned for bar ~> 2.1, so the engine falls back to ~> 2.0 (turn on
# debugging to see this happen).
- should_conservative_resolve_and_include [:patch, :strict], ["foo"], %w(foo-1.4.4 bar-2.0.3)
+ should_conservative_resolve_and_include [:patch, :strict], ["foo"], %w[foo-1.4.4 bar-2.0.3]
end
it "resolves bar only to latest patch" do
# bar is locked, so foo can only go up to 1.4.4
- should_conservative_resolve_and_include :patch, ["bar"], %w(foo-1.4.3 bar-2.0.5)
+ should_conservative_resolve_and_include :patch, ["bar"], %w[foo-1.4.3 bar-2.0.5]
end
it "resolves all gems to latest minor" do
# strict is not set, so bar goes up a major version due to dependency from foo 1.4.5
- should_conservative_resolve_and_include :minor, [], %w(foo-1.5.1 bar-3.0.0)
+ should_conservative_resolve_and_include :minor, [], %w[foo-1.5.1 bar-3.0.0]
end
it "resolves all gems to latest minor strict" do
# strict is set, so foo can only go up to 1.5.0 to avoid bar going up a major version
- should_conservative_resolve_and_include [:minor, :strict], [], %w(foo-1.5.0 bar-2.1.1)
+ should_conservative_resolve_and_include [:minor, :strict], [], %w[foo-1.5.0 bar-2.1.1]
end
it "resolves all gems to latest major" do
- should_conservative_resolve_and_include :major, [], %w(foo-2.0.0 bar-3.0.0)
+ should_conservative_resolve_and_include :major, [], %w[foo-2.0.0 bar-3.0.0]
end
it "resolves all gems to latest major strict" do
- should_conservative_resolve_and_include [:major, :strict], [], %w(foo-2.0.0 bar-3.0.0)
+ should_conservative_resolve_and_include [:major, :strict], [], %w[foo-2.0.0 bar-3.0.0]
end
# Why would this happen in real life? If bar 2.2 has a bug that the author of foo wants to bypass
@@ -221,7 +249,7 @@ Bundler could not find compatible versions for gem "a":
gem("foo", "1.4.3") { dep "bar", "~> 2.2" }
gem("foo", "1.4.4") { dep "bar", "~> 2.1.0" }
gem("foo", "1.5.0") { dep "bar", "~> 2.0.0" }
- gem "bar", %w(2.0.5 2.1.1 2.2.3)
+ gem "bar", %w[2.0.5 2.1.1 2.2.3]
end
dep "foo"
@@ -229,29 +257,25 @@ Bundler could not find compatible versions for gem "a":
@base = Bundler::SpecSet.new([])
# locked represents versions in lockfile
- @locked = locked(%w(foo 1.4.3), %w(bar 2.2.3))
+ @locked = locked(%w[foo 1.4.3], %w[bar 2.2.3])
end
it "could revert to a previous version level patch" do
- should_conservative_resolve_and_include :patch, [], %w(foo-1.4.4 bar-2.1.1)
+ should_conservative_resolve_and_include :patch, [], %w[foo-1.4.4 bar-2.1.1]
end
it "cannot revert to a previous version in strict mode level patch" do
- # the strict option removes the version required to match, so a version conflict results
- expect do
- should_conservative_resolve_and_include [:patch, :strict], [], %w(foo-1.4.3 bar-2.1.1)
- end.to raise_error Bundler::VersionConflict, /#{Regexp.escape("Could not find gem 'bar (~> 2.1.0)'")}/
+ # fall back to the locked resolution since strict means we can't regress either version
+ should_conservative_resolve_and_include [:patch, :strict], [], %w[foo-1.4.3 bar-2.2.3]
end
it "could revert to a previous version level minor" do
- should_conservative_resolve_and_include :minor, [], %w(foo-1.5.0 bar-2.0.5)
+ should_conservative_resolve_and_include :minor, [], %w[foo-1.5.0 bar-2.0.5]
end
it "cannot revert to a previous version in strict mode level minor" do
- # the strict option removes the version required to match, so a version conflict results
- expect do
- should_conservative_resolve_and_include [:minor, :strict], [], %w(foo-1.4.3 bar-2.1.1)
- end.to raise_error Bundler::VersionConflict, /#{Regexp.escape("Could not find gem 'bar (~> 2.0.0)'")}/
+ # fall back to the locked resolution since strict means we can't regress either version
+ should_conservative_resolve_and_include [:minor, :strict], [], %w[foo-1.4.3 bar-2.2.3]
end
end
end
diff --git a/spec/bundler/resolver/platform_spec.rb b/spec/bundler/resolver/platform_spec.rb
index 90d6f637ce..fee0cf1f1c 100644
--- a/spec/bundler/resolver/platform_spec.rb
+++ b/spec/bundler/resolver/platform_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Resolving platform craziness" do
describe "with cross-platform gems" do
@@ -11,21 +10,21 @@ RSpec.describe "Resolving platform craziness" do
dep "nokogiri"
platforms "ruby", "java"
- should_resolve_as %w(nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3)
+ should_resolve_as %w[nokogiri-1.4.2 nokogiri-1.4.2-java weakling-0.0.3]
end
it "doesn't pull gems that don't exist for the current platform" do
dep "nokogiri"
platforms "ruby"
- should_resolve_as %w(nokogiri-1.4.2)
+ should_resolve_as %w[nokogiri-1.4.2]
end
it "doesn't pull gems when the version is available for all requested platforms" do
dep "nokogiri"
platforms "mswin32"
- should_resolve_as %w(nokogiri-1.4.2.1-x86-mswin32)
+ should_resolve_as %w[nokogiri-1.4.2.1-x86-mswin32]
end
end
@@ -43,32 +42,32 @@ RSpec.describe "Resolving platform craziness" do
# win32 is hardcoded to get CPU x86 in rubygems
platforms "mswin32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-x86-mswin32)
+ should_resolve_as %w[thin-1.2.7-x86-mswin32]
end
it "finds mingw gems" do
# mingw is _not_ hardcoded to add CPU x86 in rubygems
platforms "x86-mingw32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-mingw32)
+ should_resolve_as %w[thin-1.2.7-mingw32]
end
it "finds x64-mingw gems" do
platforms "x64-mingw32"
dep "thin"
- should_resolve_as %w(thin-1.2.7-x64-mingw32)
+ should_resolve_as %w[thin-1.2.7-x64-mingw32]
end
it "finds universal-mingw gems on x86-mingw" do
platform "x86-mingw32"
dep "win32-api"
- should_resolve_as %w(win32-api-1.5.1-universal-mingw32)
+ should_resolve_as %w[win32-api-1.5.1-universal-mingw32]
end
it "finds universal-mingw gems on x64-mingw" do
platform "x64-mingw32"
dep "win32-api"
- should_resolve_as %w(win32-api-1.5.1-universal-mingw32)
+ should_resolve_as %w[win32-api-1.5.1-universal-mingw32]
end
end
@@ -87,7 +86,7 @@ RSpec.describe "Resolving platform craziness" do
dep "baz", " ~> 1.1.0"
end
- gem "baz", %w(1.0.0 1.1.0 1.2.0)
+ gem "baz", %w[1.0.0 1.1.0 1.2.0]
end
end
diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb
index ff27d0b415..388ee049d0 100644
--- a/spec/bundler/runtime/executable_spec.rb
+++ b/spec/bundler/runtime/executable_spec.rb
@@ -1,16 +1,15 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Running bin/* commands" do
before :each do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
end
it "runs the bundled command when in the bundle" do
- bundle "install --binstubs"
+ bundle! "binstubs rack"
build_gem "rack", "2.0", :to_system => true do |s|
s.executables = "rackup"
@@ -21,7 +20,7 @@ RSpec.describe "Running bin/* commands" do
end
it "allows the location of the gem stubs to be specified" do
- bundle "install --binstubs gbin"
+ bundle! "binstubs rack", :path => "gbin"
expect(bundled_app("bin")).not_to exist
expect(bundled_app("gbin/rackup")).to exist
@@ -31,24 +30,24 @@ RSpec.describe "Running bin/* commands" do
end
it "allows absolute paths as a specification of where to install bin stubs" do
- bundle "install --binstubs #{tmp}/bin"
+ bundle! "binstubs rack", :path => tmp("bin")
gembin tmp("bin/rackup")
expect(out).to eq("1.0.0")
end
it "uses the default ruby install name when shebang is not specified" do
- bundle "install --binstubs"
+ bundle! "binstubs rack"
expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env #{RbConfig::CONFIG["ruby_install_name"]}\n")
end
it "allows the name of the shebang executable to be specified" do
- bundle "install --binstubs --shebang ruby-foo"
+ bundle! "binstubs rack", :shebang => "ruby-foo"
expect(File.open("bin/rackup").gets).to eq("#!/usr/bin/env ruby-foo\n")
end
it "runs the bundled command when out of the bundle" do
- bundle "install --binstubs"
+ bundle! "binstubs rack"
build_gem "rack", "2.0", :to_system => true do |s|
s.executables = "rackup"
@@ -69,7 +68,7 @@ RSpec.describe "Running bin/* commands" do
gem "rack", :path => "#{lib_path("rack")}"
G
- bundle "install --binstubs"
+ bundle! "binstubs rack"
build_gem "rack", "2.0", :to_system => true do |s|
s.executables = "rackup"
@@ -79,7 +78,7 @@ RSpec.describe "Running bin/* commands" do
expect(out).to eq("1.0")
end
- it "don't bundle da bundla" do
+ it "creates a bundle binstub" do
build_gem "bundler", Bundler::VERSION, :to_system => true do |s|
s.executables = "bundle"
end
@@ -89,35 +88,35 @@ RSpec.describe "Running bin/* commands" do
gem "bundler"
G
- bundle "install --binstubs"
+ bundle! "binstubs bundler"
- expect(bundled_app("bin/bundle")).not_to exist
+ expect(bundled_app("bin/bundle")).to exist
end
it "does not generate bin stubs if the option was not specified" do
- bundle "install"
+ bundle! "install"
expect(bundled_app("bin/rackup")).not_to exist
end
- it "allows you to stop installing binstubs" do
- bundle "install --binstubs bin/"
+ it "allows you to stop installing binstubs", :bundler => "< 2" do
+ bundle! "install --binstubs bin/"
bundled_app("bin/rackup").rmtree
- bundle "install --binstubs \"\""
+ bundle! "install --binstubs \"\""
expect(bundled_app("bin/rackup")).not_to exist
- bundle "config bin"
+ bundle! "config bin"
expect(out).to include("You have not configured a value for `bin`")
end
- it "remembers that the option was specified" do
+ it "remembers that the option was specified", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "activesupport"
G
- bundle "install --binstubs"
+ bundle! :install, forgotten_command_line_options([:binstubs, :bin] => "bin")
gemfile <<-G
source "file://#{gem_repo1}"
@@ -130,13 +129,13 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/rackup")).to exist
end
- it "rewrites bins on --binstubs (to maintain backwards compatibility)" do
+ it "rewrites bins on --binstubs (to maintain backwards compatibility)", :bundler => "< 2" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
G
- bundle "install --binstubs bin/"
+ bundle! :install, forgotten_command_line_options([:binstubs, :bin] => "bin")
File.open(bundled_app("bin/rackup"), "wb") do |file|
file.print "OMG"
@@ -146,4 +145,17 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/rackup").read).to_not eq("OMG")
end
+
+ it "rewrites bins on binstubs (to maintain backwards compatibility)" do
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+
+ create_file("bin/rackup", "OMG")
+
+ bundle! "binstubs rack"
+
+ expect(bundled_app("bin/rackup").read).to_not eq("OMG")
+ end
end
diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb
index 7cb0f32c0c..500c3128fd 100644
--- a/spec/bundler/runtime/gem_tasks_spec.rb
+++ b/spec/bundler/runtime/gem_tasks_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "require 'bundler/gem_tasks'" do
before :each do
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index e816799d08..dcaba3ab9d 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundler/inline#gemfile" do
def script(code, options = {})
@@ -53,8 +52,9 @@ RSpec.describe "bundler/inline#gemfile" do
it "requires the gems" do
script <<-RUBY
gemfile do
- path "#{lib_path}"
- gem "two"
+ path "#{lib_path}" do
+ gem "two"
+ end
end
RUBY
@@ -63,8 +63,9 @@ RSpec.describe "bundler/inline#gemfile" do
script <<-RUBY
gemfile do
- path "#{lib_path}"
- gem "eleven"
+ path "#{lib_path}" do
+ gem "eleven"
+ end
end
puts "success"
@@ -133,8 +134,9 @@ RSpec.describe "bundler/inline#gemfile" do
require 'bundler'
options = { :ui => Bundler::UI::Shell.new }
gemfile(false, options) do
- path "#{lib_path}"
- gem "two"
+ path "#{lib_path}" do
+ gem "two"
+ end
end
puts "OKAY" if options.key?(:ui)
RUBY
@@ -262,7 +264,7 @@ RSpec.describe "bundler/inline#gemfile" do
puts RACK
RUBY
- expect(exitstatus).to eq(0) if exitstatus
- expect(out).to eq "1.0.0"
+ expect(last_command).to be_success
+ expect(last_command.stdout).to eq "1.0.0"
end
end
diff --git a/spec/bundler/runtime/load_spec.rb b/spec/bundler/runtime/load_spec.rb
index d0e308ed3e..b74dbde3f6 100644
--- a/spec/bundler/runtime/load_spec.rb
+++ b/spec/bundler/runtime/load_spec.rb
@@ -1,14 +1,9 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Bundler.load" do
- before :each do
- system_gems "rack-1.0.0"
- end
-
describe "with a gemfile" do
before(:each) do
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "rack"
G
@@ -36,6 +31,7 @@ RSpec.describe "Bundler.load" do
source "file://#{gem_repo1}"
gem "rack"
G
+ bundle! :install
end
it "provides a list of the env dependencies" do
@@ -77,13 +73,13 @@ RSpec.describe "Bundler.load" do
describe "when called twice" do
it "doesn't try to load the runtime twice" do
- system_gems "rack-1.0.0", "activesupport-2.3.5"
- gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
gem "rack"
gem "activesupport", :group => :test
G
- ruby <<-RUBY
+ ruby! <<-RUBY
require "bundler"
Bundler.setup :default
Bundler.require :default
@@ -101,8 +97,8 @@ RSpec.describe "Bundler.load" do
describe "not hurting brittle rubygems" do
it "does not inject #source into the generated YAML of the gem specs" do
- system_gems "activerecord-2.3.2", "activesupport-2.3.2"
- gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
gem "activerecord"
G
diff --git a/spec/bundler/runtime/platform_spec.rb b/spec/bundler/runtime/platform_spec.rb
index 4df934e71f..f38f733845 100644
--- a/spec/bundler/runtime/platform_spec.rb
+++ b/spec/bundler/runtime/platform_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Bundler.setup with multi platform stuff" do
it "raises a friendly error when gems are missing locally" do
@@ -33,7 +32,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
expect(out).to eq("WIN")
end
- it "will resolve correctly on the current platform when the lockfile was targetted for a different one" do
+ it "will resolve correctly on the current platform when the lockfile was targeted for a different one" do
lockfile <<-G
GEM
remote: file:#{gem_repo1}/
@@ -49,10 +48,8 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
nokogiri
G
- system_gems "nokogiri-1.4.2"
-
simulate_platform "x86-darwin-10"
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "nokogiri"
G
@@ -78,9 +75,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
simulate_platform "x86-darwin-100"
- system_gems "nokogiri-1.4.2", "platform_specific-1.0-x86-darwin-100"
-
- gemfile <<-G
+ install_gemfile! <<-G
source "file://#{gem_repo1}"
gem "nokogiri"
gem "platform_specific"
diff --git a/spec/bundler/runtime/require_spec.rb b/spec/bundler/runtime/require_spec.rb
index b68313726b..3eccd60fba 100644
--- a/spec/bundler/runtime/require_spec.rb
+++ b/spec/bundler/runtime/require_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Bundler.require" do
before :each do
@@ -47,19 +46,20 @@ RSpec.describe "Bundler.require" do
end
gemfile <<-G
- path "#{lib_path}"
- gem "one", :group => :bar, :require => %w[baz qux]
- gem "two"
- gem "three", :group => :not
- gem "four", :require => false
- gem "five"
- gem "six", :group => "string"
- gem "seven", :group => :not
- gem "eight", :require => true, :group => :require_true
- env "BUNDLER_TEST" => "nine" do
- gem "nine", :require => true
+ path "#{lib_path}" do
+ gem "one", :group => :bar, :require => %w[baz qux]
+ gem "two"
+ gem "three", :group => :not
+ gem "four", :require => false
+ gem "five"
+ gem "six", :group => "string"
+ gem "seven", :group => :not
+ gem "eight", :require => true, :group => :require_true
+ env "BUNDLER_TEST" => "nine" do
+ gem "nine", :require => true
+ end
+ gem "ten", :install_if => lambda { ENV["BUNDLER_TEST"] == "ten" }
end
- gem "ten", :install_if => lambda { ENV["BUNDLER_TEST"] == "ten" }
G
end
@@ -86,7 +86,7 @@ RSpec.describe "Bundler.require" do
# required in resolver order instead of gemfile order
run("Bundler.require(:not)")
- expect(out.split("\n").sort).to eq(%w(seven three))
+ expect(out.split("\n").sort).to eq(%w[seven three])
# test require: true
run "Bundler.require(:require_true)"
@@ -112,8 +112,9 @@ RSpec.describe "Bundler.require" do
it "raises an exception if a require is specified but the file does not exist" do
gemfile <<-G
- path "#{lib_path}"
- gem "two", :require => 'fail'
+ path "#{lib_path}" do
+ gem "two", :require => 'fail'
+ end
G
load_error_run <<-R, "fail"
@@ -129,8 +130,9 @@ RSpec.describe "Bundler.require" do
end
gemfile <<-G
- path "#{lib_path}"
- gem "faulty"
+ path "#{lib_path}" do
+ gem "faulty"
+ end
G
run "Bundler.require"
@@ -144,8 +146,9 @@ RSpec.describe "Bundler.require" do
end
gemfile <<-G
- path "#{lib_path}"
- gem "loadfuuu"
+ path "#{lib_path}" do
+ gem "loadfuuu"
+ end
G
cmd = <<-RUBY
@@ -170,8 +173,9 @@ RSpec.describe "Bundler.require" do
it "requires gem names that are namespaced" do
gemfile <<-G
- path '#{lib_path}'
- gem 'jquery-rails'
+ path '#{lib_path}' do
+ gem 'jquery-rails'
+ end
G
run "Bundler.require"
@@ -183,8 +187,9 @@ RSpec.describe "Bundler.require" do
s.write "lib/brcrypt.rb", "BCrypt = '1.0.0'"
end
gemfile <<-G
- path "#{lib_path}"
- gem "bcrypt-ruby"
+ path "#{lib_path}" do
+ gem "bcrypt-ruby"
+ end
G
cmd = <<-RUBY
@@ -198,8 +203,9 @@ RSpec.describe "Bundler.require" do
it "does not mangle explicitly given requires" do
gemfile <<-G
- path "#{lib_path}"
- gem 'jquery-rails', :require => 'jquery-rails'
+ path "#{lib_path}" do
+ gem 'jquery-rails', :require => 'jquery-rails'
+ end
G
load_error_run <<-R, "jquery-rails"
@@ -214,8 +220,9 @@ RSpec.describe "Bundler.require" do
end
gemfile <<-G
- path "#{lib_path}"
- gem "load-fuuu"
+ path "#{lib_path}" do
+ gem "load-fuuu"
+ end
G
cmd = <<-RUBY
@@ -237,8 +244,9 @@ RSpec.describe "Bundler.require" do
lib_path("load-fuuu-1.0.0/lib/load-fuuu.rb").rmtree
gemfile <<-G
- path "#{lib_path}"
- gem "load-fuuu"
+ path "#{lib_path}" do
+ gem "load-fuuu"
+ end
G
cmd = <<-RUBY
@@ -294,9 +302,10 @@ RSpec.describe "Bundler.require" do
it "works when the gems are in the Gemfile in the correct order" do
gemfile <<-G
- path "#{lib_path}"
- gem "two"
- gem "one"
+ path "#{lib_path}" do
+ gem "two"
+ gem "one"
+ end
G
run "Bundler.require"
@@ -305,7 +314,7 @@ RSpec.describe "Bundler.require" do
describe "a gem with different requires for different envs" do
before(:each) do
- build_gem "multi_gem", :to_system => true do |s|
+ build_gem "multi_gem", :to_bundle => true do |s|
s.write "lib/one.rb", "puts 'ONE'"
s.write "lib/two.rb", "puts 'TWO'"
end
@@ -334,9 +343,10 @@ RSpec.describe "Bundler.require" do
it "fails when the gems are in the Gemfile in the wrong order" do
gemfile <<-G
- path "#{lib_path}"
- gem "one"
- gem "two"
+ path "#{lib_path}" do
+ gem "one"
+ gem "two"
+ end
G
run "Bundler.require"
@@ -345,7 +355,7 @@ RSpec.describe "Bundler.require" do
describe "with busted gems" do
it "should be busted" do
- build_gem "busted_require", :to_system => true do |s|
+ build_gem "busted_require", :to_bundle => true do |s|
s.write "lib/busted_require.rb", "require 'no_such_file_omg'"
end
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb
index dc7af07188..8f6f656359 100644
--- a/spec/bundler/runtime/setup_spec.rb
+++ b/spec/bundler/runtime/setup_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Bundler.setup" do
describe "with no arguments" do
@@ -117,7 +116,7 @@ RSpec.describe "Bundler.setup" do
tmp("rubygems/lib").to_s,
root.join("../lib").expand_path.to_s,
] - without_bundler_load_path
- lp.map! {|p| p.sub(/^#{system_gem_path}/, "") }
+ lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s}/i, "") }
end
it "puts loaded gems after -I and RUBYLIB", :ruby_repo do
@@ -270,21 +269,51 @@ RSpec.describe "Bundler.setup" do
expect(bundled_app("Gemfile.lock")).to exist
end
- it "uses BUNDLE_GEMFILE to locate the gemfile if present" do
- gemfile <<-G
- source "file://#{gem_repo1}"
- gem "rack"
- G
+ describe "$BUNDLE_GEMFILE" do
+ context "user provides an absolute path" do
+ it "uses BUNDLE_GEMFILE to locate the gemfile if present" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
- gemfile bundled_app("4realz"), <<-G
- source "file://#{gem_repo1}"
- gem "activesupport", "2.3.5"
- G
+ gemfile bundled_app("4realz"), <<-G
+ source "file://#{gem_repo1}"
+ gem "activesupport", "2.3.5"
+ G
+
+ ENV["BUNDLE_GEMFILE"] = bundled_app("4realz").to_s
+ bundle :install
+
+ expect(the_bundle).to include_gems "activesupport 2.3.5"
+ end
+ end
+
+ context "an absolute path is not provided" do
+ it "uses BUNDLE_GEMFILE to locate the gemfile if present" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+ G
+
+ bundle "install"
+ bundle "install --deployment"
+
+ ENV["BUNDLE_GEMFILE"] = "Gemfile"
+ ruby <<-R
+ require 'rubygems'
+ require 'bundler'
- ENV["BUNDLE_GEMFILE"] = bundled_app("4realz").to_s
- bundle :install
+ begin
+ Bundler.setup
+ puts "WIN"
+ rescue ArgumentError => e
+ puts "FAIL"
+ end
+ R
- expect(the_bundle).to include_gems "activesupport 2.3.5"
+ expect(out).to eq("WIN")
+ end
+ end
end
it "prioritizes gems in BUNDLE_PATH over gems in GEM_HOME" do
@@ -396,9 +425,10 @@ RSpec.describe "Bundler.setup" do
end
gemfile <<-G
- path "#{lib_path("rack-1.0.0")}"
source "file://#{gem_repo1}"
- gem "rack"
+ path "#{lib_path("rack-1.0.0")}" do
+ gem "rack"
+ end
G
run "require 'rack'"
@@ -465,13 +495,13 @@ RSpec.describe "Bundler.setup" do
end
it "works even when the cache directory has been deleted" do
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
FileUtils.rm_rf vendored_gems("cache")
expect(the_bundle).to include_gems "rack 1.0.0"
end
it "does not randomly change the path when specifying --path and the bundle directory becomes read only" do
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
with_read_only("**/*") do
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -499,8 +529,7 @@ RSpec.describe "Bundler.setup" do
G
bundle %(config local.rack #{lib_path("local-rack")})
- bundle :install
- expect(out).to match(/at #{lib_path('local-rack')}/)
+ bundle! :install
FileUtils.rm_rf(lib_path("local-rack"))
run "require 'rack'"
@@ -518,8 +547,7 @@ RSpec.describe "Bundler.setup" do
G
bundle %(config local.rack #{lib_path("local-rack")})
- bundle :install
- expect(out).to match(/at #{lib_path('local-rack')}/)
+ bundle! :install
gemfile <<-G
source "file://#{gem_repo1}"
@@ -541,8 +569,7 @@ RSpec.describe "Bundler.setup" do
G
bundle %(config local.rack #{lib_path("local-rack")})
- bundle :install
- expect(out).to match(/at #{lib_path('local-rack')}/)
+ bundle! :install
gemfile <<-G
source "file://#{gem_repo1}"
@@ -576,7 +603,7 @@ RSpec.describe "Bundler.setup" do
describe "when excluding groups" do
it "doesn't change the resolve if --without is used" do
- install_gemfile <<-G, :without => :rails
+ install_gemfile <<-G, forgotten_command_line_options(:without => :rails)
source "file://#{gem_repo1}"
gem "activesupport"
@@ -591,7 +618,7 @@ RSpec.describe "Bundler.setup" do
end
it "remembers --without and does not bail on bare Bundler.setup" do
- install_gemfile <<-G, :without => :rails
+ install_gemfile <<-G, forgotten_command_line_options(:without => :rails)
source "file://#{gem_repo1}"
gem "activesupport"
@@ -606,7 +633,7 @@ RSpec.describe "Bundler.setup" do
end
it "remembers --without and does not include groups passed to Bundler.setup" do
- install_gemfile <<-G, :without => :rails
+ install_gemfile <<-G, forgotten_command_line_options(:without => :rails)
source "file://#{gem_repo1}"
gem "activesupport"
@@ -680,7 +707,7 @@ RSpec.describe "Bundler.setup" do
end
end
- # Rubygems returns loaded_from as a string
+ # RubyGems returns loaded_from as a string
it "has loaded_from as a string on all specs" do
build_git "foo"
build_git "no-gemspec", :gemspec => false
@@ -741,12 +768,50 @@ end
expect(err).to lack_errors
end
+ describe "$MANPATH" do
+ before do
+ build_repo4 do
+ build_gem "with_man" do |s|
+ s.write("man/man1/page.1", "MANPAGE")
+ end
+ end
+ end
+
+ context "when the user has one set" do
+ before { ENV["MANPATH"] = "/foo:" }
+
+ it "adds the gem's man dir to the MANPATH" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gem "with_man"
+ G
+
+ run! "puts ENV['MANPATH']"
+ expect(out).to eq("#{default_bundle_path("gems/with_man-1.0/man")}:/foo")
+ end
+ end
+
+ context "when the user does not have one set" do
+ before { ENV.delete("MANPATH") }
+
+ it "adds the gem's man dir to the MANPATH" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gem "with_man"
+ G
+
+ run! "puts ENV['MANPATH']"
+ expect(out).to eq(default_bundle_path("gems/with_man-1.0/man").to_s)
+ end
+ end
+ end
+
it "should prepend gemspec require paths to $LOAD_PATH in order" do
update_repo2 do
build_gem("requirepaths") do |s|
s.write("lib/rq.rb", "puts 'yay'")
s.write("src/rq.rb", "puts 'nooo'")
- s.require_paths = %w(lib src)
+ s.require_paths = %w[lib src]
end
end
@@ -930,6 +995,7 @@ end
describe "with system gems in the bundle" do
before :each do
+ bundle! "config path.system true"
system_gems "rack-1.0.0"
install_gemfile <<-G
@@ -943,7 +1009,6 @@ end
run "puts Gem.path"
paths = out.split("\n")
expect(paths).to include(system_gem_path.to_s)
- expect(paths).to include(default_bundle_path.to_s)
end
end
@@ -1027,7 +1092,7 @@ end
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -1085,7 +1150,7 @@ end
rack (1.0.0)
PLATFORMS
- #{generic_local_platform}
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -1166,11 +1231,11 @@ end
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new("2.7") || ENV["RGV"] == "master"
[]
else
- %w(io-console openssl)
+ %w[io-console openssl]
end << "bundler"
end
- let(:code) { strip_whitespace(<<-RUBY) }
+ let(:activation_warning_hack) { strip_whitespace(<<-RUBY) }
require "rubygems"
if Gem::Specification.instance_methods.map(&:to_sym).include?(:activate)
@@ -1185,7 +1250,14 @@ end
bundler_spec_activate
end
end
+ RUBY
+
+ let(:activation_warning_hack_rubyopt) do
+ create_file("activation_warning_hack.rb", activation_warning_hack)
+ "-r#{bundled_app("activation_warning_hack.rb")} #{ENV["RUBYOPT"]}"
+ end
+ let(:code) { strip_whitespace(<<-RUBY) }
require "bundler/setup"
require "pp"
loaded_specs = Gem.loaded_specs.dup
@@ -1201,17 +1273,15 @@ end
it "activates no gems with -rbundler/setup" do
install_gemfile! ""
- ruby!(code)
- expect(err).to eq("")
- expect(out).to eq("{}")
+ ruby! code, :env => { :RUBYOPT => activation_warning_hack_rubyopt }
+ expect(last_command.stdout).to eq("{}")
end
it "activates no gems with bundle exec" do
install_gemfile! ""
create_file("script.rb", code)
- bundle! "exec ruby ./script.rb"
- expect(err).to eq("")
- expect(out).to eq("{}")
+ bundle! "exec ruby ./script.rb", :env => { :RUBYOPT => activation_warning_hack_rubyopt }
+ expect(last_command.stdout).to eq("{}")
end
it "activates no gems with bundle exec that is loaded" do
@@ -1221,9 +1291,8 @@ end
install_gemfile! ""
create_file("script.rb", "#!/usr/bin/env ruby\n\n#{code}")
FileUtils.chmod(0o777, bundled_app("script.rb"))
- bundle! "exec ./script.rb", :artifice => nil
- expect(err).to eq("")
- expect(out).to eq("{}")
+ bundle! "exec ./script.rb", :artifice => nil, :env => { :RUBYOPT => activation_warning_hack_rubyopt }
+ expect(last_command.stdout).to eq("{}")
end
let(:default_gems) do
@@ -1241,6 +1310,8 @@ end
end
end
+ default_gems.reject! {|g| exemptions.include?(g) }
+
install_gemfile! <<-G
source "file:#{gem_repo4}"
#{default_gems}.each do |g|
@@ -1273,17 +1344,51 @@ end
end
describe "after setup" do
- it "allows calling #gem on random objects" do
+ it "allows calling #gem on random objects", :bundler => "< 2" do
install_gemfile <<-G
source "file:#{gem_repo1}"
gem "rack"
G
+
ruby! <<-RUBY
require "bundler/setup"
Object.new.gem "rack"
puts Gem.loaded_specs["rack"].full_name
RUBY
+
expect(out).to eq("rack-1.0.0")
end
+
+ it "keeps Kernel#gem private", :bundler => "2" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
+ gem "rack"
+ G
+
+ ruby <<-RUBY
+ require "bundler/setup"
+ Object.new.gem "rack"
+ puts "FAIL"
+ RUBY
+
+ expect(last_command.stdboth).not_to include "FAIL"
+ expect(last_command.stderr).to include "private method `gem'"
+ end
+
+ it "keeps Kernel#require private" do
+ install_gemfile! <<-G
+ source "file:#{gem_repo1}"
+ gem "rack"
+ G
+
+ ruby <<-RUBY
+ require "bundler/setup"
+ Object.new.require "rack"
+ puts "FAIL"
+ RUBY
+
+ expect(last_command.stdboth).not_to include "FAIL"
+ expect(last_command.stderr).to include "private method `require'"
+ end
end
end
diff --git a/spec/bundler/runtime/with_clean_env_spec.rb b/spec/bundler/runtime/with_clean_env_spec.rb
index d18a0de485..55e45460db 100644
--- a/spec/bundler/runtime/with_clean_env_spec.rb
+++ b/spec/bundler/runtime/with_clean_env_spec.rb
@@ -1,18 +1,18 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "Bundler.with_env helpers" do
describe "Bundler.original_env" do
before do
+ bundle "config path vendor/bundle"
gemfile ""
- bundle "install --path vendor/bundle"
+ bundle "install"
end
it "should return the PATH present before bundle was activated", :ruby_repo do
code = "print Bundler.original_env['PATH']"
path = `getconf PATH`.strip + "#{File::PATH_SEPARATOR}/foo"
with_path_as(path) do
- result = bundle("exec ruby -e #{code.dump}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.dump}")
expect(result).to eq(path)
end
end
@@ -21,7 +21,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "print Bundler.original_env['GEM_PATH']"
gem_path = ENV["GEM_PATH"] + ":/foo"
with_gem_path_as(gem_path) do
- result = bundle("exec ruby -e #{code.inspect}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).to eq(gem_path)
end
end
@@ -34,11 +34,11 @@ RSpec.describe "Bundler.with_env helpers" do
if count == 2
ENV["PATH"] = "#{ENV["PATH"]}:/foo"
end
- exec("ruby", __FILE__, (count - 1).to_s)
+ exec(Gem.ruby, __FILE__, (count - 1).to_s)
RB
path = `getconf PATH`.strip + File::PATH_SEPARATOR + File.dirname(Gem.ruby)
with_path_as(path) do
- bundle!("exec ruby #{bundled_app("exe.rb")} 2")
+ bundle!("exec '#{Gem.ruby}' #{bundled_app("exe.rb")} 2")
end
expect(err).to eq <<-EOS.strip
2 false
@@ -46,25 +46,34 @@ RSpec.describe "Bundler.with_env helpers" do
0 true
EOS
end
+
+ it "removes variables that bundler added", :ruby_repo do
+ system_gems :bundler
+ original = ruby!('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")')
+ code = 'puts Bundler.original_env.to_a.map {|e| e.join("=") }.sort.join("\n")'
+ bundle!("exec '#{Gem.ruby}' -e #{code.inspect}", :system_bundler => true)
+ expect(out).to eq original
+ end
end
- describe "Bundler.clean_env" do
+ describe "Bundler.clean_env", :bundler => "< 2" do
before do
+ bundle "config path vendor/bundle"
gemfile ""
- bundle "install --path vendor/bundle"
+ bundle "install"
end
it "should delete BUNDLE_PATH" do
code = "print Bundler.clean_env.has_key?('BUNDLE_PATH')"
ENV["BUNDLE_PATH"] = "./foo"
- result = bundle("exec ruby -e #{code.inspect}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).to eq("false")
end
it "should remove '-rbundler/setup' from RUBYOPT" do
code = "print Bundler.clean_env['RUBYOPT']"
ENV["RUBYOPT"] = "-W2 -rbundler/setup"
- result = bundle("exec ruby -e #{code.inspect}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).not_to include("-rbundler/setup")
end
@@ -79,7 +88,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "print Bundler.clean_env['MANPATH']"
ENV["MANPATH"] = "/foo"
ENV["BUNDLER_ORIG_MANPATH"] = "/foo-original"
- result = bundle("exec ruby -e #{code.inspect}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).to eq("/foo-original")
end
end
@@ -100,7 +109,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
end
- describe "Bundler.with_clean_env" do
+ describe "Bundler.with_clean_env", :bundler => "< 2" do
it "should set ENV to clean_env in the block" do
expected = Bundler.clean_env
actual = Bundler.with_clean_env { ENV.to_hash }
@@ -116,14 +125,14 @@ RSpec.describe "Bundler.with_env helpers" do
end
end
- describe "Bundler.clean_system", :ruby => ">= 1.9" do
+ describe "Bundler.clean_system", :ruby => ">= 1.9", :bundler => "< 2" do
it "runs system inside with_clean_env" do
Bundler.clean_system(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))
expect($?.exitstatus).to eq(42)
end
end
- describe "Bundler.clean_exec", :ruby => ">= 1.9" do
+ describe "Bundler.clean_exec", :ruby => ">= 1.9", :bundler => "< 2" do
it "runs exec inside with_clean_env" do
pid = Kernel.fork do
Bundler.clean_exec(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))
diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb
index 7293f0e57b..cd87a65d54 100644
--- a/spec/bundler/spec_helper.rb
+++ b/spec/bundler/spec_helper.rb
@@ -1,19 +1,21 @@
# frozen_string_literal: true
+
$:.unshift File.expand_path("..", __FILE__)
$:.unshift File.expand_path("../../lib", __FILE__)
+require "rubygems"
require "bundler/psyched_yaml"
-require "fileutils"
+require "bundler/vendored_fileutils"
require "uri"
-require "digest/sha1"
+require "digest"
require File.expand_path("../support/path.rb", __FILE__)
begin
- require "rubygems"
spec = Gem::Specification.load(Spec::Path.gemspec.to_s)
rspec = spec.dependencies.find {|d| d.name == "rspec" }
gem "rspec", rspec.requirement.to_s
require "rspec"
+ require "diff/lcs"
rescue LoadError
abort "Run rake spec:deps to install development dependencies"
end
@@ -36,16 +38,17 @@ else
end
Dir["#{File.expand_path("../support", __FILE__)}/*.rb"].each do |file|
+ file = file.gsub(%r{\A#{Regexp.escape File.expand_path("..", __FILE__)}/}, "")
require file unless file.end_with?("hax.rb")
end
$debug = false
+Spec::Manpages.setup
Spec::Rubygems.setup
FileUtils.rm_rf(Spec::Path.gem_repo1)
ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec_dir}/support/hax.rb"
ENV["BUNDLE_SPEC_RUN"] = "true"
-ENV["BUNDLE_PLUGINS"] = "true"
# Don't wrap output in tests
ENV["THOR_COLUMNS"] = "10000"
@@ -78,7 +81,7 @@ RSpec.configure do |config|
# once we have a large number of failures (indicative of core pieces of
# bundler being broken) so that running the full test suite doesn't take
# forever due to memory constraints
- config.fail_fast ||= 25
+ config.fail_fast ||= 25 if ENV["CI"]
if ENV["BUNDLER_SUDO_TESTS"] && Spec::Sudo.present?
config.filter_run :sudo => true
@@ -98,49 +101,41 @@ RSpec.configure do |config|
config.filter_run_excluding :rubygems => LessThanProc.with(Gem::VERSION)
config.filter_run_excluding :git => LessThanProc.with(git_version)
config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master")
+ config.filter_run_excluding :bundler => LessThanProc.with(Bundler::VERSION.split(".")[0, 2].join("."))
config.filter_run_excluding :ruby_repo => !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
config.filter_run_when_matching :focus unless ENV["CI"]
original_wd = Dir.pwd
- original_env = ENV.to_hash
+ original_env = ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) }
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.before :suite do
- @orig_ruby = if ENV['BUNDLE_RUBY']
- ruby = Gem.ruby
- Gem.ruby = ENV['BUNDLE_RUBY']
- ruby
- end
+ if ENV['BUNDLE_RUBY']
+ @orig_ruby = Gem.ruby
+ Gem.ruby = ENV['BUNDLE_RUBY']
+ end
end
config.before :all do
build_repo1
- # HACK: necessary until rspec-mocks > 3.5.0 is used
- # see https://github.com/bundler/bundler/pull/5363#issuecomment-278089256
- if RUBY_VERSION < "1.9"
- FileUtils.module_eval do
- alias_method :mkpath, :mkdir_p
- module_function :mkpath
- end
- end
end
config.before :each do
reset!
system_gems []
in_app_root
- @all_output = String.new
+ @command_executions = []
end
config.after :each do |example|
- @all_output.strip!
- if example.exception && !@all_output.empty?
- warn @all_output unless config.formatters.grep(RSpec::Core::Formatters::DocumentationFormatter).empty?
- message = example.exception.message + "\n\nCommands:\n#{@all_output}"
+ all_output = @command_executions.map(&:to_s_verbose).join("\n\n")
+ if example.exception && !all_output.empty?
+ warn all_output unless config.formatters.grep(RSpec::Core::Formatters::DocumentationFormatter).empty?
+ message = example.exception.message + "\n\nCommands:\n#{all_output}"
(class << example.exception; self; end).send(:define_method, :message) do
message
end
@@ -151,6 +146,8 @@ RSpec.configure do |config|
end
config.after :suite do
- Gem.ruby = @orig_ruby
+ if ENV['BUNDLE_RUBY']
+ Gem.ruby = @orig_ruby
+ end
end
end
diff --git a/spec/bundler/support/artifice/compact_index.rb b/spec/bundler/support/artifice/compact_index.rb
index 9111ed8211..123efe3c58 100644
--- a/spec/bundler/support/artifice/compact_index.rb
+++ b/spec/bundler/support/artifice/compact_index.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
$LOAD_PATH.unshift Dir[base_system_gems.join("gems/compact_index*/lib")].first.to_s
@@ -14,7 +15,7 @@ class CompactIndexAPI < Endpoint
def etag_response
response_body = yield
- checksum = Digest::MD5.hexdigest(response_body)
+ checksum = Digest(:MD5).hexdigest(response_body)
return if not_modified?(checksum)
headers "ETag" => quote(checksum)
headers "Surrogate-Control" => "max-age=2592000, stale-while-revalidate=60"
@@ -67,7 +68,7 @@ class CompactIndexAPI < Endpoint
@gems ||= {}
@gems[gem_repo] ||= begin
specs = Bundler::Deprecate.skip_during do
- %w(specs.4.8 prerelease_specs.4.8).map do |filename|
+ %w[specs.4.8 prerelease_specs.4.8].map do |filename|
Marshal.load(File.open(gem_repo.join(filename)).read).map do |name, version, platform|
load_spec(name, version, platform, gem_repo)
end
diff --git a/spec/bundler/support/artifice/compact_index_api_missing.rb b/spec/bundler/support/artifice/compact_index_api_missing.rb
index 6d15b54b85..d4e68c38e8 100644
--- a/spec/bundler/support/artifice/compact_index_api_missing.rb
+++ b/spec/bundler/support/artifice/compact_index_api_missing.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_basic_authentication.rb b/spec/bundler/support/artifice/compact_index_basic_authentication.rb
index bffb5b9e2b..97aa6cbd84 100644
--- a/spec/bundler/support/artifice/compact_index_basic_authentication.rb
+++ b/spec/bundler/support/artifice/compact_index_basic_authentication.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_checksum_mismatch.rb b/spec/bundler/support/artifice/compact_index_checksum_mismatch.rb
index 4ac328736c..62feb9f164 100644
--- a/spec/bundler/support/artifice/compact_index_checksum_mismatch.rb
+++ b/spec/bundler/support/artifice/compact_index_checksum_mismatch.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_concurrent_download.rb b/spec/bundler/support/artifice/compact_index_concurrent_download.rb
index b788a852cf..972ecb88b7 100644
--- a/spec/bundler/support/artifice/compact_index_concurrent_download.rb
+++ b/spec/bundler/support/artifice/compact_index_concurrent_download.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_creds_diff_host.rb b/spec/bundler/support/artifice/compact_index_creds_diff_host.rb
index 0c417f0580..0d349bcc1e 100644
--- a/spec/bundler/support/artifice/compact_index_creds_diff_host.rb
+++ b/spec/bundler/support/artifice/compact_index_creds_diff_host.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
@@ -10,7 +11,7 @@ class CompactIndexCredsDiffHost < CompactIndexAPI
end
def authorized?
- auth.provided? && auth.basic? && auth.credentials && auth.credentials == %w(user pass)
+ auth.provided? && auth.basic? && auth.credentials && auth.credentials == %w[user pass]
end
def protected!
diff --git a/spec/bundler/support/artifice/compact_index_extra.rb b/spec/bundler/support/artifice/compact_index_extra.rb
index 8a87fc4343..84d1859235 100644
--- a/spec/bundler/support/artifice/compact_index_extra.rb
+++ b/spec/bundler/support/artifice/compact_index_extra.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_extra_api.rb b/spec/bundler/support/artifice/compact_index_extra_api.rb
index 844a9ca9f2..903aa900fb 100644
--- a/spec/bundler/support/artifice/compact_index_extra_api.rb
+++ b/spec/bundler/support/artifice/compact_index_extra_api.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_extra_api_missing.rb b/spec/bundler/support/artifice/compact_index_extra_api_missing.rb
new file mode 100644
index 0000000000..e72040f604
--- /dev/null
+++ b/spec/bundler/support/artifice/compact_index_extra_api_missing.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require File.expand_path("../compact_index_extra_api", __FILE__)
+
+Artifice.deactivate
+
+class CompactIndexExtraAPIMissing < CompactIndexExtraApi
+ get "/extra/fetch/actual/gem/:id" do
+ if params[:id] == "missing-1.0.gemspec.rz"
+ halt 404
+ else
+ File.read("#{gem_repo2}/quick/Marshal.4.8/#{params[:id]}")
+ end
+ end
+end
+
+Artifice.activate_with(CompactIndexExtraAPIMissing)
diff --git a/spec/bundler/support/artifice/compact_index_extra_missing.rb b/spec/bundler/support/artifice/compact_index_extra_missing.rb
index 2af5ce9c27..67a9d23691 100644
--- a/spec/bundler/support/artifice/compact_index_extra_missing.rb
+++ b/spec/bundler/support/artifice/compact_index_extra_missing.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index_extra", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_forbidden.rb b/spec/bundler/support/artifice/compact_index_forbidden.rb
index b25eea94e7..0a4dfdb2e8 100644
--- a/spec/bundler/support/artifice/compact_index_forbidden.rb
+++ b/spec/bundler/support/artifice/compact_index_forbidden.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_host_redirect.rb b/spec/bundler/support/artifice/compact_index_host_redirect.rb
index 6c1ab2def6..ab371117de 100644
--- a/spec/bundler/support/artifice/compact_index_host_redirect.rb
+++ b/spec/bundler/support/artifice/compact_index_host_redirect.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_no_gem.rb b/spec/bundler/support/artifice/compact_index_no_gem.rb
new file mode 100644
index 0000000000..01c5be1b3d
--- /dev/null
+++ b/spec/bundler/support/artifice/compact_index_no_gem.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require File.expand_path("../compact_index", __FILE__)
+
+Artifice.deactivate
+
+class CompactIndexNoGem < CompactIndexAPI
+ get "/gems/:id" do
+ halt 500
+ end
+end
+
+Artifice.activate_with(CompactIndexNoGem)
diff --git a/spec/bundler/support/artifice/compact_index_partial_update.rb b/spec/bundler/support/artifice/compact_index_partial_update.rb
index bf6feab877..eaedff5105 100644
--- a/spec/bundler/support/artifice/compact_index_partial_update.rb
+++ b/spec/bundler/support/artifice/compact_index_partial_update.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_redirects.rb b/spec/bundler/support/artifice/compact_index_redirects.rb
index ff1d3e43bc..e83451b5b6 100644
--- a/spec/bundler/support/artifice/compact_index_redirects.rb
+++ b/spec/bundler/support/artifice/compact_index_redirects.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb b/spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb
index 49a072d2b9..abbf3258e7 100644
--- a/spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb
+++ b/spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_wrong_dependencies.rb b/spec/bundler/support/artifice/compact_index_wrong_dependencies.rb
index 25935f5e5d..7e1d3686e2 100644
--- a/spec/bundler/support/artifice/compact_index_wrong_dependencies.rb
+++ b/spec/bundler/support/artifice/compact_index_wrong_dependencies.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb b/spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb
index 3a12a59ae7..db4d8e3974 100644
--- a/spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb
+++ b/spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb b/spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb
index f1f8dc5700..12a6fa153f 100644
--- a/spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb
+++ b/spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint_marshal_fail", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint.rb b/spec/bundler/support/artifice/endpoint.rb
index 771d431f22..9afecff8e6 100644
--- a/spec/bundler/support/artifice/endpoint.rb
+++ b/spec/bundler/support/artifice/endpoint.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../../path.rb", __FILE__)
require Spec::Path.root.join("lib/bundler/deprecate")
include Spec::Path
@@ -7,11 +8,37 @@ $LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,rack,ti
require "artifice"
require "sinatra/base"
+ALL_REQUESTS = [] # rubocop:disable Style/MutableConstant
+ALL_REQUESTS_MUTEX = Mutex.new
+
+at_exit do
+ if expected = ENV["BUNDLER_SPEC_ALL_REQUESTS"]
+ expected = expected.split("\n").sort
+ actual = ALL_REQUESTS.sort
+
+ unless expected == actual
+ raise "Unexpected requests!\nExpected:\n\t#{expected.join("\n\t")}\n\nActual:\n\t#{actual.join("\n\t")}"
+ end
+ end
+end
+
class Endpoint < Sinatra::Base
+ def self.all_requests
+ @all_requests ||= []
+ end
+
GEM_REPO = Pathname.new(ENV["BUNDLER_SPEC_GEM_REPO"] || Spec::Path.gem_repo1)
set :raise_errors, true
set :show_exceptions, false
+ def call!(*)
+ super.tap do
+ ALL_REQUESTS_MUTEX.synchronize do
+ ALL_REQUESTS << @request.url
+ end
+ end
+ end
+
helpers do
def dependencies_for(gem_names, gem_repo = GEM_REPO)
return [] if gem_names.nil? || gem_names.empty?
@@ -19,7 +46,7 @@ class Endpoint < Sinatra::Base
require "rubygems"
require "bundler"
Bundler::Deprecate.skip_during do
- all_specs = %w(specs.4.8 prerelease_specs.4.8).map do |filename|
+ all_specs = %w[specs.4.8 prerelease_specs.4.8].map do |filename|
Marshal.load(File.open(gem_repo.join(filename)).read)
end.inject(:+)
diff --git a/spec/bundler/support/artifice/endpoint_500.rb b/spec/bundler/support/artifice/endpoint_500.rb
index 993630b79e..202ccfc829 100644
--- a/spec/bundler/support/artifice/endpoint_500.rb
+++ b/spec/bundler/support/artifice/endpoint_500.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../../path.rb", __FILE__)
include Spec::Path
diff --git a/spec/bundler/support/artifice/endpoint_api_forbidden.rb b/spec/bundler/support/artifice/endpoint_api_forbidden.rb
index 21ad9117ed..bb89747adc 100644
--- a/spec/bundler/support/artifice/endpoint_api_forbidden.rb
+++ b/spec/bundler/support/artifice/endpoint_api_forbidden.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_api_missing.rb b/spec/bundler/support/artifice/endpoint_api_missing.rb
index 6f5b5f1323..95db8e2a7e 100644
--- a/spec/bundler/support/artifice/endpoint_api_missing.rb
+++ b/spec/bundler/support/artifice/endpoint_api_missing.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_basic_authentication.rb b/spec/bundler/support/artifice/endpoint_basic_authentication.rb
index 9fafd51a3d..223671bc29 100644
--- a/spec/bundler/support/artifice/endpoint_basic_authentication.rb
+++ b/spec/bundler/support/artifice/endpoint_basic_authentication.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_creds_diff_host.rb b/spec/bundler/support/artifice/endpoint_creds_diff_host.rb
index cd152848fe..925954b12d 100644
--- a/spec/bundler/support/artifice/endpoint_creds_diff_host.rb
+++ b/spec/bundler/support/artifice/endpoint_creds_diff_host.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
@@ -10,7 +11,7 @@ class EndpointCredsDiffHost < Endpoint
end
def authorized?
- auth.provided? && auth.basic? && auth.credentials && auth.credentials == %w(user pass)
+ auth.provided? && auth.basic? && auth.credentials && auth.credentials == %w[user pass]
end
def protected!
diff --git a/spec/bundler/support/artifice/endpoint_extra.rb b/spec/bundler/support/artifice/endpoint_extra.rb
index ed4e87e65f..422f65401b 100644
--- a/spec/bundler/support/artifice/endpoint_extra.rb
+++ b/spec/bundler/support/artifice/endpoint_extra.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_extra_api.rb b/spec/bundler/support/artifice/endpoint_extra_api.rb
index 1e9e1dc60d..62e2c2bb93 100644
--- a/spec/bundler/support/artifice/endpoint_extra_api.rb
+++ b/spec/bundler/support/artifice/endpoint_extra_api.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_extra_missing.rb b/spec/bundler/support/artifice/endpoint_extra_missing.rb
index dc79705a26..038a12610a 100644
--- a/spec/bundler/support/artifice/endpoint_extra_missing.rb
+++ b/spec/bundler/support/artifice/endpoint_extra_missing.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint_extra", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_fallback.rb b/spec/bundler/support/artifice/endpoint_fallback.rb
index 8a85a41784..554c08f0a2 100644
--- a/spec/bundler/support/artifice/endpoint_fallback.rb
+++ b/spec/bundler/support/artifice/endpoint_fallback.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_host_redirect.rb b/spec/bundler/support/artifice/endpoint_host_redirect.rb
index 250416d8cc..cda5664be2 100644
--- a/spec/bundler/support/artifice/endpoint_host_redirect.rb
+++ b/spec/bundler/support/artifice/endpoint_host_redirect.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_marshal_fail.rb b/spec/bundler/support/artifice/endpoint_marshal_fail.rb
index 0fb75ebf31..2a5dcdc2fd 100644
--- a/spec/bundler/support/artifice/endpoint_marshal_fail.rb
+++ b/spec/bundler/support/artifice/endpoint_marshal_fail.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint_fallback", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_mirror_source.rb b/spec/bundler/support/artifice/endpoint_mirror_source.rb
index 9fb58ecb29..64452f198d 100644
--- a/spec/bundler/support/artifice/endpoint_mirror_source.rb
+++ b/spec/bundler/support/artifice/endpoint_mirror_source.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
class EndpointMirrorSource < Endpoint
diff --git a/spec/bundler/support/artifice/endpoint_redirect.rb b/spec/bundler/support/artifice/endpoint_redirect.rb
index f80d7600c2..ebf01458ba 100644
--- a/spec/bundler/support/artifice/endpoint_redirect.rb
+++ b/spec/bundler/support/artifice/endpoint_redirect.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb b/spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb
index 4b32cbbf5b..905a519f3f 100644
--- a/spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb
+++ b/spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint", __FILE__)
Artifice.deactivate
diff --git a/spec/bundler/support/artifice/endpoint_timeout.rb b/spec/bundler/support/artifice/endpoint_timeout.rb
index b15650f226..3f60471c90 100644
--- a/spec/bundler/support/artifice/endpoint_timeout.rb
+++ b/spec/bundler/support/artifice/endpoint_timeout.rb
@@ -1,10 +1,11 @@
# frozen_string_literal: true
+
require File.expand_path("../endpoint_fallback", __FILE__)
Artifice.deactivate
class EndpointTimeout < EndpointFallback
- SLEEP_TIMEOUT = 15
+ SLEEP_TIMEOUT = 3
get "/api/v1/dependencies" do
sleep(SLEEP_TIMEOUT)
diff --git a/spec/bundler/support/artifice/vcr.rb b/spec/bundler/support/artifice/vcr.rb
new file mode 100644
index 0000000000..edd2f49a91
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr.rb
@@ -0,0 +1,158 @@
+# frozen_string_literal: true
+
+require "net/http"
+if RUBY_VERSION < "1.9"
+ begin
+ require "net/https"
+ rescue LoadError
+ nil # net/https or openssl
+ end
+end # but only for 1.8
+
+CASSETTE_PATH = File.expand_path("../vcr_cassettes", __FILE__)
+CASSETTE_NAME = ENV.fetch("BUNDLER_SPEC_VCR_CASSETTE_NAME") { "realworld" }
+
+class BundlerVCRHTTP < Net::HTTP
+ class RequestHandler
+ attr_reader :http, :request, :body, :response_block
+ def initialize(http, request, body = nil, &response_block)
+ @http = http
+ @request = request
+ @body = body
+ @response_block = response_block
+ end
+
+ def handle_request
+ handler = self
+ request.instance_eval do
+ @__vcr_request_handler = handler
+ end
+
+ if recorded_response?
+ recorded_response
+ else
+ record_response
+ end
+ end
+
+ def recorded_response?
+ return true if ENV["BUNDLER_SPEC_PRE_RECORDED"]
+ return false if ENV["BUNDLER_SPEC_FORCE_RECORD"]
+ request_pair_paths.all? {|f| File.exist?(f) }
+ end
+
+ def recorded_response
+ File.open(request_pair_paths.last, "rb:ASCII-8BIT") do |response_file|
+ response_io = ::Net::BufferedIO.new(response_file)
+ ::Net::HTTPResponse.read_new(response_io).tap do |response|
+ response.decode_content = request.decode_content if request.respond_to?(:decode_content)
+ response.uri = request.uri if request.respond_to?(:uri)
+
+ response.reading_body(response_io, request.response_body_permitted?) do
+ response_block.call(response) if response_block
+ end
+ end
+ end
+ end
+
+ def record_response
+ request_path, response_path = *request_pair_paths
+
+ @recording = true
+
+ response = http.request_without_vcr(request, body, &response_block)
+ @recording = false
+ unless @recording
+ FileUtils.mkdir_p(File.dirname(request_path))
+ binwrite(request_path, request_to_string(request))
+ binwrite(response_path, response_to_string(response))
+ end
+ response
+ end
+
+ def key
+ [request["host"] || http.address, request.path, request.method].compact
+ end
+
+ def file_name_for_key(key)
+ key.join("/").gsub(/[\:*?"<>|]/, "-")
+ end
+
+ def request_pair_paths
+ %w[request response].map do |kind|
+ File.join(CASSETTE_PATH, CASSETTE_NAME, file_name_for_key(key + [kind]))
+ end
+ end
+
+ def read_stored_request(path)
+ contents = File.read(path)
+ headers = {}
+ method = nil
+ path = nil
+ contents.lines.grep(/^> /).each do |line|
+ if line =~ /^> (GET|HEAD|POST|PATCH|PUT|DELETE) (.*)/
+ method = $1
+ path = $2.strip
+ elsif line =~ /^> (.*?): (.*)/
+ headers[$1] = $2
+ end
+ end
+ body = contents =~ /^([^>].*)/m && $1
+ Net::HTTP.const_get(method.capitalize).new(path, headers).tap {|r| r.body = body if body }
+ end
+
+ def request_to_string(request)
+ request_string = []
+ request_string << "> #{request.method.upcase} #{request.path}"
+ request.to_hash.each do |key, value|
+ request_string << "> #{key}: #{Array(value).first}"
+ end
+ request << "" << request.body if request.body
+ request_string.join("\n")
+ end
+
+ def response_to_string(response)
+ headers = response.to_hash
+ body = response.body
+
+ response_string = []
+ response_string << "HTTP/1.1 #{response.code} #{response.message}"
+
+ headers["content-length"] = [body.bytesize.to_s] if body
+
+ headers.each do |header, value|
+ response_string << "#{header}: #{value.join(", ")}"
+ end
+
+ response_string << "" << body
+
+ response_string = response_string.join("\n")
+ if response_string.respond_to?(:force_encoding)
+ response_string.force_encoding("ASCII-8BIT")
+ else
+ response_string
+ end
+ end
+
+ def binwrite(path, contents)
+ File.open(path, "wb:ASCII-8BIT") {|f| f.write(contents) }
+ end
+ end
+
+ def request_with_vcr(request, *args, &block)
+ handler = request.instance_eval do
+ remove_instance_variable(:@__vcr_request_handler) if defined?(@__vcr_request_handler)
+ end || RequestHandler.new(self, request, *args, &block)
+
+ handler.handle_request
+ end
+
+ alias_method :request_without_vcr, :request
+ alias_method :request, :request_with_vcr
+end
+
+# Replace Net::HTTP with our VCR subclass
+::Net.class_eval do
+ remove_const(:HTTP)
+ const_set(:HTTP, BundlerVCRHTTP)
+end
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/request
new file mode 100644
index 0000000000..00dcd51750
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/request
@@ -0,0 +1,7 @@
+> GET /api/v1/dependencies?gems=bundler
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: api.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/response
new file mode 100644
index 0000000000..2dd5aa76f8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies-gems=bundler/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/request
new file mode 100644
index 0000000000..13b3c98dd2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/request
@@ -0,0 +1,6 @@
+> HEAD /api/v1/dependencies
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: api.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/response
new file mode 100644
index 0000000000..fa6cc543da
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/api/v1/dependencies/HEAD/response
@@ -0,0 +1,24 @@
+HTTP/1.1 200 OK
+content-type: text/plain; charset=utf-8
+x-frame-options: SAMEORIGIN
+x-xss-protection: 1; mode=block
+x-content-type-options: nosniff
+content-security-policy: default-src 'self'; script-src 'self' https://secure.gaug.es; style-src 'self' https://fonts.googleapis.com; img-src 'self' https://secure.gaug.es https://gravatar.com https://secure.gravatar.com; font-src 'self' https://fonts.gstatic.com; connect-src https://s3-us-west-2.amazonaws.com/rubygems-dumps/; frame-src https://ghbtns.com
+cache-control: no-cache
+x-request-id: a7d87e66-6bb3-4b7a-9d3a-89ee68784d0e
+x-runtime: 0.003648
+x-ua-compatible: IE=Edge,chrome=1
+x-backend: F_Rails 54.186.104.15:443
+content-length: 0
+accept-ranges: bytes
+date: Fri, 28 Apr 2017 09:22:23 GMT
+via: 1.1 varnish
+age: 3103
+connection: keep-alive
+x-served-by: cache-fra1243-FRA
+x-cache: HIT
+x-cache-hits: 107
+x-timer: S1493371344.878545,VS0,VE0
+vary: Accept-Encoding,Fastly-SSL
+server: RubyGems.org
+
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/request
new file mode 100644
index 0000000000..230892854c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/bundler-1.12.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: api.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/response
new file mode 100644
index 0000000000..8f5d12c8eb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/gems/bundler-1.12.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request
new file mode 100644
index 0000000000..c9337e9a6b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request
@@ -0,0 +1,7 @@
+> GET /quick/Marshal.4.8/bundler-1.12.3.gemspec.rz
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: api.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response
new file mode 100644
index 0000000000..d6b53b54a0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/request
new file mode 100644
index 0000000000..94f2b68688
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/request
@@ -0,0 +1,7 @@
+> GET /specs.4.8.gz
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: api.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/response
new file mode 100644
index 0000000000..bd54f4d8cd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/api.rubygems.org/specs.4.8.gz/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/request
new file mode 100644
index 0000000000..a92b8bb55f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/request
@@ -0,0 +1,7 @@
+> GET /info/CFPropertyList
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/response
new file mode 100644
index 0000000000..3e4ec8fdfb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/CFPropertyList/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/request
new file mode 100644
index 0000000000..278c2103b3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ParseTree
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/response
new file mode 100644
index 0000000000..10fc08ccb2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ParseTree/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/request
new file mode 100644
index 0000000000..895b7dfd54
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/request
@@ -0,0 +1,7 @@
+> GET /info/RedCloth
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/response
new file mode 100644
index 0000000000..dac79849bf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RedCloth/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/request
new file mode 100644
index 0000000000..6bf0e6d3af
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/request
@@ -0,0 +1,7 @@
+> GET /info/RubyInline
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/response
new file mode 100644
index 0000000000..03a6377fc5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/RubyInline/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/request
new file mode 100644
index 0000000000..30a9943801
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/request
@@ -0,0 +1,7 @@
+> GET /info/SexpProcessor
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/response
new file mode 100644
index 0000000000..47e0c3e7e4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/SexpProcessor/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/request
new file mode 100644
index 0000000000..927fce847b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ZenTest
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/response
new file mode 100644
index 0000000000..669b149feb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ZenTest/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/request
new file mode 100644
index 0000000000..33ba985fc9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/request
@@ -0,0 +1,7 @@
+> GET /info/abstract
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/response
new file mode 100644
index 0000000000..1edf821062
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/abstract/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/request
new file mode 100644
index 0000000000..67f6acff19
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/request
@@ -0,0 +1,7 @@
+> GET /info/actioncable
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/response
new file mode 100644
index 0000000000..ea6d8e5c4d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actioncable/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/request
new file mode 100644
index 0000000000..ff277f113a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/request
@@ -0,0 +1,7 @@
+> GET /info/actionmailer
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/response
new file mode 100644
index 0000000000..0cdee06fda
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionmailer/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/request
new file mode 100644
index 0000000000..85c039b7eb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/request
@@ -0,0 +1,7 @@
+> GET /info/actionpack
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/response
new file mode 100644
index 0000000000..d95b8da544
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionpack/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/request
new file mode 100644
index 0000000000..8b11f69250
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/request
@@ -0,0 +1,7 @@
+> GET /info/actionview
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/response
new file mode 100644
index 0000000000..7edc784c99
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionview/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/request
new file mode 100644
index 0000000000..2ec89cf1b2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/request
@@ -0,0 +1,7 @@
+> GET /info/actionwebservice
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/response
new file mode 100644
index 0000000000..817028d7c4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/actionwebservice/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/request
new file mode 100644
index 0000000000..a215f0abf9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activejob
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/response
new file mode 100644
index 0000000000..0aa7649bd3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activejob/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/request
new file mode 100644
index 0000000000..ceae0f0950
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activemodel-globalid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/response
new file mode 100644
index 0000000000..e21616fdef
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel-globalid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/request
new file mode 100644
index 0000000000..e4b113569e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activemodel
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/response
new file mode 100644
index 0000000000..6600b05e58
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activemodel/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/request
new file mode 100644
index 0000000000..095307216d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activerecord-deprecated_finders
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/response
new file mode 100644
index 0000000000..fa5752cd5a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord-deprecated_finders/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/request
new file mode 100644
index 0000000000..72983afdb3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activerecord
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/response
new file mode 100644
index 0000000000..bff1e60a3d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activerecord/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/request
new file mode 100644
index 0000000000..6da07e07c1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activeresource
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/response
new file mode 100644
index 0000000000..eb2d07c38e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activeresource/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/request
new file mode 100644
index 0000000000..e850b19891
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/request
@@ -0,0 +1,7 @@
+> GET /info/activesupport
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/response
new file mode 100644
index 0000000000..0830e66af9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/activesupport/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/request
new file mode 100644
index 0000000000..b85f0d4abc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/request
@@ -0,0 +1,7 @@
+> GET /info/adamantium
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/response
new file mode 100644
index 0000000000..6a48c16d28
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/adamantium/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/request
new file mode 100644
index 0000000000..332d846d65
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/request
@@ -0,0 +1,7 @@
+> GET /info/addressable
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/response
new file mode 100644
index 0000000000..19a91431c8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/addressable/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/request
new file mode 100644
index 0000000000..8b0e9de941
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/request
@@ -0,0 +1,7 @@
+> GET /info/allison
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/response
new file mode 100644
index 0000000000..d3ba22327f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/allison/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/request
new file mode 100644
index 0000000000..35a798ad01
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ansi
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/response
new file mode 100644
index 0000000000..d0d16ff6dd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ansi/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/request
new file mode 100644
index 0000000000..15113c6b35
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/request
@@ -0,0 +1,7 @@
+> GET /info/archive-tar-minitar
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/response
new file mode 100644
index 0000000000..66ba424eb4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/archive-tar-minitar/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/request
new file mode 100644
index 0000000000..c8e60e5198
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/request
@@ -0,0 +1,7 @@
+> GET /info/arel
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/response
new file mode 100644
index 0000000000..71d017141e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/arel/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/request
new file mode 100644
index 0000000000..83c157b83d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ast
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/response
new file mode 100644
index 0000000000..34e8984f9c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ast/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/request
new file mode 100644
index 0000000000..eb816b9425
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/request
@@ -0,0 +1,7 @@
+> GET /info/astrolabe
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/response
new file mode 100644
index 0000000000..c608b4fcb7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/astrolabe/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/request
new file mode 100644
index 0000000000..95416a8856
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/request
@@ -0,0 +1,7 @@
+> GET /info/atomic
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/response
new file mode 100644
index 0000000000..5d99e7e614
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/atomic/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/request
new file mode 100644
index 0000000000..9a7e6768c9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/request
@@ -0,0 +1,7 @@
+> GET /info/autoparse
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/response
new file mode 100644
index 0000000000..04b544fda2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/autoparse/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/request
new file mode 100644
index 0000000000..56d2f3f4be
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/request
@@ -0,0 +1,7 @@
+> GET /info/axiom-types
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/response
new file mode 100644
index 0000000000..096e712deb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/axiom-types/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/request
new file mode 100644
index 0000000000..d39a8eefed
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/request
@@ -0,0 +1,7 @@
+> GET /info/backports
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/response
new file mode 100644
index 0000000000..b964586e01
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/backports/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/request
new file mode 100644
index 0000000000..99b3624b68
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bacon
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/response
new file mode 100644
index 0000000000..4e072946c4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bacon/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/request
new file mode 100644
index 0000000000..da2d06bb39
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bcrypt-ruby
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/response
new file mode 100644
index 0000000000..9fd73895da
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt-ruby/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/request
new file mode 100644
index 0000000000..6516d4f90d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bcrypt
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/response
new file mode 100644
index 0000000000..22f10c15a9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/request
new file mode 100644
index 0000000000..cba3167ca3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bcrypt_pbkdf
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/response
new file mode 100644
index 0000000000..52e3f662f6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bcrypt_pbkdf/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/request
new file mode 100644
index 0000000000..a42bb5fc39
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-extras
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/response
new file mode 100644
index 0000000000..17c018a8ac
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-extras/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/request
new file mode 100644
index 0000000000..f887a9d8b9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-git
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/response
new file mode 100644
index 0000000000..08fe306b65
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-git/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/request
new file mode 100644
index 0000000000..123d71230b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-rcov
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/response
new file mode 100644
index 0000000000..76b01488ea
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rcov/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/request
new file mode 100644
index 0000000000..11d8de5fd1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-rspec
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/response
new file mode 100644
index 0000000000..a82c0fc9ee
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rspec/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/request
new file mode 100644
index 0000000000..759c5dc5a7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-rubyforge
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/response
new file mode 100644
index 0000000000..685f899378
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-rubyforge/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/request
new file mode 100644
index 0000000000..ae5a9b068f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones-zentest
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/response
new file mode 100644
index 0000000000..2b69b3ed62
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones-zentest/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/request
new file mode 100644
index 0000000000..3e6d44e52f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bones
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/response
new file mode 100644
index 0000000000..6dc4b11a25
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bones/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/request
new file mode 100644
index 0000000000..5fe5431bfa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/request
@@ -0,0 +1,7 @@
+> GET /info/builder
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/response
new file mode 100644
index 0000000000..bd2e97ab92
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/builder/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/request
new file mode 100644
index 0000000000..d0af347d8a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/request
@@ -0,0 +1,7 @@
+> GET /info/bundler
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/response
new file mode 100644
index 0000000000..41da082444
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/bundler/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/request
new file mode 100644
index 0000000000..d40975748c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/request
@@ -0,0 +1,7 @@
+> GET /info/camping
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/response
new file mode 100644
index 0000000000..c9a4dbcbc1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/camping/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/request
new file mode 100644
index 0000000000..4e852e84e4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/request
@@ -0,0 +1,7 @@
+> GET /info/capybara
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/response
new file mode 100644
index 0000000000..9afec9a3a6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/capybara/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/request
new file mode 100644
index 0000000000..8ae268566f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celerity
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/response
new file mode 100644
index 0000000000..585c893662
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celerity/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/request
new file mode 100644
index 0000000000..caa2b64772
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-essentials
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/response
new file mode 100644
index 0000000000..33973fc9d1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-essentials/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/request
new file mode 100644
index 0000000000..3680210c06
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-extras
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/response
new file mode 100644
index 0000000000..f01977e2ea
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-extras/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/request
new file mode 100644
index 0000000000..9ab4a9f9a5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-fsm
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/response
new file mode 100644
index 0000000000..806ba68900
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-fsm/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/request
new file mode 100644
index 0000000000..48deb49201
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-io
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/response
new file mode 100644
index 0000000000..d56b30c56c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-io/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/request
new file mode 100644
index 0000000000..375710b600
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-pool
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/response
new file mode 100644
index 0000000000..9668a5eb7f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-pool/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/request
new file mode 100644
index 0000000000..62acec8401
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid-supervision
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/response
new file mode 100644
index 0000000000..90faa1a6b9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid-supervision/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/request
new file mode 100644
index 0000000000..ea4c6081c6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/celluloid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/response
new file mode 100644
index 0000000000..d77594e62d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/celluloid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/request
new file mode 100644
index 0000000000..2087abff17
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/request
@@ -0,0 +1,7 @@
+> GET /info/cgi_multipart_eof_fix
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/response
new file mode 100644
index 0000000000..a66ec83d22
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cgi_multipart_eof_fix/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/request
new file mode 100644
index 0000000000..c9c4c8e1c3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/request
@@ -0,0 +1,7 @@
+> GET /info/childprocess
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/response
new file mode 100644
index 0000000000..e92674716c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/childprocess/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/request
new file mode 100644
index 0000000000..627dfc2236
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/request
@@ -0,0 +1,7 @@
+> GET /info/climate_control
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/response
new file mode 100644
index 0000000000..2d5960987c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/climate_control/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/request
new file mode 100644
index 0000000000..0b58b496a2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/request
@@ -0,0 +1,7 @@
+> GET /info/cocaine
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/response
new file mode 100644
index 0000000000..bfd985f32e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cocaine/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/request
new file mode 100644
index 0000000000..26fb80abd9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/request
@@ -0,0 +1,7 @@
+> GET /info/coercible
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/response
new file mode 100644
index 0000000000..54e169a319
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coercible/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/request
new file mode 100644
index 0000000000..35f65b1c96
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/request
@@ -0,0 +1,7 @@
+> GET /info/coffee-rails
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/response
new file mode 100644
index 0000000000..d5e17e5ce9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-rails/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/request
new file mode 100644
index 0000000000..c1e276d2f2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/request
@@ -0,0 +1,7 @@
+> GET /info/coffee-script-source
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/response
new file mode 100644
index 0000000000..95f31d23d8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script-source/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/request
new file mode 100644
index 0000000000..6fb40106a3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/request
@@ -0,0 +1,7 @@
+> GET /info/coffee-script
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/response
new file mode 100644
index 0000000000..f513d56091
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coffee-script/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/request
new file mode 100644
index 0000000000..86a09b2b35
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/request
@@ -0,0 +1,7 @@
+> GET /info/colorize
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/response
new file mode 100644
index 0000000000..25dd358184
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/colorize/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/request
new file mode 100644
index 0000000000..0069d6d724
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/request
@@ -0,0 +1,7 @@
+> GET /info/concurrent-ruby
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/response
new file mode 100644
index 0000000000..186892a49c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/concurrent-ruby/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/request
new file mode 100644
index 0000000000..70e600db3d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/request
@@ -0,0 +1,7 @@
+> GET /info/configuration
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/response
new file mode 100644
index 0000000000..1e1fb6fa74
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/configuration/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/request
new file mode 100644
index 0000000000..5692539d94
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/request
@@ -0,0 +1,7 @@
+> GET /info/coveralls
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/response
new file mode 100644
index 0000000000..314e64865c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/coveralls/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/request
new file mode 100644
index 0000000000..8b9407ffc0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/request
@@ -0,0 +1,7 @@
+> GET /info/crass
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/response
new file mode 100644
index 0000000000..d73b4d2f17
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/crass/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/request
new file mode 100644
index 0000000000..2675af7847
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/request
@@ -0,0 +1,7 @@
+> GET /info/cucumber-core
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/response
new file mode 100644
index 0000000000..defc43e284
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-core/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/request
new file mode 100644
index 0000000000..f37e871807
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/request
@@ -0,0 +1,7 @@
+> GET /info/cucumber-wire
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/response
new file mode 100644
index 0000000000..dd6a2d7a1f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber-wire/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/request
new file mode 100644
index 0000000000..db80e44ac1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/request
@@ -0,0 +1,7 @@
+> GET /info/cucumber
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/response
new file mode 100644
index 0000000000..8ec223a388
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/cucumber/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/request
new file mode 100644
index 0000000000..f92a2f7bc9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/request
@@ -0,0 +1,7 @@
+> GET /info/culerity
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/response
new file mode 100644
index 0000000000..a26aae4ac6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/culerity/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/request
new file mode 100644
index 0000000000..1119c8e4fa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/request
@@ -0,0 +1,7 @@
+> GET /info/curses
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/response
new file mode 100644
index 0000000000..1450b0afdd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/curses/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/request
new file mode 100644
index 0000000000..5080c98e6d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/request
@@ -0,0 +1,7 @@
+> GET /info/daemons
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/response
new file mode 100644
index 0000000000..f96024298f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/daemons/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/request
new file mode 100644
index 0000000000..d80f93551a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/request
@@ -0,0 +1,7 @@
+> GET /info/database_cleaner
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/response
new file mode 100644
index 0000000000..362be4a4da
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/database_cleaner/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/request
new file mode 100644
index 0000000000..f2463924fc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/request
@@ -0,0 +1,7 @@
+> GET /info/declarative-option
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/response
new file mode 100644
index 0000000000..02d0a6c4d8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative-option/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/request
new file mode 100644
index 0000000000..de13d40070
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/request
@@ -0,0 +1,7 @@
+> GET /info/declarative
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/response
new file mode 100644
index 0000000000..0ac050c7dd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/declarative/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/request
new file mode 100644
index 0000000000..563a4f60c2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/request
@@ -0,0 +1,7 @@
+> GET /info/descendants_tracker
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/response
new file mode 100644
index 0000000000..23fc0f5703
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/descendants_tracker/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/request
new file mode 100644
index 0000000000..3c60080b38
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/request
@@ -0,0 +1,7 @@
+> GET /info/diff-lcs
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/response
new file mode 100644
index 0000000000..a715afbadf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/diff-lcs/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/request
new file mode 100644
index 0000000000..de1e687189
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/request
@@ -0,0 +1,7 @@
+> GET /info/docile
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/response
new file mode 100644
index 0000000000..56252f4598
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/docile/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/request
new file mode 100644
index 0000000000..6157da6082
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/request
@@ -0,0 +1,7 @@
+> GET /info/domain_name
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/response
new file mode 100644
index 0000000000..69e0e69025
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/domain_name/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/request
new file mode 100644
index 0000000000..fe63740e5b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/request
@@ -0,0 +1,7 @@
+> GET /info/dotenv-deployment
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/response
new file mode 100644
index 0000000000..a640a58ddc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv-deployment/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/request
new file mode 100644
index 0000000000..234c682a25
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/request
@@ -0,0 +1,7 @@
+> GET /info/dotenv
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/response
new file mode 100644
index 0000000000..7207be4b53
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/dotenv/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/request
new file mode 100644
index 0000000000..98ea72af26
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/request
@@ -0,0 +1,7 @@
+> GET /info/echoe
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/response
new file mode 100644
index 0000000000..8c48623d2c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/echoe/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/request
new file mode 100644
index 0000000000..12962c23bb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/request
@@ -0,0 +1,7 @@
+> GET /info/em-hiredis
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/response
new file mode 100644
index 0000000000..36c32f4dc2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/em-hiredis/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/request
new file mode 100644
index 0000000000..e558748718
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/request
@@ -0,0 +1,7 @@
+> GET /info/english
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/response
new file mode 100644
index 0000000000..ff4ad5bfae
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/english/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/request
new file mode 100644
index 0000000000..830c2ba57f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/request
@@ -0,0 +1,7 @@
+> GET /info/equalizer
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/response
new file mode 100644
index 0000000000..7947e79a87
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/equalizer/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/request
new file mode 100644
index 0000000000..60045f3490
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/request
@@ -0,0 +1,7 @@
+> GET /info/erubi
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/response
new file mode 100644
index 0000000000..c9cf020d3c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubi/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/request
new file mode 100644
index 0000000000..1f4a5d9599
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/request
@@ -0,0 +1,7 @@
+> GET /info/erubis
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/response
new file mode 100644
index 0000000000..d8db903ef5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/erubis/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/request
new file mode 100644
index 0000000000..27c56dc41b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/request
@@ -0,0 +1,7 @@
+> GET /info/escape_utils
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/response
new file mode 100644
index 0000000000..fba2eb7d3f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/escape_utils/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/request
new file mode 100644
index 0000000000..83753cb9de
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/request
@@ -0,0 +1,7 @@
+> GET /info/et-orbi
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/response
new file mode 100644
index 0000000000..7ff97e23f3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/et-orbi/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/request
new file mode 100644
index 0000000000..aad129c8f2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/request
@@ -0,0 +1,7 @@
+> GET /info/event-bus
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/response
new file mode 100644
index 0000000000..ae88842c6c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/event-bus/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/request
new file mode 100644
index 0000000000..1d83bd53b7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/request
@@ -0,0 +1,7 @@
+> GET /info/eventmachine-le
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/response
new file mode 100644
index 0000000000..fe84542b87
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine-le/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/request
new file mode 100644
index 0000000000..614a5bf2a8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/request
@@ -0,0 +1,7 @@
+> GET /info/eventmachine
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/response
new file mode 100644
index 0000000000..4f01cf2733
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/eventmachine/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/request
new file mode 100644
index 0000000000..531f5c9b31
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/request
@@ -0,0 +1,7 @@
+> GET /info/execjs
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/response
new file mode 100644
index 0000000000..2349c04641
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/execjs/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/request
new file mode 100644
index 0000000000..3fa0dea3a5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/request
@@ -0,0 +1,7 @@
+> GET /info/extlib
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/response
new file mode 100644
index 0000000000..6c6c2ba613
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/extlib/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/request
new file mode 100644
index 0000000000..6aae67744b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/request
@@ -0,0 +1,7 @@
+> GET /info/facets
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/response
new file mode 100644
index 0000000000..aa2db990de
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facets/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/request
new file mode 100644
index 0000000000..18bdd6e328
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/request
@@ -0,0 +1,7 @@
+> GET /info/facter
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/response
new file mode 100644
index 0000000000..ec8e0dea90
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/facter/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/request
new file mode 100644
index 0000000000..7bf2fb9f5d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/request
@@ -0,0 +1,7 @@
+> GET /info/faker
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/jobs,spec_run,trampoline_disable,plugins ab677b2f2db78951
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/response
new file mode 100644
index 0000000000..0e92a79ec6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faker/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/request
new file mode 100644
index 0000000000..b7ee2f317a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/request
@@ -0,0 +1,7 @@
+> GET /info/faraday
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/response
new file mode 100644
index 0000000000..ff1f6f9285
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faraday/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/request
new file mode 100644
index 0000000000..7ea5079231
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/request
@@ -0,0 +1,7 @@
+> GET /info/fastthread
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/response
new file mode 100644
index 0000000000..a8f2fe281c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fastthread/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/request
new file mode 100644
index 0000000000..e865b6d68f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/request
@@ -0,0 +1,7 @@
+> GET /info/faye-websocket
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/response
new file mode 100644
index 0000000000..9556c3541a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/faye-websocket/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/request
new file mode 100644
index 0000000000..4389c71b0c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/request
@@ -0,0 +1,7 @@
+> GET /info/fcgi
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/response
new file mode 100644
index 0000000000..daf43cba8f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/fcgi/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/request
new file mode 100644
index 0000000000..c2ea7ed71b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ffi-win32-extensions
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/response
new file mode 100644
index 0000000000..b9a3383c07
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi-win32-extensions/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/request
new file mode 100644
index 0000000000..337ccf260d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ffi
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/response
new file mode 100644
index 0000000000..d000af0070
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ffi/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/request
new file mode 100644
index 0000000000..85e3d59016
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/request
@@ -0,0 +1,7 @@
+> GET /info/flexmock
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/response
new file mode 100644
index 0000000000..fb369fd425
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/flexmock/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/request
new file mode 100644
index 0000000000..2946076a0c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/request
@@ -0,0 +1,7 @@
+> GET /info/functional-ruby
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/response
new file mode 100644
index 0000000000..20c2d272bb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/functional-ruby/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/request
new file mode 100644
index 0000000000..037082143d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/request
@@ -0,0 +1,7 @@
+> GET /info/gem_plugin
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/response
new file mode 100644
index 0000000000..7fae98bbb3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gem_plugin/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/request
new file mode 100644
index 0000000000..48a190b596
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/request
@@ -0,0 +1,7 @@
+> GET /info/gemcutter
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/response
new file mode 100644
index 0000000000..a0dbe8851d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gemcutter/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/request
new file mode 100644
index 0000000000..e16c323f9f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/request
@@ -0,0 +1,7 @@
+> GET /info/gherkin
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/response
new file mode 100644
index 0000000000..829f722690
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/request
new file mode 100644
index 0000000000..51c1b8dbd1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/request
@@ -0,0 +1,7 @@
+> GET /info/gherkin3
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/response
new file mode 100644
index 0000000000..a84fde4ecc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gherkin3/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/request
new file mode 100644
index 0000000000..a17b1c9fd9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/request
@@ -0,0 +1,7 @@
+> GET /info/git
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/response
new file mode 100644
index 0000000000..48b2f3e525
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/git/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/request
new file mode 100644
index 0000000000..0b5cc95383
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/globalid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/response
new file mode 100644
index 0000000000..3682bcef6e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/globalid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/request
new file mode 100644
index 0000000000..6997e2f1b1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/request
@@ -0,0 +1,7 @@
+> GET /info/google-api-client
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/response
new file mode 100644
index 0000000000..c976f20fe6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/google-api-client/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/request
new file mode 100644
index 0000000000..a5af0919c9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/request
@@ -0,0 +1,7 @@
+> GET /info/googleauth
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/response
new file mode 100644
index 0000000000..a8feae6890
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/googleauth/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/request
new file mode 100644
index 0000000000..35f5608ebe
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/request
@@ -0,0 +1,7 @@
+> GET /info/gxapi_rails
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/response
new file mode 100644
index 0000000000..fbdf6f55bf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/gxapi_rails/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/request
new file mode 100644
index 0000000000..385ec2b595
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hashie
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/response
new file mode 100644
index 0000000000..3d47fc2375
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hashie/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/request
new file mode 100644
index 0000000000..4b571d66c1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/request
@@ -0,0 +1,7 @@
+> GET /info/highline
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/response
new file mode 100644
index 0000000000..338daddcc1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/highline/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/request
new file mode 100644
index 0000000000..f6c38deaaa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hike
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/response
new file mode 100644
index 0000000000..2b957a4ff6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hike/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/request
new file mode 100644
index 0000000000..6113e85b8d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hiredis
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/response
new file mode 100644
index 0000000000..d173e1925a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hiredis/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/request
new file mode 100644
index 0000000000..4a3c1bbdab
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hitimes
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/response
new file mode 100644
index 0000000000..24355f1810
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hitimes/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/request
new file mode 100644
index 0000000000..e86bcea319
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hoe
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/response
new file mode 100644
index 0000000000..82c2887f97
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hoe/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/request
new file mode 100644
index 0000000000..40972439c4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hooks
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/response
new file mode 100644
index 0000000000..b74b3e7313
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hooks/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/request
new file mode 100644
index 0000000000..dc272ed3b8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/request
@@ -0,0 +1,7 @@
+> GET /info/http-cookie
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/response
new file mode 100644
index 0000000000..d8db0ab577
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http-cookie/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/request
new file mode 100644
index 0000000000..e67979aa78
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/request
@@ -0,0 +1,7 @@
+> GET /info/http_parser.rb
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/response
new file mode 100644
index 0000000000..ed892d2641
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/http_parser.rb/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/request
new file mode 100644
index 0000000000..c9d3ce3546
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/request
@@ -0,0 +1,7 @@
+> GET /info/httpadapter
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/response
new file mode 100644
index 0000000000..2085d78734
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpadapter/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/request
new file mode 100644
index 0000000000..499c716b32
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/request
@@ -0,0 +1,7 @@
+> GET /info/httpclient
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/response
new file mode 100644
index 0000000000..2085e02351
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/httpclient/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/request
new file mode 100644
index 0000000000..218736d428
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/request
@@ -0,0 +1,7 @@
+> GET /info/hurley
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/response
new file mode 100644
index 0000000000..5268938361
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/hurley/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/request
new file mode 100644
index 0000000000..ad35d73f0b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/request
@@ -0,0 +1,7 @@
+> GET /info/i18n
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/response
new file mode 100644
index 0000000000..a5d8e4a8d8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/i18n/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/request
new file mode 100644
index 0000000000..0c7e990bf7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ice_nine
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/response
new file mode 100644
index 0000000000..9640b04f66
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ice_nine/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/request
new file mode 100644
index 0000000000..8f9b0132c2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/request
@@ -0,0 +1,7 @@
+> GET /info/journey
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/response
new file mode 100644
index 0000000000..18f04980b2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/journey/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/request
new file mode 100644
index 0000000000..6dd6f3f43b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/request
@@ -0,0 +1,7 @@
+> GET /info/jruby-pageant
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/response
new file mode 100644
index 0000000000..c1d4f95e29
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jruby-pageant/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/request
new file mode 100644
index 0000000000..7ca746d23e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/request
@@ -0,0 +1,7 @@
+> GET /info/json
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/response
new file mode 100644
index 0000000000..dbaffc17f1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/request
new file mode 100644
index 0000000000..aa2b18bd1d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/request
@@ -0,0 +1,7 @@
+> GET /info/json_pure
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/response
new file mode 100644
index 0000000000..66abe94a62
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/json_pure/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/request
new file mode 100644
index 0000000000..c8669eac08
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/request
@@ -0,0 +1,7 @@
+> GET /info/jwt
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/response
new file mode 100644
index 0000000000..e262e41c07
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/jwt/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/request
new file mode 100644
index 0000000000..4aeefbc7aa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/request
@@ -0,0 +1,7 @@
+> GET /info/language
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/response
new file mode 100644
index 0000000000..6b63972d50
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/language/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/request
new file mode 100644
index 0000000000..60da8f9a26
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/request
@@ -0,0 +1,7 @@
+> GET /info/launchy
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/response
new file mode 100644
index 0000000000..db76626340
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/launchy/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/request
new file mode 100644
index 0000000000..3764e1e3b1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/request
@@ -0,0 +1,7 @@
+> GET /info/libwebsocket
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/response
new file mode 100644
index 0000000000..244ba5277a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libwebsocket/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/request
new file mode 100644
index 0000000000..fad58483fe
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/request
@@ -0,0 +1,7 @@
+> GET /info/libxml-ruby
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/response
new file mode 100644
index 0000000000..2742abd449
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/libxml-ruby/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/request
new file mode 100644
index 0000000000..9ac0105694
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/liquid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/response
new file mode 100644
index 0000000000..fa37cb788f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/liquid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/request
new file mode 100644
index 0000000000..d8ac06f4ea
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/request
@@ -0,0 +1,7 @@
+> GET /info/listen
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/response
new file mode 100644
index 0000000000..74dd5df6ce
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/listen/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/request
new file mode 100644
index 0000000000..34f643d772
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/request
@@ -0,0 +1,7 @@
+> GET /info/little-plugger
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/response
new file mode 100644
index 0000000000..2b8b21982f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/little-plugger/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/request
new file mode 100644
index 0000000000..21ccaf6be5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/request
@@ -0,0 +1,7 @@
+> GET /info/lockfile
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/response
new file mode 100644
index 0000000000..fde932b183
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/lockfile/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/request
new file mode 100644
index 0000000000..8a7bd45f35
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/request
@@ -0,0 +1,7 @@
+> GET /info/logging
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/response
new file mode 100644
index 0000000000..cbe9bfdebf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/logging/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/request
new file mode 100644
index 0000000000..2cb6d57679
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/request
@@ -0,0 +1,7 @@
+> GET /info/loofah
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/response
new file mode 100644
index 0000000000..848cc7b05b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loofah/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/request
new file mode 100644
index 0000000000..bda60b4dc3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/request
@@ -0,0 +1,7 @@
+> GET /info/loquacious
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/response
new file mode 100644
index 0000000000..bbda4bc450
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/loquacious/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/request
new file mode 100644
index 0000000000..115c6e6448
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mab
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/response
new file mode 100644
index 0000000000..067827ad9c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mab/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/request
new file mode 100644
index 0000000000..ea11e0bd0c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mail
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/response
new file mode 100644
index 0000000000..5dd7ab169c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mail/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/request
new file mode 100644
index 0000000000..27db5d09cf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/request
@@ -0,0 +1,7 @@
+> GET /info/markaby
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/response
new file mode 100644
index 0000000000..917d9f7777
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/markaby/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/request
new file mode 100644
index 0000000000..4b0c275c6e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/request
@@ -0,0 +1,7 @@
+> GET /info/memcache-client
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/response
new file mode 100644
index 0000000000..a1fb37c9f7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memcache-client/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/request
new file mode 100644
index 0000000000..fcda1676de
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/request
@@ -0,0 +1,7 @@
+> GET /info/memoist
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/response
new file mode 100644
index 0000000000..b3b4112024
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoist/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/request
new file mode 100644
index 0000000000..ae7e5e0371
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/request
@@ -0,0 +1,7 @@
+> GET /info/memoizable
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/response
new file mode 100644
index 0000000000..730066f3b8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/memoizable/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/request
new file mode 100644
index 0000000000..9f502c21cc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/request
@@ -0,0 +1,7 @@
+> GET /info/metaclass
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/response
new file mode 100644
index 0000000000..838e17e78b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaclass/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/request
new file mode 100644
index 0000000000..872aea81e0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/metaid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/response
new file mode 100644
index 0000000000..3b745e234b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/metaid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/request
new file mode 100644
index 0000000000..4d02bc1e42
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/request
@@ -0,0 +1,7 @@
+> GET /info/method_source
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/response
new file mode 100644
index 0000000000..18c79330c5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/method_source/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/request
new file mode 100644
index 0000000000..8081aaa002
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mime-types-data
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/response
new file mode 100644
index 0000000000..c428319a48
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types-data/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/request
new file mode 100644
index 0000000000..eb07326eda
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mime-types
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/response
new file mode 100644
index 0000000000..c811fa5136
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mime-types/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/request
new file mode 100644
index 0000000000..cbb2e4f493
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mimemagic
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/response
new file mode 100644
index 0000000000..bf480bbe5f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mimemagic/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/request
new file mode 100644
index 0000000000..f536dc4d3e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mini_portile
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/response
new file mode 100644
index 0000000000..0e53b5b3d0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/request
new file mode 100644
index 0000000000..ab28a8089a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mini_portile2
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/response
new file mode 100644
index 0000000000..e664192bbe
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mini_portile2/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/request
new file mode 100644
index 0000000000..d9d5968a5b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/request
@@ -0,0 +1,7 @@
+> GET /info/minitar-cli
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/response
new file mode 100644
index 0000000000..fb853dc6c2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar-cli/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/request
new file mode 100644
index 0000000000..c8b5697b43
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/request
@@ -0,0 +1,7 @@
+> GET /info/minitar
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/response
new file mode 100644
index 0000000000..17342c80e5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitar/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/request
new file mode 100644
index 0000000000..4d88e89a59
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/request
@@ -0,0 +1,7 @@
+> GET /info/minitest
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/response
new file mode 100644
index 0000000000..514aae033a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/minitest/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/request
new file mode 100644
index 0000000000..3333257711
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mkrf
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/response
new file mode 100644
index 0000000000..5e0d4ee277
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mkrf/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/request
new file mode 100644
index 0000000000..f215f1f8d6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mocha
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/response
new file mode 100644
index 0000000000..da32ecfb8d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mocha/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/request
new file mode 100644
index 0000000000..0181a370bc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mongrel
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/response
new file mode 100644
index 0000000000..0184bd09dc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mongrel/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/request
new file mode 100644
index 0000000000..088d7a648d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mono_logger
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/response
new file mode 100644
index 0000000000..5163ec92af
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mono_logger/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/request
new file mode 100644
index 0000000000..56942172dc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/request
@@ -0,0 +1,7 @@
+> GET /info/multi_json
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/response
new file mode 100644
index 0000000000..001f44bb08
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_json/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/request
new file mode 100644
index 0000000000..8f4d50696c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/request
@@ -0,0 +1,7 @@
+> GET /info/multi_test
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/response
new file mode 100644
index 0000000000..955de5d64d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multi_test/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/request
new file mode 100644
index 0000000000..1a64e6f47e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/request
@@ -0,0 +1,7 @@
+> GET /info/multimap
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/response
new file mode 100644
index 0000000000..da10914932
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multimap/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/request
new file mode 100644
index 0000000000..63eec25ffd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/request
@@ -0,0 +1,7 @@
+> GET /info/multipart-post
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/response
new file mode 100644
index 0000000000..ec7b13cfc5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/multipart-post/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/request
new file mode 100644
index 0000000000..710afe0829
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/request
@@ -0,0 +1,7 @@
+> GET /info/mustermann
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/response
new file mode 100644
index 0000000000..21ba1104a6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/mustermann/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/request
new file mode 100644
index 0000000000..45d8ea2c39
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/request
@@ -0,0 +1,7 @@
+> GET /info/needle
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/response
new file mode 100644
index 0000000000..600fcfb700
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/needle/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/request
new file mode 100644
index 0000000000..4ab184fc81
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/request
@@ -0,0 +1,7 @@
+> GET /info/nenv
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/response
new file mode 100644
index 0000000000..8bb1ae92e6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nenv/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/request
new file mode 100644
index 0000000000..8910edf8e6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/request
@@ -0,0 +1,7 @@
+> GET /info/net-scp
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/response
new file mode 100644
index 0000000000..1041db3aa7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-scp/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/request
new file mode 100644
index 0000000000..043751da3b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/request
@@ -0,0 +1,7 @@
+> GET /info/net-ssh
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/response
new file mode 100644
index 0000000000..33632b22b5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/net-ssh/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/request
new file mode 100644
index 0000000000..912c799120
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/request
@@ -0,0 +1,7 @@
+> GET /info/netrc
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/response
new file mode 100644
index 0000000000..53a65c4824
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/netrc/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/request
new file mode 100644
index 0000000000..ef62899a0c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/request
@@ -0,0 +1,7 @@
+> GET /info/newgem
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/response
new file mode 100644
index 0000000000..9a5e53ac8c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/newgem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/request
new file mode 100644
index 0000000000..44337df0b7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/request
@@ -0,0 +1,7 @@
+> GET /info/nio4r
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/response
new file mode 100644
index 0000000000..56e0f5a7e1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nio4r/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/request
new file mode 100644
index 0000000000..09c5dd725f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/request
@@ -0,0 +1,7 @@
+> GET /info/nokogiri
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/response
new file mode 100644
index 0000000000..369a205b2e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/nokogiri/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/request
new file mode 100644
index 0000000000..1d82322d8b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/request
@@ -0,0 +1,7 @@
+> GET /info/os
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/response
new file mode 100644
index 0000000000..cd38a4e1ef
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/os/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/request
new file mode 100644
index 0000000000..c977514627
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/request
@@ -0,0 +1,7 @@
+> GET /info/paperclip
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/response
new file mode 100644
index 0000000000..31b3fdd4d7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/paperclip/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/request
new file mode 100644
index 0000000000..5fc1b9ff8b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/request
@@ -0,0 +1,7 @@
+> GET /info/parser
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/response
new file mode 100644
index 0000000000..8de3ebdeeb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/parser/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/request
new file mode 100644
index 0000000000..1636fe07b4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/request
@@ -0,0 +1,7 @@
+> GET /info/pattern-match
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/response
new file mode 100644
index 0000000000..407bd97444
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pattern-match/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/request
new file mode 100644
index 0000000000..8f2f5ae398
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/request
@@ -0,0 +1,7 @@
+> GET /info/pkg-config
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/response
new file mode 100644
index 0000000000..892050438f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/pkg-config/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/request
new file mode 100644
index 0000000000..8841563b63
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/request
@@ -0,0 +1,7 @@
+> GET /info/polyglot
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/response
new file mode 100644
index 0000000000..2e5dba2b76
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/polyglot/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/request
new file mode 100644
index 0000000000..73ef4c0d07
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/request
@@ -0,0 +1,7 @@
+> GET /info/power_assert
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/response
new file mode 100644
index 0000000000..d9cdfe043b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/power_assert/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/request
new file mode 100644
index 0000000000..0a69936bc6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/request
@@ -0,0 +1,7 @@
+> GET /info/powerbar
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/response
new file mode 100644
index 0000000000..a71d6494db
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerbar/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/request
new file mode 100644
index 0000000000..20bf19b1af
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/request
@@ -0,0 +1,7 @@
+> GET /info/powerpack
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/response
new file mode 100644
index 0000000000..18240e5335
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/powerpack/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/request
new file mode 100644
index 0000000000..2ba448e12d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/request
@@ -0,0 +1,7 @@
+> GET /info/preforker
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/response
new file mode 100644
index 0000000000..c9cf52559e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/preforker/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/request
new file mode 100644
index 0000000000..9f13c8a79e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/request
@@ -0,0 +1,7 @@
+> GET /info/public_suffix
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/response
new file mode 100644
index 0000000000..75a81259f8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/public_suffix/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/request
new file mode 100644
index 0000000000..dfc9adfa9d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/request
@@ -0,0 +1,7 @@
+> GET /info/racc
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/response
new file mode 100644
index 0000000000..3b19786ead
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/racc/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/request
new file mode 100644
index 0000000000..27a90522f4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack-cache
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/response
new file mode 100644
index 0000000000..94e686dc49
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-cache/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/request
new file mode 100644
index 0000000000..59a7bd8b8d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack-mount
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/response
new file mode 100644
index 0000000000..42dde6a265
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-mount/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/request
new file mode 100644
index 0000000000..4eb6557436
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack-protection
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/response
new file mode 100644
index 0000000000..8ac5f63f69
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-protection/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/request
new file mode 100644
index 0000000000..6871bc0308
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack-ssl
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/response
new file mode 100644
index 0000000000..47375b7ed8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-ssl/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/request
new file mode 100644
index 0000000000..624dd07678
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack-test
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/response
new file mode 100644
index 0000000000..ee93493b49
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack-test/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/request
new file mode 100644
index 0000000000..16a0feac8c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rack
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/response
new file mode 100644
index 0000000000..867035cd63
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rack/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/request
new file mode 100644
index 0000000000..67514b94c8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rails-deprecated_sanitizer
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/response
new file mode 100644
index 0000000000..1344345709
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-deprecated_sanitizer/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/request
new file mode 100644
index 0000000000..2caa6d814e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rails-dom-testing
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/response
new file mode 100644
index 0000000000..cc215cf4f0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-dom-testing/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/request
new file mode 100644
index 0000000000..54db344173
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rails-html-sanitizer
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/response
new file mode 100644
index 0000000000..6dbdd7d5c3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-html-sanitizer/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/request
new file mode 100644
index 0000000000..3fb8b11adf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rails-observers
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/response
new file mode 100644
index 0000000000..ba7e9367fa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails-observers/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/request
new file mode 100644
index 0000000000..b156e7be25
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rails
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/response
new file mode 100644
index 0000000000..9ff62db657
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rails/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/request
new file mode 100644
index 0000000000..40f66c8a6f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/request
@@ -0,0 +1,7 @@
+> GET /info/railties
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/response
new file mode 100644
index 0000000000..c95e7e7edd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/railties/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/request
new file mode 100644
index 0000000000..ae1ee0cee9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rainbow
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/response
new file mode 100644
index 0000000000..f09bf393c2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rainbow/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/request
new file mode 100644
index 0000000000..2f777a05bf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rake-compiler
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/response
new file mode 100644
index 0000000000..23e76df066
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake-compiler/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/request
new file mode 100644
index 0000000000..c161c917e1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rake
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/response
new file mode 100644
index 0000000000..da73b27d17
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rake/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/request
new file mode 100644
index 0000000000..101066914a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rb-fchange
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/response
new file mode 100644
index 0000000000..99ed1a9fdf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fchange/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/request
new file mode 100644
index 0000000000..192253cb0c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rb-fsevent
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/response
new file mode 100644
index 0000000000..536d498501
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-fsevent/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/request
new file mode 100644
index 0000000000..cf7287e37b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rb-inotify
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/response
new file mode 100644
index 0000000000..6e34ecb855
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-inotify/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/request
new file mode 100644
index 0000000000..6d256b9e11
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rb-kqueue
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/response
new file mode 100644
index 0000000000..63953471b7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rb-kqueue/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/request
new file mode 100644
index 0000000000..0a269f784f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rbnacl-libsodium
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/response
new file mode 100644
index 0000000000..158fec8538
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl-libsodium/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/request
new file mode 100644
index 0000000000..d28de6c266
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rbnacl
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/response
new file mode 100644
index 0000000000..6a5555bc2b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rbnacl/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/request
new file mode 100644
index 0000000000..611a286a4c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rcov
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/response
new file mode 100644
index 0000000000..7ef58c5aab
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rcov/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/request
new file mode 100644
index 0000000000..8402303257
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rdoc
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/response
new file mode 100644
index 0000000000..3d86e4f442
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rdoc/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/request
new file mode 100644
index 0000000000..9b78830065
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/request
@@ -0,0 +1,7 @@
+> GET /info/redis-namespace
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/response
new file mode 100644
index 0000000000..03d9194045
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis-namespace/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/request
new file mode 100644
index 0000000000..9bfcfc80fd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/request
@@ -0,0 +1,7 @@
+> GET /info/redis
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/response
new file mode 100644
index 0000000000..9f5d4406e5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/redis/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/request
new file mode 100644
index 0000000000..42ee151f68
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ref
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/response
new file mode 100644
index 0000000000..528ef107b5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ref/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/request
new file mode 100644
index 0000000000..73a5ca084e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/request
@@ -0,0 +1,7 @@
+> GET /info/representable
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/response
new file mode 100644
index 0000000000..5a28b34afb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/representable/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/request
new file mode 100644
index 0000000000..aa9132aedb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/request
@@ -0,0 +1,7 @@
+> GET /info/resque-scheduler
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/response
new file mode 100644
index 0000000000..8e0c95e2cb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque-scheduler/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/request
new file mode 100644
index 0000000000..616a9e5b9f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/request
@@ -0,0 +1,7 @@
+> GET /info/resque
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/response
new file mode 100644
index 0000000000..32c3e51e9b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/resque/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/request
new file mode 100644
index 0000000000..5935658273
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rest-client
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/response
new file mode 100644
index 0000000000..5363438b08
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rest-client/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/request
new file mode 100644
index 0000000000..a76f439668
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/request
@@ -0,0 +1,7 @@
+> GET /info/retriable
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/response
new file mode 100644
index 0000000000..1ee15eeb98
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/retriable/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/request
new file mode 100644
index 0000000000..0390a17867
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rexical
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/response
new file mode 100644
index 0000000000..9e6fb35c6c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rexical/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/request
new file mode 100644
index 0000000000..46fa433f4a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/request
@@ -0,0 +1,7 @@
+> GET /info/right_aws
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/response
new file mode 100644
index 0000000000..eb62d2516c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_aws/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/request
new file mode 100644
index 0000000000..9afacd1726
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/request
@@ -0,0 +1,7 @@
+> GET /info/right_http_connection
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/response
new file mode 100644
index 0000000000..05212f5e5e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/right_http_connection/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/request
new file mode 100644
index 0000000000..c9398deae9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec-core
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/response
new file mode 100644
index 0000000000..e34e0f1740
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-core/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/request
new file mode 100644
index 0000000000..660b24d100
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec-expectations
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/response
new file mode 100644
index 0000000000..a51f67f84a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-expectations/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/request
new file mode 100644
index 0000000000..5ff447f187
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec-logsplit
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/response
new file mode 100644
index 0000000000..b0780175c6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-logsplit/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/request
new file mode 100644
index 0000000000..0a961c6ffd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec-mocks
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/response
new file mode 100644
index 0000000000..b80ac128fe
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-mocks/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/request
new file mode 100644
index 0000000000..ab2d3175ec
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec-support
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/response
new file mode 100644
index 0000000000..b5ac515f64
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec-support/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/request
new file mode 100644
index 0000000000..3f327837cc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rspec
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/response
new file mode 100644
index 0000000000..15739a2536
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rspec/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/request
new file mode 100644
index 0000000000..19c742edd3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rubigen
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/response
new file mode 100644
index 0000000000..d891923d0f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubigen/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/request
new file mode 100644
index 0000000000..49899f0274
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rubocop
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/response
new file mode 100644
index 0000000000..b04daa0835
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubocop/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/request
new file mode 100644
index 0000000000..83ae0d71e7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ruby-openid
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/response
new file mode 100644
index 0000000000..52ed57c65f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-openid/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/request
new file mode 100644
index 0000000000..85bcdde042
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ruby-progressbar
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/response
new file mode 100644
index 0000000000..17ac9088ac
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-progressbar/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/request
new file mode 100644
index 0000000000..e12117e5dc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ruby-yadis
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/response
new file mode 100644
index 0000000000..13432135e4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby-yadis/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/request
new file mode 100644
index 0000000000..43d58ead74
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ruby_dep
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/response
new file mode 100644
index 0000000000..cc0788c900
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_dep/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/request
new file mode 100644
index 0000000000..460ff43276
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/request
@@ -0,0 +1,7 @@
+> GET /info/ruby_parser
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/response
new file mode 100644
index 0000000000..63c6ef0386
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/ruby_parser/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/request
new file mode 100644
index 0000000000..92e612095d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rubyforge
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/response
new file mode 100644
index 0000000000..16d3d25a0e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyforge/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/request
new file mode 100644
index 0000000000..56ff5252ce
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rubyzip
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/response
new file mode 100644
index 0000000000..073c6fc055
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rubyzip/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/request
new file mode 100644
index 0000000000..9c499d7320
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/request
@@ -0,0 +1,7 @@
+> GET /info/rufus-scheduler
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/response
new file mode 100644
index 0000000000..812fe87e81
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/rufus-scheduler/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/request
new file mode 100644
index 0000000000..98051f0722
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sass-listen
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/response
new file mode 100644
index 0000000000..8c9edc10b3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-listen/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/request
new file mode 100644
index 0000000000..ab996f5ead
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sass-rails
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/response
new file mode 100644
index 0000000000..c4a9239718
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass-rails/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/request
new file mode 100644
index 0000000000..16f4a2d834
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sass
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/response
new file mode 100644
index 0000000000..313c6759ab
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sass/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/request
new file mode 100644
index 0000000000..3128daa2f7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/request
@@ -0,0 +1,7 @@
+> GET /info/selenium-webdriver
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/response
new file mode 100644
index 0000000000..5776c2ea14
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/selenium-webdriver/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/request
new file mode 100644
index 0000000000..e92bfe4e50
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sexp_processor
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/response
new file mode 100644
index 0000000000..d7ebe60e4b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sexp_processor/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/request
new file mode 100644
index 0000000000..9d6b958cc5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/request
@@ -0,0 +1,7 @@
+> GET /info/shotgun
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/response
new file mode 100644
index 0000000000..5818a8035a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/shotgun/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/request
new file mode 100644
index 0000000000..bd4257ed35
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/request
@@ -0,0 +1,7 @@
+> GET /info/signet
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/response
new file mode 100644
index 0000000000..8fc0070487
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/signet/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/request
new file mode 100644
index 0000000000..daf148a4f8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/request
@@ -0,0 +1,7 @@
+> GET /info/simplecov-html
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/response
new file mode 100644
index 0000000000..6f69f67f0f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov-html/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/request
new file mode 100644
index 0000000000..be9dec39be
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/request
@@ -0,0 +1,7 @@
+> GET /info/simplecov
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/response
new file mode 100644
index 0000000000..a3e776cc99
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/simplecov/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/request
new file mode 100644
index 0000000000..f442fa89f6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sinatra
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/response
new file mode 100644
index 0000000000..75911724b2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sinatra/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/request
new file mode 100644
index 0000000000..f4a1685ba2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/request
@@ -0,0 +1,7 @@
+> GET /info/slop
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/response
new file mode 100644
index 0000000000..4596867818
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/slop/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/request
new file mode 100644
index 0000000000..c9686cae49
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/request
@@ -0,0 +1,7 @@
+> GET /info/spicycode-rcov
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/response
new file mode 100644
index 0000000000..02f19182ab
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spicycode-rcov/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/request
new file mode 100644
index 0000000000..d1f41c369a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/request
@@ -0,0 +1,7 @@
+> GET /info/spoon
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/response
new file mode 100644
index 0000000000..1f3ef61f03
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spoon/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/request
new file mode 100644
index 0000000000..7b7ba15490
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sprockets-rails
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/response
new file mode 100644
index 0000000000..7e3e31b886
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets-rails/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/request
new file mode 100644
index 0000000000..06767f04a6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sprockets
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/response
new file mode 100644
index 0000000000..e4bc7d20e3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sprockets/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/request
new file mode 100644
index 0000000000..a9995940f5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/request
@@ -0,0 +1,7 @@
+> GET /info/spruz
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/response
new file mode 100644
index 0000000000..3bf25600b0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/spruz/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/request
new file mode 100644
index 0000000000..39542c09e8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sqlite3
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/response
new file mode 100644
index 0000000000..efc03a2679
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sqlite3/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/request
new file mode 100644
index 0000000000..462e2bd29b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/request
@@ -0,0 +1,7 @@
+> GET /info/syntax
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/response
new file mode 100644
index 0000000000..afa8ce7387
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/syntax/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/request
new file mode 100644
index 0000000000..4ce082dcaa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/request
@@ -0,0 +1,7 @@
+> GET /info/sys-admin
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/response
new file mode 100644
index 0000000000..249397108b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/sys-admin/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/request
new file mode 100644
index 0000000000..39f37ebdf3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tenderlove-frex
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/response
new file mode 100644
index 0000000000..53e2fb263e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tenderlove-frex/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/request
new file mode 100644
index 0000000000..23c9c82fcf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/request
@@ -0,0 +1,7 @@
+> GET /info/term-ansicolor
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/response
new file mode 100644
index 0000000000..9baf5c0838
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/term-ansicolor/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/request
new file mode 100644
index 0000000000..17087a36e1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/request
@@ -0,0 +1,7 @@
+> GET /info/termios
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/response
new file mode 100644
index 0000000000..ed5ff907da
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/termios/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/request
new file mode 100644
index 0000000000..1d2d581583
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/request
@@ -0,0 +1,7 @@
+> GET /info/test-spec
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/response
new file mode 100644
index 0000000000..4c95e0f607
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-spec/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/request
new file mode 100644
index 0000000000..92b85c1751
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/request
@@ -0,0 +1,7 @@
+> GET /info/test-unit
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/response
new file mode 100644
index 0000000000..bb27d58d78
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/test-unit/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/request
new file mode 100644
index 0000000000..3a8cbe23e1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/request
@@ -0,0 +1,7 @@
+> GET /info/text-format
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/response
new file mode 100644
index 0000000000..f1c0e296e5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-format/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/request
new file mode 100644
index 0000000000..5aa85a177c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/request
@@ -0,0 +1,7 @@
+> GET /info/text-hyphen
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/response
new file mode 100644
index 0000000000..415db7ffb8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/text-hyphen/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/request
new file mode 100644
index 0000000000..ce6a7c8e8e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/request
@@ -0,0 +1,7 @@
+> GET /info/thin
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/response
new file mode 100644
index 0000000000..2816f819c1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thin/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/request
new file mode 100644
index 0000000000..413597fd9d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/request
@@ -0,0 +1,7 @@
+> GET /info/thor
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/response
new file mode 100644
index 0000000000..e7ffff2c35
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thor/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/request
new file mode 100644
index 0000000000..b420081022
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/request
@@ -0,0 +1,7 @@
+> GET /info/thoughtbot-shoulda
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 6d5397ce7f8b26e0
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/response
new file mode 100644
index 0000000000..f9e7a1a93d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thoughtbot-shoulda/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/request
new file mode 100644
index 0000000000..f5f0fffab3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/request
@@ -0,0 +1,7 @@
+> GET /info/thread_safe
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/response
new file mode 100644
index 0000000000..aea7453992
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/thread_safe/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/request
new file mode 100644
index 0000000000..039aa0341f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tilt
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/response
new file mode 100644
index 0000000000..2345ec0b21
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tilt/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/request
new file mode 100644
index 0000000000..2fc37f3a88
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/request
@@ -0,0 +1,7 @@
+> GET /info/timers
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/response
new file mode 100644
index 0000000000..e86a9276f5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/timers/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/request
new file mode 100644
index 0000000000..be1d206beb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tins
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/response
new file mode 100644
index 0000000000..b115ddbd57
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tins/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/request
new file mode 100644
index 0000000000..56ebce0f3f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tlsmail
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/response
new file mode 100644
index 0000000000..ecd321ccbc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tlsmail/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/request
new file mode 100644
index 0000000000..a8492ade82
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tool
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/response
new file mode 100644
index 0000000000..634d8a43da
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tool/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/request
new file mode 100644
index 0000000000..52f2db382f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/request
@@ -0,0 +1,7 @@
+> GET /info/treetop
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/response
new file mode 100644
index 0000000000..7c41530d1c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/treetop/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/request
new file mode 100644
index 0000000000..224cab6988
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/request
@@ -0,0 +1,7 @@
+> GET /info/trollop
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/response
new file mode 100644
index 0000000000..0b27048b76
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/trollop/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/request
new file mode 100644
index 0000000000..0175216dd1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/request
@@ -0,0 +1,7 @@
+> GET /info/tzinfo
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/response
new file mode 100644
index 0000000000..53f6c4697b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/tzinfo/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/request
new file mode 100644
index 0000000000..9fe5b0c30a
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/request
@@ -0,0 +1,7 @@
+> GET /info/uber
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/response
new file mode 100644
index 0000000000..eba3bd402e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uber/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/request
new file mode 100644
index 0000000000..f67c99558f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/request
@@ -0,0 +1,7 @@
+> GET /info/unf
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/response
new file mode 100644
index 0000000000..ffc37964aa
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/request
new file mode 100644
index 0000000000..77598fe741
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/request
@@ -0,0 +1,7 @@
+> GET /info/unf_ext
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/response
new file mode 100644
index 0000000000..df21493ce7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unf_ext/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/request
new file mode 100644
index 0000000000..9d4f27056b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/request
@@ -0,0 +1,7 @@
+> GET /info/unicode-display_width
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/response
new file mode 100644
index 0000000000..4c6e844651
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/unicode-display_width/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/request
new file mode 100644
index 0000000000..5daed37793
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/request
@@ -0,0 +1,7 @@
+> GET /info/uuidtools
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/response
new file mode 100644
index 0000000000..dce91487b9
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/uuidtools/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/request
new file mode 100644
index 0000000000..f22bf57945
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/request
@@ -0,0 +1,7 @@
+> GET /info/vegas
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/install options/retry,path,disable_shared_gems,spec_run,plugins,trampoline_disable d59b382d069fc94f
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/response
new file mode 100644
index 0000000000..c927a24960
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/vegas/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/request
new file mode 100644
index 0000000000..858ceea38d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/request
@@ -0,0 +1,7 @@
+> GET /info/virtus
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 53c83f3e5793993c
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/response
new file mode 100644
index 0000000000..5f4a979efb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/virtus/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/request
new file mode 100644
index 0000000000..f6a7eb9098
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/request
@@ -0,0 +1,7 @@
+> GET /info/weakling
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/response
new file mode 100644
index 0000000000..6bb2bd7f81
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/weakling/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/request
new file mode 100644
index 0000000000..06463439e0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/request
@@ -0,0 +1,7 @@
+> GET /info/websocket-driver
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/response
new file mode 100644
index 0000000000..3e008063cf
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-driver/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/request
new file mode 100644
index 0000000000..4757f24824
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/request
@@ -0,0 +1,7 @@
+> GET /info/websocket-extensions
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/response
new file mode 100644
index 0000000000..82d7d627ef
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket-extensions/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/request
new file mode 100644
index 0000000000..45eaa04e55
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/request
@@ -0,0 +1,7 @@
+> GET /info/websocket
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/response
new file mode 100644
index 0000000000..12f2851eb4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/websocket/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/request
new file mode 100644
index 0000000000..9d47c2709b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/request
@@ -0,0 +1,7 @@
+> GET /info/win32-api
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/response
new file mode 100644
index 0000000000..0949fa6bd6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-api/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/request
new file mode 100644
index 0000000000..6a11013349
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/request
@@ -0,0 +1,7 @@
+> GET /info/win32-dir
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/response
new file mode 100644
index 0000000000..e3ef8912a4
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-dir/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/request
new file mode 100644
index 0000000000..d89f956691
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/request
@@ -0,0 +1,7 @@
+> GET /info/win32-security
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/response
new file mode 100644
index 0000000000..bb0c9a7e36
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32-security/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/request
new file mode 100644
index 0000000000..37acaa6088
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/request
@@ -0,0 +1,7 @@
+> GET /info/win32console
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/response
new file mode 100644
index 0000000000..521817fcfc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/win32console/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/request
new file mode 100644
index 0000000000..30402b17e0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/request
@@ -0,0 +1,7 @@
+> GET /info/windows-api
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/response
new file mode 100644
index 0000000000..a5f9ab5106
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-api/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/request
new file mode 100644
index 0000000000..31c1180ac7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/request
@@ -0,0 +1,7 @@
+> GET /info/windows-pr
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/response
new file mode 100644
index 0000000000..da32f51343
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/windows-pr/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/request
new file mode 100644
index 0000000000..5cc409d8db
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/request
@@ -0,0 +1,7 @@
+> GET /info/xpath
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/response
new file mode 100644
index 0000000000..07edc592e7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/info/xpath/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/request
new file mode 100644
index 0000000000..ec73805dff
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/request
@@ -0,0 +1,7 @@
+> GET /versions
+> accept-encoding: gzip
+> accept: */*
+> user-agent: bundler/1.15.0.pre.2 rubygems/2.6.11 ruby/2.4.1 (x86_64-apple-darwin16.5.0) command/lock options/spec_run,plugins,trampoline_disable 7edfb7e0938d0c35
+> connection: keep-alive
+> keep-alive: 30
+> host: index.rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/response
new file mode 100644
index 0000000000..0a46b96850
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/index.rubygems.org/versions/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/request
new file mode 100644
index 0000000000..c078ac79e1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/activesupport-3.2.12.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/response
new file mode 100644
index 0000000000..7690c1c76d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.12.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/request
new file mode 100644
index 0000000000..b87c281d96
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/activesupport-3.2.22.5.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/response
new file mode 100644
index 0000000000..3659fabd5f
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/activesupport-3.2.22.5.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/request
new file mode 100644
index 0000000000..af03dfd189
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/bundler-1.12.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/response
new file mode 100644
index 0000000000..8a5dc75d9e
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/bundler-1.12.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/request
new file mode 100644
index 0000000000..6b0ccfc8c1
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/diff-lcs-1.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/response
new file mode 100644
index 0000000000..908888f595
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/diff-lcs-1.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/request
new file mode 100644
index 0000000000..5226c62cd2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/faker-1.1.2.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/response
new file mode 100644
index 0000000000..19bf053db5
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/faker-1.1.2.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/request
new file mode 100644
index 0000000000..6e27eac32c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/i18n-0.6.11.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/response
new file mode 100644
index 0000000000..0253208389
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.6.11.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/request
new file mode 100644
index 0000000000..04e800510b
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/i18n-0.8.1.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/response
new file mode 100644
index 0000000000..e746a6b73d
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/i18n-0.8.1.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/request
new file mode 100644
index 0000000000..8e82694d05
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/mono_logger-1.1.0.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/response
new file mode 100644
index 0000000000..3e1edd9559
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/mono_logger-1.1.0.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/request
new file mode 100644
index 0000000000..fa8e059e91
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/multi_json-1.12.1.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/response
new file mode 100644
index 0000000000..3a5565f9e0
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/multi_json-1.12.1.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/request
new file mode 100644
index 0000000000..9d96c013bc
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/rack-1.0.1.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/response
new file mode 100644
index 0000000000..3c461eee58
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.0.1.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/request
new file mode 100644
index 0000000000..4ae9745db3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/rack-1.6.5.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/response
new file mode 100644
index 0000000000..81fbf129bb
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-1.6.5.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/request
new file mode 100644
index 0000000000..03a85b2308
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/rack-protection-1.5.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/response
new file mode 100644
index 0000000000..5753f9f8c6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rack-protection-1.5.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/request
new file mode 100644
index 0000000000..7d5ad5ad23
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/redis-3.3.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/response
new file mode 100644
index 0000000000..375d86d9d7
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-3.3.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/request
new file mode 100644
index 0000000000..f928e29dd3
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/redis-namespace-1.5.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/response
new file mode 100644
index 0000000000..eab27de2e2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/redis-namespace-1.5.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/request
new file mode 100644
index 0000000000..91c5562047
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/resque-1.24.1.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/response
new file mode 100644
index 0000000000..33d38e4c6c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-1.24.1.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/request
new file mode 100644
index 0000000000..0237de2859
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/resque-scheduler-2.2.0.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/response
new file mode 100644
index 0000000000..455dc8bb01
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/resque-scheduler-2.2.0.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/request
new file mode 100644
index 0000000000..a8428bc9f6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/rufus-scheduler-2.0.24.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/response
new file mode 100644
index 0000000000..72b58e69dd
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/rufus-scheduler-2.0.24.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/request
new file mode 100644
index 0000000000..ee93e5d100
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/sinatra-1.4.8.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/response
new file mode 100644
index 0000000000..c3aa1333c6
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/sinatra-1.4.8.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/request
new file mode 100644
index 0000000000..51ddc098ae
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/thread_safe-0.3.6.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/response
new file mode 100644
index 0000000000..9007f04014
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/thread_safe-0.3.6.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/request
new file mode 100644
index 0000000000..c329c7b4c2
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/tilt-2.0.7.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/response
new file mode 100644
index 0000000000..46add52ee8
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tilt-2.0.7.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/request
new file mode 100644
index 0000000000..df7b05b346
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/tzinfo-1.2.3.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/response
new file mode 100644
index 0000000000..a64e2fda89
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/tzinfo-1.2.3.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/request
new file mode 100644
index 0000000000..562c01e339
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/request
@@ -0,0 +1,7 @@
+> GET /gems/vegas-0.1.11.gem
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/response
new file mode 100644
index 0000000000..b84b62a38c
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/gems/vegas-0.1.11.gem/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request
new file mode 100644
index 0000000000..ef6eab21ce
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/request
@@ -0,0 +1,7 @@
+> GET /quick/Marshal.4.8/bundler-1.12.3.gemspec.rz
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response
new file mode 100644
index 0000000000..c2e8cb4bce
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/quick/Marshal.4.8/bundler-1.12.3.gemspec.rz/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/request b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/request
new file mode 100644
index 0000000000..ca0f179471
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/request
@@ -0,0 +1,7 @@
+> GET /specs.4.8.gz
+> accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+> accept: */*
+> user-agent: Ruby
+> connection: keep-alive
+> keep-alive: 30
+> host: rubygems.org \ No newline at end of file
diff --git a/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/response b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/response
new file mode 100644
index 0000000000..95277c9b51
--- /dev/null
+++ b/spec/bundler/support/artifice/vcr_cassettes/realworld/rubygems.org/specs.4.8.gz/GET/response
Binary files differ
diff --git a/spec/bundler/support/artifice/windows.rb b/spec/bundler/support/artifice/windows.rb
index c18ca454ec..f39b2c6d53 100644
--- a/spec/bundler/support/artifice/windows.rb
+++ b/spec/bundler/support/artifice/windows.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require File.expand_path("../../path.rb", __FILE__)
include Spec::Path
diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb
index db128d497b..e8208eacd9 100644
--- a/spec/bundler/support/builders.rb
+++ b/spec/bundler/support/builders.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "bundler/shared_helpers"
require "shellwords"
@@ -18,7 +19,7 @@ module Spec
def build_repo1
build_repo gem_repo1 do
- build_gem "rack", %w(0.9.1 1.0.0) do |s|
+ build_gem "rack", %w[0.9.1 1.0.0] do |s|
s.executables = "rackup"
s.post_install_message = "Rack's post install message"
end
@@ -57,7 +58,7 @@ module Spec
build_gem "activeresource", "2.3.2" do |s|
s.add_dependency "activesupport", "2.3.2"
end
- build_gem "activesupport", %w(1.2.3 2.3.2 2.3.5)
+ build_gem "activesupport", %w[1.2.3 2.3.2 2.3.5]
build_gem "activemerchant" do |s|
s.add_dependency "activesupport", ">= 2.0.0"
@@ -256,7 +257,7 @@ module Spec
end
# Capistrano did this (at least until version 2.5.10)
- # Rubygems 2.2 doesn't allow the specifying of a dependency twice
+ # RubyGems 2.2 doesn't allow the specifying of a dependency twice
# See https://github.com/rubygems/rubygems/commit/03dbac93a3396a80db258d9bc63500333c25bd2f
build_gem "double_deps", "1.0", :skip_validation => true do |s|
s.add_dependency "net-ssh", ">= 1.0.0"
@@ -565,7 +566,7 @@ module Spec
# exit 1 unless with_config("simple")
- extension_name = "very_simple_binary_c"
+ extension_name = "#{name}_c"
if extra_lib_dir = with_config("ext-lib")
# add extra libpath if --with-ext-lib is
# passed in as a build_arg
@@ -575,11 +576,11 @@ module Spec
end
create_makefile extension_name
RUBY
- write "ext/very_simple_binary.c", <<-C
+ write "ext/#{name}.c", <<-C
#include "ruby.h"
- void Init_very_simple_binary_c() {
- rb_define_module("VerySimpleBinaryInC");
+ void Init_#{name}_c() {
+ rb_define_module("#{Builders.constantize(name)}_IN_C");
}
C
end
@@ -724,18 +725,21 @@ module Spec
class GemBuilder < LibBuilder
def _build(opts)
lib_path = super(opts.merge(:path => @context.tmp(".tmp/#{@spec.full_name}"), :no_default => opts[:no_default]))
+ destination = opts[:path] || _default_path
Dir.chdir(lib_path) do
- destination = opts[:path] || _default_path
FileUtils.mkdir_p(destination)
@spec.authors = ["that guy"] if !@spec.authors || @spec.authors.empty?
Bundler.rubygems.build(@spec, opts[:skip_validation])
- if opts[:to_system]
- `gem install --ignore-dependencies --no-ri --no-rdoc #{@spec.full_name}.gem`
- else
- FileUtils.mv("#{@spec.full_name}.gem", opts[:path] || _default_path)
- end
+ end
+ gem_path = File.expand_path("#{@spec.full_name}.gem", lib_path)
+ if opts[:to_system]
+ @context.system_gems gem_path, :keep_path => true
+ elsif opts[:to_bundle]
+ @context.system_gems gem_path, :path => :bundle_path, :keep_path => true
+ else
+ FileUtils.mv(gem_path, destination)
end
end
diff --git a/spec/bundler/support/code_climate.rb b/spec/bundler/support/code_climate.rb
index 8f1fb35bcd..a15442cabe 100644
--- a/spec/bundler/support/code_climate.rb
+++ b/spec/bundler/support/code_climate.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module CodeClimate
def self.setup
diff --git a/spec/bundler/support/command_execution.rb b/spec/bundler/support/command_execution.rb
new file mode 100644
index 0000000000..556285ac52
--- /dev/null
+++ b/spec/bundler/support/command_execution.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+require "support/helpers"
+require "support/path"
+
+module Spec
+ CommandExecution = Struct.new(:command, :working_directory, :exitstatus, :stdout, :stderr) do
+ include RSpec::Matchers::Composable
+
+ def to_s
+ c = Shellwords.shellsplit(command.strip).map {|s| s.include?("\n") ? " \\\n <<EOS\n#{s.gsub(/^/, " ").chomp}\nEOS" : Shellwords.shellescape(s) }
+ c = c.reduce("") do |acc, elem|
+ concat = acc + " " + elem
+
+ last_line = concat.match(/.*\z/)[0]
+ if last_line.size >= 100
+ acc + " \\\n " + elem
+ else
+ concat
+ end
+ end
+ "$ #{c.strip}"
+ end
+ alias_method :inspect, :to_s
+
+ def stdboth
+ @stdboth ||= [stderr, stdout].join("\n").strip
+ end
+
+ def bundler_err
+ if Bundler::VERSION.start_with?("1.")
+ stdout
+ else
+ stderr
+ end
+ end
+
+ def to_s_verbose
+ [
+ to_s,
+ stdout,
+ stderr,
+ exitstatus ? "# $? => #{exitstatus}" : "",
+ ].reject(&:empty?).join("\n")
+ end
+
+ def success?
+ return true unless exitstatus
+ exitstatus == 0
+ end
+
+ def failure?
+ return true unless exitstatus
+ exitstatus > 0
+ end
+ end
+end
diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb
index 663d3527c5..aee55a0ac9 100644
--- a/spec/bundler/support/hax.rb
+++ b/spec/bundler/support/hax.rb
@@ -1,7 +1,13 @@
# frozen_string_literal: true
+
require "rubygems"
module Gem
+ if version = ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"]
+ remove_const(:VERSION) if const_defined?(:VERSION)
+ VERSION = version
+ end
+
class Platform
@local = new(ENV["BUNDLER_SPEC_PLATFORM"]) if ENV["BUNDLER_SPEC_PLATFORM"]
end
@@ -45,3 +51,11 @@ class Object
end
end
end
+
+if ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"]
+ $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard.rb", __FILE__)
+ $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard", __FILE__)
+ $LOADED_FEATURES << "bundler/compatibility_guard.rb"
+ $LOADED_FEATURES << "bundler/compatibility_guard"
+ require "bundler/compatibility_guard"
+end
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index 192747da05..01ddb49977 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -4,7 +4,7 @@ module Spec
module Helpers
def reset!
Dir.glob("#{tmp}/{gems/*,*}", File::FNM_DOTMATCH).each do |dir|
- next if %w(base remote1 gems rubygems . ..).include?(File.basename(dir))
+ next if %w[base remote1 gems rubygems . ..].include?(File.basename(dir))
if ENV["BUNDLER_SUDO_TESTS"]
`sudo rm -rf "#{dir}"`
else
@@ -21,23 +21,39 @@ module Spec
def self.bang(method)
define_method("#{method}!") do |*args, &blk|
send(method, *args, &blk).tap do
- if exitstatus && exitstatus != 0
- error = out + "\n" + err
- error.strip!
+ unless last_command.success?
raise RuntimeError,
- "Invoking #{method}!(#{args.map(&:inspect).join(", ")}) failed:\n#{error}",
+ "Invoking #{method}!(#{args.map(&:inspect).join(", ")}) failed:\n#{last_command.stdboth}",
caller.drop_while {|bt| bt.start_with?(__FILE__) }
end
end
end
end
- attr_reader :out, :err, :exitstatus
-
def the_bundle(*args)
TheBundle.new(*args)
end
+ def last_command
+ @command_executions.last || raise("There is no last command")
+ end
+
+ def out
+ last_command.stdboth
+ end
+
+ def err
+ last_command.stderr
+ end
+
+ def exitstatus
+ last_command.exitstatus
+ end
+
+ def bundle_update_requires_all?
+ Bundler::VERSION.start_with?("1.") ? nil : true
+ end
+
def in_app_root(&blk)
Dir.chdir(bundled_app, &blk)
end
@@ -54,7 +70,7 @@ module Spec
opts = args.last.is_a?(Hash) ? args.pop : {}
groups = args.map(&:inspect).join(", ")
setup = "require 'rubygems' ; require 'bundler' ; Bundler.setup(#{groups})\n"
- @out = ruby(setup + cmd, opts)
+ ruby(setup + cmd, opts)
end
bang :run
@@ -83,7 +99,8 @@ module Spec
with_sudo = options.delete(:sudo)
sudo = with_sudo == :preserve_env ? "sudo -E" : "sudo" if with_sudo
- options["no-color"] = true unless options.key?("no-color") || cmd.to_s =~ /\A(e|ex|exe|exec|conf|confi|config)(\s|\z)/
+ no_color = options.delete("no-color") { cmd.to_s !~ /\A(e|ex|exe|exec|conf|confi|config)(\s|\z)/ }
+ options["no-color"] = true if no_color
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
@@ -91,11 +108,23 @@ module Spec
bundle_bin = "-S bundle"
end
+ env = options.delete(:env) || {}
+ env["PATH"].gsub!("#{Path.root}/exe", "") if env["PATH"] && system_bundler
+
requires = options.delete(:requires) || []
- if artifice = options.delete(:artifice) { "fail" unless RSpec.current_example.metadata[:realworld] }
- requires << File.expand_path("../artifice/#{artifice}.rb", __FILE__)
- end
requires << "support/hax"
+
+ artifice = options.delete(:artifice) do
+ if RSpec.current_example.metadata[:realworld]
+ "vcr"
+ else
+ "fail"
+ end
+ end
+ if artifice
+ requires << File.expand_path("../artifice/#{artifice}", __FILE__)
+ end
+
requires_str = requires.map {|r| "-r#{r}" }.join(" ")
load_path = []
@@ -103,10 +132,19 @@ module Spec
load_path << spec
load_path_str = "-I#{load_path.join(File::PATH_SEPARATOR)}"
- env = (options.delete(:env) || {}).map {|k, v| "#{k}='#{v}'" }.join(" ")
- env["PATH"].gsub!(Path.bindir, "") if env["PATH"] && system_bundler
+ env = env.map {|k, v| "#{k}='#{v}'" }.join(" ")
+
args = options.map do |k, v|
- v == true ? " --#{k}" : " --#{k} #{v}" if v
+ case v
+ when nil
+ next
+ when true
+ " --#{k}"
+ when false
+ " --no-#{k}"
+ else
+ " --#{k} #{v}"
+ end
end.join
cmd = "#{env} #{sudo} #{Gem.ruby} #{load_path_str} #{requires_str} #{bundle_bin} #{cmd}#{args}"
@@ -114,6 +152,24 @@ module Spec
end
bang :bundle
+ def forgotten_command_line_options(options)
+ remembered = Bundler::VERSION.split(".", 2).first == "1"
+ options = options.map do |k, v|
+ k = Array(k)[remembered ? 0 : -1]
+ v = '""' if v && v.to_s.empty?
+ [k, v]
+ end
+ return Hash[options] if remembered
+ options.each do |k, v|
+ if v.nil?
+ bundle! "config --delete #{k}"
+ else
+ bundle! "config --local #{k} #{v}"
+ end
+ end
+ {}
+ end
+
def bundler(cmd, options = {})
options["bundle_bin"] = bindir.join("bundler")
bundle(cmd, options)
@@ -171,24 +227,20 @@ module Spec
end
def sys_exec(cmd)
+ command_execution = CommandExecution.new(cmd.to_s, Dir.pwd)
+
Open3.popen3(cmd.to_s) do |stdin, stdout, stderr, wait_thr|
yield stdin, stdout, wait_thr if block_given?
stdin.close
- @exitstatus = wait_thr && wait_thr.value.exitstatus
- @out = Thread.new { stdout.read }.value.strip
- @err = Thread.new { stderr.read }.value.strip
+ command_execution.exitstatus = wait_thr && wait_thr.value.exitstatus
+ command_execution.stdout = Thread.new { stdout.read }.value.strip
+ command_execution.stderr = Thread.new { stderr.read }.value.strip
end
- (@all_output ||= String.new) << [
- "$ #{cmd.to_s.strip}",
- out,
- err,
- @exitstatus ? "# $? => #{@exitstatus}" : "",
- "\n",
- ].reject(&:empty?).join("\n")
+ (@command_executions ||= []) << command_execution
- @out
+ command_execution.stdout
end
bang :sys_exec
@@ -317,16 +369,32 @@ module Spec
end
def system_gems(*gems)
+ opts = gems.last.is_a?(Hash) ? gems.last : {}
+ path = opts.fetch(:path, system_gem_path)
+ if path == :bundle_path
+ path = ruby!(<<-RUBY)
+ require "bundler"
+ begin
+ puts Bundler.bundle_path
+ rescue Bundler::GemfileNotFound
+ ENV["BUNDLE_GEMFILE"] = "Gemfile"
+ retry
+ end
+
+ RUBY
+ end
gems = gems.flatten
- FileUtils.rm_rf(system_gem_path)
- FileUtils.mkdir_p(system_gem_path)
+ unless opts[:keep_path]
+ FileUtils.rm_rf(path)
+ FileUtils.mkdir_p(path)
+ end
Gem.clear_paths
env_backup = ENV.to_hash
- ENV["GEM_HOME"] = system_gem_path.to_s
- ENV["GEM_PATH"] = system_gem_path.to_s
+ ENV["GEM_HOME"] = path.to_s
+ ENV["GEM_PATH"] = path.to_s
ENV["BUNDLER_ORIG_GEM_PATH"] = nil
install_gems(*gems)
@@ -380,7 +448,7 @@ module Spec
def simulate_new_machine
system_gems []
- FileUtils.rm_rf default_bundle_path
+ FileUtils.rm_rf system_gem_path
FileUtils.rm_rf bundled_app(".bundle")
end
@@ -422,6 +490,14 @@ module Spec
ENV["BUNDLER_SPEC_VERSION"] = old if block_given?
end
+ def simulate_rubygems_version(version)
+ old = ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"]
+ ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"] = version.to_s
+ yield if block_given?
+ ensure
+ ENV["BUNDLER_SPEC_RUBYGEMS_VERSION"] = old if block_given?
+ end
+
def simulate_windows
old = ENV["BUNDLER_SPEC_WINDOWS"]
ENV["BUNDLER_SPEC_WINDOWS"] = "true"
@@ -500,5 +576,13 @@ module Spec
end
port
end
+
+ def bundler_fileutils
+ if RUBY_VERSION >= "2.4"
+ ::Bundler::FileUtils
+ else
+ ::FileUtils
+ end
+ end
end
end
diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb
index 29780014fc..05605195b1 100644
--- a/spec/bundler/support/indexes.rb
+++ b/spec/bundler/support/indexes.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module Indexes
def dep(name, reqs = nil)
@@ -16,12 +17,16 @@ module Spec
def resolve(args = [])
@platforms ||= ["ruby"]
deps = []
+ default_source = instance_double("Bundler::Source::Rubygems", :specs => @index)
+ source_requirements = { :default => default_source }
@deps.each do |d|
@platforms.each do |p|
+ source_requirements[d.name] = d.source = default_source
deps << Bundler::DepProxy.new(d, p)
end
end
- Bundler::Resolver.resolve(deps, @index, *args)
+ source_requirements ||= {}
+ Bundler::Resolver.resolve(deps, @index, source_requirements, *args)
end
def should_resolve_as(specs)
@@ -62,13 +67,16 @@ module Spec
s.level = opts.first
s.strict = opts.include?(:strict)
end
- should_resolve_and_include specs, [{}, @base, search]
+ should_resolve_and_include specs, [@base, search]
end
def an_awesome_index
build_index do
- gem "rack", %w(0.8 0.9 0.9.1 0.9.2 1.0 1.1)
- gem "rack-mount", %w(0.4 0.5 0.5.1 0.5.2 0.6)
+ gem "rack", %w[0.8 0.9 0.9.1 0.9.2 1.0 1.1]
+ gem "rack-mount", %w[0.4 0.5 0.5.1 0.5.2 0.6]
+
+ # --- Pre-release support
+ gem "rubygems\0", ["1.3.2"]
# --- Rails
versions "1.2.3 2.2.3 2.3.5 3.0.0.beta 3.0.0.beta1" do |version|
@@ -129,6 +137,14 @@ module Spec
dep "activesupport", ">= #{version}"
end
end
+
+ gem "reform", ["1.0.0"] do
+ dep "activesupport", ">= 1.0.0.beta1"
+ end
+
+ gem "need-pre", ["1.0.0"] do
+ dep "activesupport", "~> 3.0.0.beta1"
+ end
end
end
@@ -136,7 +152,7 @@ module Spec
# goes well, it should resolve to 3.0.4
def a_conflict_index
build_index do
- gem "builder", %w(3.0.4 3.1.4)
+ gem "builder", %w[3.0.4 3.1.4]
gem("grape", "0.2.6") do
dep "builder", ">= 0"
end
@@ -156,11 +172,11 @@ module Spec
def a_complex_conflict_index
build_index do
- gem("a", %w(1.0.2 1.1.4 1.2.0 1.4.0)) do
+ gem("a", %w[1.0.2 1.1.4 1.2.0 1.4.0]) do
dep "d", ">= 0"
end
- gem("d", %w(1.3.0 1.4.1)) do
+ gem("d", %w[1.3.0 1.4.1]) do
dep "x", ">= 0"
end
@@ -203,7 +219,7 @@ module Spec
def index_with_conflict_on_child
build_index do
- gem "json", %w(1.6.5 1.7.7 1.8.0)
+ gem "json", %w[1.6.5 1.7.7 1.8.0]
gem("chef", "10.26") do
dep "json", [">= 1.4.4", "<= 1.7.7"]
@@ -223,7 +239,7 @@ module Spec
# Issue #3459
def a_complicated_index
build_index do
- gem "foo", %w(3.0.0 3.0.5) do
+ gem "foo", %w[3.0.0 3.0.5] do
dep "qux", ["~> 3.1"]
dep "baz", ["< 9.0", ">= 5.0"]
dep "bar", ["~> 1.0"]
@@ -262,7 +278,7 @@ module Spec
dep "garply", [">= 0.3.1"]
end
- gem "grault", %w(2.6.3 3.1.1)
+ gem "grault", %w[2.6.3 3.1.1]
gem "garply", "0.5.1" do
dep "waldo", ["~> 0.1.3"]
@@ -272,7 +288,7 @@ module Spec
dep "plugh", ["~> 0.6.0"]
end
- gem "plugh", %w(0.6.3 0.6.11 0.7.0)
+ gem "plugh", %w[0.6.3 0.6.11 0.7.0]
gem "qux", "3.2.21" do
dep "plugh", [">= 0.6.4", "~> 0.6"]
@@ -285,7 +301,7 @@ module Spec
def a_unresovable_child_index
build_index do
- gem "json", %w(1.8.0)
+ gem "json", %w[1.8.0]
gem("chef", "10.26") do
dep "json", [">= 1.4.4", "<= 1.7.7"]
@@ -304,10 +320,10 @@ module Spec
def a_index_with_root_conflict_on_child
build_index do
- gem "builder", %w(2.1.2 3.0.1 3.1.3)
- gem "i18n", %w(0.4.1 0.4.2)
+ gem "builder", %w[2.1.2 3.0.1 3.1.3]
+ gem "i18n", %w[0.4.1 0.4.2]
- gem "activesupport", %w(3.0.0 3.0.1 3.0.5 3.1.7)
+ gem "activesupport", %w[3.0.0 3.0.1 3.0.5 3.1.7]
gem("activemodel", "3.0.5") do
dep "activesupport", "= 3.0.5"
@@ -361,5 +377,29 @@ module Spec
end
end
end
+
+ def an_ambiguous_index
+ build_index do
+ gem("a", "1.0.0") do
+ dep "c", ">= 0"
+ end
+
+ gem("b", %w[0.5.0 1.0.0])
+
+ gem("b", "2.0.0") do
+ dep "c", "< 2.0.0"
+ end
+
+ gem("c", "1.0.0") do
+ dep "d", "1.0.0"
+ end
+
+ gem("c", "2.0.0") do
+ dep "d", "2.0.0"
+ end
+
+ gem("d", %w[1.0.0 2.0.0])
+ end
+ end
end
end
diff --git a/spec/bundler/support/less_than_proc.rb b/spec/bundler/support/less_than_proc.rb
index 27966aa6ed..ddac5458b7 100644
--- a/spec/bundler/support/less_than_proc.rb
+++ b/spec/bundler/support/less_than_proc.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
class LessThanProc < Proc
attr_accessor :present
diff --git a/spec/bundler/support/manpages.rb b/spec/bundler/support/manpages.rb
new file mode 100644
index 0000000000..ce1f72cc49
--- /dev/null
+++ b/spec/bundler/support/manpages.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+module Spec
+ module Manpages
+ def self.setup
+ man_path = Spec::Path.root.join("man")
+ return if man_path.children(false).select {|file| file.extname == ".ronn" }.all? do |man|
+ Dir[man_path.join("#{man.to_s[0..-6]}*.txt").to_s].any?
+ end
+
+ system(Spec::Path.root.join("bin", "rake").to_s, "man:build") || raise("Failed building man pages")
+ end
+ end
+end
diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb
index 9248360639..782257a222 100644
--- a/spec/bundler/support/matchers.rb
+++ b/spec/bundler/support/matchers.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "forwardable"
require "support/the_bundle"
module Spec
@@ -78,7 +79,12 @@ module Spec
RSpec::Matchers.define :have_major_deprecation do |expected|
diffable
match do |actual|
- actual.split(MAJOR_DEPRECATION).any? do |d|
+ deprecations = actual.split(MAJOR_DEPRECATION)
+
+ return !expected.nil? if deprecations.size <= 1
+ return true if expected.nil?
+
+ deprecations.any? do |d|
!d.empty? && values_match?(expected, d.strip)
end
end
@@ -108,6 +114,20 @@ module Spec
end
end
+ RSpec::Matchers.define :be_sorted do
+ diffable
+ attr_reader :expected
+ match do |actual|
+ expected = block_arg ? actual.sort_by(&block_arg) : actual.sort
+ actual.==(expected).tap do
+ # HACK: since rspec won't show a diff when everything is a string
+ differ = RSpec::Support::Differ.new
+ @actual = differ.send(:object_to_string, actual)
+ @expected = differ.send(:object_to_string, expected)
+ end
+ end
+ end
+
define_compound_matcher :read_as, [exist] do |file_contents|
diffable
@@ -135,8 +155,8 @@ module Spec
rescue => e
next "#{name} is not installed:\n#{indent(e)}"
end
- out.gsub!(/#{MAJOR_DEPRECATION}.*$/, "")
- actual_version, actual_platform = out.strip.split(/\s+/, 2)
+ last_command.stdout.gsub!(/#{MAJOR_DEPRECATION}.*$/, "")
+ actual_version, actual_platform = last_command.stdout.strip.split(/\s+/, 2)
unless Gem::Version.new(actual_version) == Gem::Version.new(version)
next "#{name} was expected to be at version #{version} but was #{actual_version}"
end
@@ -150,8 +170,8 @@ module Spec
rescue
next "#{name} does not have a source defined:\n#{indent(e)}"
end
- out.gsub!(/#{MAJOR_DEPRECATION}.*$/, "")
- unless out.strip == source
+ last_command.stdout.gsub!(/#{MAJOR_DEPRECATION}.*$/, "")
+ unless last_command.stdout.strip == source
next "Expected #{name} (#{version}) to be installed from `#{source}`, was actually from `#{out}`"
end
end.compact
@@ -176,9 +196,9 @@ module Spec
rescue => e
next "checking for #{name} failed:\n#{e}"
end
- next if out == "WIN"
+ next if last_command.stdout == "WIN"
next "expected #{name} to not be installed, but it was" if version.nil?
- if Gem::Version.new(out) == Gem::Version.new(version)
+ if Gem::Version.new(last_command.stdout) == Gem::Version.new(version)
next "expected #{name} (#{version}) not to be installed, but it was"
end
end.compact
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index b58658e71a..17868b17d1 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "pathname"
module Spec
@@ -29,7 +30,11 @@ module Spec
end
def default_bundle_path(*path)
- system_gem_path(*path)
+ if Bundler::VERSION.split(".").first.to_i < 2
+ system_gem_path(*path)
+ else
+ bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), Gem::ConfigMap[:ruby_version], *path].compact)
+ end
end
def bundled_app(*path)
@@ -110,6 +115,9 @@ module Spec
private
def for_ruby_core?
+ # avoid to wornings
+ @for_ruby_core ||= nil
+
if @for_ruby_core.nil?
@for_ruby_core = true & (ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
else
diff --git a/spec/bundler/support/permissions.rb b/spec/bundler/support/permissions.rb
index f5636dd70a..b21ce3848d 100644
--- a/spec/bundler/support/permissions.rb
+++ b/spec/bundler/support/permissions.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module Permissions
def with_umask(new_umask)
diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb
index a2a3afba00..002350114b 100644
--- a/spec/bundler/support/platforms.rb
+++ b/spec/bundler/support/platforms.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module Platforms
include Bundler::GemHelpers
@@ -43,6 +44,10 @@ module Spec
generic_local_platform
end
+ def specific_local_platform
+ Bundler.local_platform
+ end
+
def not_local
all_platforms.find {|p| p != generic_local_platform }
end
@@ -94,5 +99,18 @@ module Spec
def not_local_patchlevel
9999
end
+
+ def lockfile_platforms(*platforms)
+ platforms = local_platforms if platforms.empty?
+ platforms.map(&:to_s).sort.join("\n ")
+ end
+
+ def local_platforms
+ if Bundler::VERSION.split(".").first.to_i > 1
+ [local, specific_local_platform]
+ else
+ [local]
+ end
+ end
end
end
diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb
index 596e1530d2..73e90f6883 100644
--- a/spec/bundler/support/rubygems_ext.rb
+++ b/spec/bundler/support/rubygems_ext.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "rubygems/user_interaction"
require "support/path" unless defined?(Spec::Path)
@@ -8,7 +9,9 @@ module Spec
deps = {
# rack 2.x requires Ruby version >= 2.2.2.
# artifice doesn't support rack 2.x now.
- "rack" => "< 2",
+ # TODO: revert to `< 2` once https://github.com/rack/rack/issues/1168 is
+ # addressed
+ "rack" => "1.6.6",
# rack-test 0.7.0 dropped 1.8.7 support
# https://github.com/rack-test/rack-test/issues/193#issuecomment-314230318
"rack-test" => "< 0.7.0",
@@ -19,7 +22,6 @@ module Spec
"rake" => "10.0.2",
# 3.0.0 breaks 1.9.2 specs
"builder" => "2.1.2",
- "bundler" => "1.12.0",
}
# ruby-graphviz is used by the viz tests
deps["ruby-graphviz"] = nil if RUBY_VERSION >= "1.9.3"
diff --git a/spec/bundler/support/silent_logger.rb b/spec/bundler/support/silent_logger.rb
index 1a8f91b3ba..8665beb2c9 100644
--- a/spec/bundler/support/silent_logger.rb
+++ b/spec/bundler/support/silent_logger.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "logger"
module Spec
class SilentLogger
diff --git a/spec/bundler/support/sometimes.rb b/spec/bundler/support/sometimes.rb
index 6a50f5ff4c..65a95ed59c 100644
--- a/spec/bundler/support/sometimes.rb
+++ b/spec/bundler/support/sometimes.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Sometimes
def run_with_retries(example_to_run, retries)
example = RSpec.current_example
diff --git a/spec/bundler/support/streams.rb b/spec/bundler/support/streams.rb
index 561b29092b..b9e1d292dc 100644
--- a/spec/bundler/support/streams.rb
+++ b/spec/bundler/support/streams.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "stringio"
def capture(*streams)
diff --git a/spec/bundler/support/sudo.rb b/spec/bundler/support/sudo.rb
index 8c82bb8c0f..04e9443945 100644
--- a/spec/bundler/support/sudo.rb
+++ b/spec/bundler/support/sudo.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module Sudo
def self.present?
diff --git a/spec/bundler/support/the_bundle.rb b/spec/bundler/support/the_bundle.rb
index 742d393425..c994eaae78 100644
--- a/spec/bundler/support/the_bundle.rb
+++ b/spec/bundler/support/the_bundle.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
require "support/helpers"
require "support/path"
diff --git a/spec/bundler/update/gems/post_install_spec.rb b/spec/bundler/update/gems/post_install_spec.rb
index 5a4fe7f321..2fb3547806 100644
--- a/spec/bundler/update/gems/post_install_spec.rb
+++ b/spec/bundler/update/gems/post_install_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle update" do
let(:config) {}
@@ -53,7 +52,7 @@ RSpec.describe "bundle update" do
gem 'thin'
G
- bundle! :update
+ bundle! :update, :all => bundle_update_requires_all?
end
it_behaves_like "a post-install message outputter"
@@ -68,7 +67,7 @@ RSpec.describe "bundle update" do
gem 'thin'
G
- bundle! :update
+ bundle! :update, :all => bundle_update_requires_all?
end
it_behaves_like "a post-install message outputter"
diff --git a/spec/bundler/update/git_spec.rb b/spec/bundler/update/git_spec.rb
index 021c8c942b..52c4fc0957 100644
--- a/spec/bundler/update/git_spec.rb
+++ b/spec/bundler/update/git_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "bundle update" do
describe "git sources" do
@@ -17,7 +16,7 @@ RSpec.describe "bundle update" do
s.write "lib/foo.rb", "FOO = '1.1'"
end
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(the_bundle).to include_gems "foo 1.1"
end
@@ -28,12 +27,11 @@ RSpec.describe "bundle update" do
s.add_dependency "activesupport", "= 3.0"
end
- install_gemfile <<-G
+ install_gemfile! <<-G
gem "rails", :git => "#{lib_path("rails")}"
G
- bundle "update rails"
- expect(out).to include("Using activesupport 3.0 from #{lib_path("rails")} (at master@#{revision_for(lib_path("rails"))[0..6]})")
+ bundle! "update rails"
expect(the_bundle).to include_gems "rails 3.0", "activesupport 3.0"
end
@@ -58,7 +56,7 @@ RSpec.describe "bundle update" do
it "floats on master when updating all gems that are pinned to the source even if you have child dependencies" do
build_git "foo", :path => lib_path("foo")
- build_gem "bar", :to_system => true do |s|
+ build_gem "bar", :to_bundle => true do |s|
s.add_dependency "foo"
end
@@ -113,14 +111,16 @@ RSpec.describe "bundle update" do
gem 'foo', :git => "#{@remote.path}", :tag => "fubar"
G
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(exitstatus).to eq(0) if exitstatus
end
describe "with submodules" do
before :each do
- build_gem "submodule", :to_system => true do |s|
- s.write "lib/submodule.rb", "puts 'GEM'"
+ build_repo4 do
+ build_gem "submodule" do |s|
+ s.write "lib/submodule.rb", "puts 'GEM'"
+ end
end
build_git "submodule", "1.0" do |s|
@@ -139,6 +139,7 @@ RSpec.describe "bundle update" do
it "it unlocks the source when submodules are added to a git source" do
install_gemfile <<-G
+ source "file:#{gem_repo4}"
git "#{lib_path("has_submodule-1.0")}" do
gem "has_submodule"
end
@@ -148,6 +149,7 @@ RSpec.describe "bundle update" do
expect(out).to eq("GEM")
install_gemfile <<-G
+ source "file:#{gem_repo4}"
git "#{lib_path("has_submodule-1.0")}", :submodules => true do
gem "has_submodule"
end
@@ -158,22 +160,24 @@ RSpec.describe "bundle update" do
end
it "unlocks the source when submodules are removed from git source", :git => ">= 2.9.0" do
- install_gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
git "#{lib_path("has_submodule-1.0")}", :submodules => true do
gem "has_submodule"
end
G
- run "require 'submodule'"
+ run! "require 'submodule'"
expect(out).to eq("GIT")
- install_gemfile <<-G
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
git "#{lib_path("has_submodule-1.0")}" do
gem "has_submodule"
end
G
- run "require 'submodule'"
+ run! "require 'submodule'"
expect(out).to eq("GEM")
end
end
@@ -187,8 +191,9 @@ RSpec.describe "bundle update" do
lib_path("foo-1.0").join(".git").rmtree
- bundle :update
- expect(out).to include(lib_path("foo-1.0").to_s)
+ bundle :update, :all => bundle_update_requires_all?
+ expect(last_command.bundler_err).to include(lib_path("foo-1.0").to_s).
+ and match(/Git error: command `git fetch.+has failed/)
end
it "should not explode on invalid revision on update of gem by name" do
@@ -228,7 +233,7 @@ RSpec.describe "bundle update" do
rails!
G
- bundle "update"
+ bundle "update", :all => bundle_update_requires_all?
expect(out).to include("Using rails 3.0 (was 2.3.2) from #{lib_path("rails")} (at master@#{revision_for(lib_path("rails"))[0..6]})")
end
end
@@ -294,7 +299,7 @@ RSpec.describe "bundle update" do
G
end
- it "the --source flag updates version of gems that were originally pulled in by the source" do
+ it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "< 2" do
spec_lines = lib_path("bar/foo.gemspec").read.split("\n")
spec_lines[5] = "s.version = '2.0'"
@@ -329,5 +334,41 @@ RSpec.describe "bundle update" do
#{Bundler::VERSION}
G
end
+
+ it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "2" do
+ spec_lines = lib_path("bar/foo.gemspec").read.split("\n")
+ spec_lines[5] = "s.version = '2.0'"
+
+ update_git "foo", "2.0", :path => @git.path do |s|
+ s.write "foo.gemspec", spec_lines.join("\n")
+ end
+
+ ref = @git.ref_for "master"
+
+ bundle "update --source bar"
+
+ lockfile_should_be <<-G
+ GEM
+ remote: file:#{gem_repo2}/
+ specs:
+ rack (1.0.0)
+
+ GIT
+ remote: #{@git.path}
+ revision: #{ref}
+ specs:
+ foo (2.0)
+
+ PLATFORMS
+ #{lockfile_platforms}
+
+ DEPENDENCIES
+ foo!
+ rack
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ G
+ end
end
end
diff --git a/spec/bundler/update/path_spec.rb b/spec/bundler/update/path_spec.rb
index 5ac4f7b1fe..38c125e04b 100644
--- a/spec/bundler/update/path_spec.rb
+++ b/spec/bundler/update/path_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "path sources" do
describe "bundle update --source" do