rubygems-update 3.0.9 → 3.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +31 -8
- data/.travis.yml +9 -27
- data/CONTRIBUTING.md +13 -0
- data/History.txt +24 -28
- data/MAINTAINERS.txt +1 -6
- data/Manifest.txt +65 -15
- data/Rakefile +39 -23
- data/bin/gem +0 -6
- data/bundler/CHANGELOG.md +746 -570
- data/bundler/CODE_OF_CONDUCT.md +117 -23
- data/bundler/LICENSE.md +18 -19
- data/bundler/README.md +9 -8
- data/bundler/bundler.gemspec +8 -25
- data/bundler/exe/bundle +19 -3
- data/bundler/lib/bundler.rb +120 -67
- data/bundler/lib/bundler/build_metadata.rb +1 -3
- data/bundler/lib/bundler/capistrano.rb +4 -4
- data/bundler/lib/bundler/cli.rb +129 -121
- data/bundler/lib/bundler/cli/add.rb +27 -16
- data/bundler/lib/bundler/cli/common.rb +11 -12
- data/bundler/lib/bundler/cli/config.rb +161 -86
- data/bundler/lib/bundler/cli/console.rb +1 -1
- data/bundler/lib/bundler/cli/doctor.rb +4 -4
- data/bundler/lib/bundler/cli/exec.rb +4 -9
- data/bundler/lib/bundler/cli/gem.rb +5 -5
- data/bundler/lib/bundler/cli/info.rb +17 -5
- data/bundler/lib/bundler/cli/init.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +11 -10
- data/bundler/lib/bundler/cli/issue.rb +3 -3
- data/bundler/lib/bundler/cli/open.rb +10 -6
- data/bundler/lib/bundler/cli/outdated.rb +85 -81
- data/bundler/lib/bundler/cli/package.rb +8 -9
- data/bundler/lib/bundler/cli/plugin.rb +9 -2
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +1 -1
- data/bundler/lib/bundler/cli/update.rb +31 -11
- data/bundler/lib/bundler/compact_index_client.rb +25 -9
- data/bundler/lib/bundler/compact_index_client/updater.rb +2 -6
- data/bundler/lib/bundler/current_ruby.rb +9 -7
- data/bundler/lib/bundler/definition.rb +35 -26
- data/bundler/lib/bundler/dependency.rb +16 -4
- data/bundler/lib/bundler/deployment.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +15 -39
- data/bundler/lib/bundler/env.rb +8 -13
- data/bundler/lib/bundler/environment_preserver.rb +0 -1
- data/bundler/lib/bundler/feature_flag.rb +23 -34
- data/bundler/lib/bundler/fetcher.rb +14 -11
- data/bundler/lib/bundler/fetcher/compact_index.rb +26 -12
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +4 -1
- data/bundler/lib/bundler/fetcher/index.rb +4 -2
- data/bundler/lib/bundler/friendly_errors.rb +4 -5
- data/bundler/lib/bundler/gem_helper.rb +39 -24
- data/bundler/lib/bundler/gem_helpers.rb +2 -4
- data/bundler/lib/bundler/gem_tasks.rb +1 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +3 -3
- data/bundler/lib/bundler/graph.rb +2 -2
- data/bundler/lib/bundler/injector.rb +10 -8
- data/bundler/lib/bundler/inline.rb +19 -18
- data/bundler/lib/bundler/installer.rb +7 -14
- data/bundler/lib/bundler/installer/gem_installer.rb +5 -1
- data/bundler/lib/bundler/installer/parallel_installer.rb +4 -8
- data/bundler/lib/bundler/installer/standalone.rb +1 -2
- data/bundler/lib/bundler/lazy_specification.rb +2 -2
- data/bundler/lib/bundler/lockfile_parser.rb +13 -21
- data/bundler/lib/bundler/match_platform.rb +1 -1
- data/bundler/lib/bundler/plugin.rb +42 -29
- data/bundler/lib/bundler/plugin/api.rb +1 -1
- data/bundler/lib/bundler/plugin/api/source.rb +2 -2
- data/bundler/lib/bundler/plugin/index.rb +14 -3
- data/bundler/lib/bundler/plugin/installer.rb +28 -15
- data/bundler/lib/bundler/psyched_yaml.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +72 -24
- data/bundler/lib/bundler/resolver/spec_group.rb +3 -2
- data/bundler/lib/bundler/retry.rb +2 -2
- data/bundler/lib/bundler/ruby_version.rb +4 -19
- data/bundler/lib/bundler/rubygems_ext.rb +10 -66
- data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -8
- data/bundler/lib/bundler/rubygems_integration.rb +144 -395
- data/bundler/lib/bundler/runtime.rb +2 -9
- data/bundler/lib/bundler/settings.rb +15 -47
- data/bundler/lib/bundler/setup.rb +6 -5
- data/bundler/lib/bundler/shared_helpers.rb +58 -71
- data/bundler/lib/bundler/similarity_detector.rb +2 -2
- data/bundler/lib/bundler/source.rb +5 -5
- data/bundler/lib/bundler/source/git.rb +19 -12
- data/bundler/lib/bundler/source/git/git_proxy.rb +35 -39
- data/bundler/lib/bundler/source/metadata.rb +7 -2
- data/bundler/lib/bundler/source/path.rb +13 -8
- data/bundler/lib/bundler/source/rubygems.rb +11 -5
- data/bundler/lib/bundler/source/rubygems/remote.rb +1 -2
- data/bundler/lib/bundler/source_list.rb +9 -12
- data/bundler/lib/bundler/spec_set.rb +23 -12
- data/bundler/lib/bundler/stub_specification.rb +18 -30
- data/bundler/lib/bundler/templates/Executable.bundler +23 -14
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/bundler/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -27
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/bundler/lib/bundler/ui.rb +3 -3
- data/bundler/lib/bundler/ui/rg_proxy.rb +1 -1
- data/bundler/lib/bundler/ui/shell.rb +4 -8
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +151 -48
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +5 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +6 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +30 -8
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +248 -279
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +7 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -11
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +11 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +16 -17
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +82 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +7 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +6 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +52 -7
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendored_fileutils.rb +1 -6
- data/bundler/lib/bundler/vendored_molinillo.rb +1 -1
- data/bundler/lib/bundler/vendored_persistent.rb +7 -5
- data/bundler/lib/bundler/vendored_thor.rb +2 -2
- data/bundler/lib/bundler/version.rb +1 -20
- data/bundler/lib/bundler/version_ranges.rb +51 -5
- data/bundler/lib/bundler/vlad.rb +2 -2
- data/bundler/lib/bundler/worker.rb +1 -3
- data/bundler/lib/bundler/yaml_serializer.rb +2 -3
- data/bundler/man/bundle-add.1 +66 -0
- data/bundler/man/bundle-add.1.txt +58 -0
- data/bundler/man/bundle-add.ronn +7 -1
- data/bundler/man/bundle-binstubs.1 +40 -0
- data/bundler/man/bundle-binstubs.1.txt +48 -0
- data/bundler/man/bundle-binstubs.ronn +1 -1
- data/bundler/man/bundle-check.1 +31 -0
- data/bundler/man/bundle-check.1.txt +33 -0
- data/bundler/man/bundle-clean.1 +24 -0
- data/bundler/man/bundle-clean.1.txt +26 -0
- data/bundler/man/bundle-config.1 +497 -0
- data/bundler/man/bundle-config.1.txt +528 -0
- data/bundler/man/bundle-config.ronn +42 -40
- data/bundler/man/bundle-doctor.1 +44 -0
- data/bundler/man/bundle-doctor.1.txt +44 -0
- data/bundler/man/bundle-exec.1 +165 -0
- data/bundler/man/bundle-exec.1.txt +178 -0
- data/bundler/man/bundle-exec.ronn +1 -1
- data/bundler/man/bundle-gem.1 +80 -0
- data/bundler/man/bundle-gem.1.txt +91 -0
- data/bundler/man/bundle-info.1 +20 -0
- data/bundler/man/bundle-info.1.txt +21 -0
- data/bundler/man/bundle-init.1 +25 -0
- data/bundler/man/bundle-init.1.txt +34 -0
- data/bundler/man/bundle-init.ronn +1 -1
- data/bundler/man/bundle-inject.1 +33 -0
- data/bundler/man/bundle-inject.1.txt +32 -0
- data/bundler/man/bundle-install.1 +311 -0
- data/bundler/man/bundle-install.1.txt +401 -0
- data/bundler/man/bundle-install.ronn +9 -4
- data/bundler/man/bundle-list.1 +50 -0
- data/bundler/man/bundle-list.1.txt +43 -0
- data/bundler/man/bundle-lock.1 +84 -0
- data/bundler/man/bundle-lock.1.txt +93 -0
- data/bundler/man/bundle-open.1 +32 -0
- data/bundler/man/bundle-open.1.txt +29 -0
- data/bundler/man/bundle-outdated.1 +155 -0
- data/bundler/man/bundle-outdated.1.txt +131 -0
- data/bundler/man/bundle-package.1 +55 -0
- data/bundler/man/bundle-package.1.txt +79 -0
- data/bundler/man/bundle-platform.1 +61 -0
- data/bundler/man/bundle-platform.1.txt +57 -0
- data/bundler/man/bundle-pristine.1 +34 -0
- data/bundler/man/bundle-pristine.1.txt +44 -0
- data/bundler/man/bundle-remove.1 +31 -0
- data/bundler/man/bundle-remove.1.txt +34 -0
- data/bundler/man/bundle-show.1 +23 -0
- data/bundler/man/bundle-show.1.txt +27 -0
- data/bundler/man/bundle-update.1 +394 -0
- data/bundler/man/bundle-update.1.txt +390 -0
- data/bundler/man/bundle-update.ronn +3 -3
- data/bundler/man/bundle-viz.1 +39 -0
- data/bundler/man/bundle-viz.1.txt +39 -0
- data/bundler/man/bundle.1 +136 -0
- data/bundler/man/bundle.1.txt +116 -0
- data/bundler/man/bundle.ronn +2 -2
- data/bundler/man/gemfile.5 +686 -0
- data/bundler/man/gemfile.5.ronn +14 -18
- data/bundler/man/gemfile.5.txt +649 -0
- data/bundler/man/index.txt +25 -0
- data/lib/rubygems.rb +80 -48
- data/lib/rubygems/available_set.rb +1 -0
- data/lib/rubygems/basic_specification.rb +17 -6
- data/lib/rubygems/bundler_version_finder.rb +5 -0
- data/lib/rubygems/command.rb +34 -5
- data/lib/rubygems/command_manager.rb +0 -6
- data/lib/rubygems/commands/build_command.rb +21 -8
- data/lib/rubygems/commands/cert_command.rb +0 -1
- data/lib/rubygems/commands/cleanup_command.rb +7 -7
- data/lib/rubygems/commands/contents_command.rb +3 -3
- data/lib/rubygems/commands/dependency_command.rb +4 -3
- data/lib/rubygems/commands/environment_command.rb +0 -3
- data/lib/rubygems/commands/info_command.rb +2 -0
- data/lib/rubygems/commands/install_command.rb +12 -52
- data/lib/rubygems/commands/lock_command.rb +2 -2
- data/lib/rubygems/commands/mirror_command.rb +1 -0
- data/lib/rubygems/commands/open_command.rb +2 -1
- data/lib/rubygems/commands/outdated_command.rb +1 -0
- data/lib/rubygems/commands/owner_command.rb +2 -7
- data/lib/rubygems/commands/pristine_command.rb +3 -0
- data/lib/rubygems/commands/push_command.rb +4 -6
- data/lib/rubygems/commands/query_command.rb +94 -80
- data/lib/rubygems/commands/rdoc_command.rb +1 -0
- data/lib/rubygems/commands/setup_command.rb +10 -8
- data/lib/rubygems/commands/signin_command.rb +1 -0
- data/lib/rubygems/commands/specification_command.rb +1 -0
- data/lib/rubygems/commands/stale_command.rb +2 -0
- data/lib/rubygems/commands/uninstall_command.rb +1 -0
- data/lib/rubygems/commands/unpack_command.rb +2 -29
- data/lib/rubygems/commands/update_command.rb +14 -14
- data/lib/rubygems/commands/which_command.rb +1 -0
- data/lib/rubygems/commands/yank_command.rb +8 -2
- data/lib/rubygems/compatibility.rb +4 -4
- data/lib/rubygems/config_file.rb +28 -23
- data/lib/rubygems/core_ext/kernel_gem.rb +2 -5
- data/lib/rubygems/core_ext/kernel_require.rb +29 -2
- data/lib/rubygems/core_ext/kernel_warn.rb +10 -4
- data/lib/rubygems/defaults.rb +10 -17
- data/lib/rubygems/dependency.rb +21 -6
- data/lib/rubygems/dependency_installer.rb +19 -102
- data/lib/rubygems/dependency_list.rb +11 -10
- data/lib/rubygems/deprecate.rb +5 -5
- data/lib/rubygems/errors.rb +11 -2
- data/lib/rubygems/exceptions.rb +9 -0
- data/lib/rubygems/ext/builder.rb +24 -43
- data/lib/rubygems/ext/cmake_builder.rb +2 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +11 -9
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/gemcutter_utilities.rb +19 -26
- data/lib/rubygems/indexer.rb +9 -5
- data/lib/rubygems/installer.rb +26 -13
- data/lib/rubygems/installer_test_case.rb +86 -38
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +4 -1
- data/lib/rubygems/name_tuple.rb +1 -0
- data/lib/rubygems/package.rb +37 -9
- data/lib/rubygems/package/tar_writer.rb +4 -4
- data/lib/rubygems/path_support.rb +2 -0
- data/lib/rubygems/platform.rb +2 -1
- data/lib/rubygems/psych_tree.rb +2 -0
- data/lib/rubygems/remote_fetcher.rb +5 -1
- data/lib/rubygems/request.rb +5 -3
- data/lib/rubygems/request/connection_pools.rb +4 -4
- data/lib/rubygems/request/http_pool.rb +1 -0
- data/lib/rubygems/request/https_pool.rb +2 -0
- data/lib/rubygems/request_set.rb +2 -2
- data/lib/rubygems/request_set/gem_dependency_api.rb +2 -2
- data/lib/rubygems/request_set/lockfile.rb +5 -2
- data/lib/rubygems/request_set/lockfile/parser.rb +4 -2
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -0
- data/lib/rubygems/requirement.rb +20 -18
- data/lib/rubygems/resolver.rb +4 -5
- data/lib/rubygems/resolver/activation_request.rb +19 -49
- data/lib/rubygems/resolver/best_set.rb +2 -2
- data/lib/rubygems/resolver/conflict.rb +0 -5
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/lock_set.rb +1 -1
- data/lib/rubygems/resolver/lock_specification.rb +2 -2
- data/lib/rubygems/resolver/requirement_list.rb +1 -0
- data/lib/rubygems/resolver/specification.rb +1 -0
- data/lib/rubygems/resolver/stats.rb +2 -0
- data/lib/rubygems/security/signer.rb +3 -2
- data/lib/rubygems/server.rb +5 -4
- data/lib/rubygems/source_list.rb +1 -0
- data/lib/rubygems/spec_fetcher.rb +3 -16
- data/lib/rubygems/specification.rb +69 -133
- data/lib/rubygems/specification_policy.rb +7 -2
- data/{bundler/lib/bundler → lib/rubygems}/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -0
- data/{bundler/lib/bundler → lib/rubygems}/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -0
- data/{bundler/lib/bundler → lib/rubygems}/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -0
- data/lib/rubygems/stub_specification.rb +5 -2
- data/lib/rubygems/syck_hack.rb +2 -0
- data/lib/rubygems/test_case.rb +78 -227
- data/lib/rubygems/test_utilities.rb +17 -6
- data/lib/rubygems/text.rb +2 -3
- data/lib/rubygems/uninstaller.rb +15 -15
- data/lib/rubygems/user_interaction.rb +9 -1
- data/lib/rubygems/util.rb +5 -41
- data/lib/rubygems/util/licenses.rb +398 -396
- data/lib/rubygems/util/list.rb +2 -0
- data/lib/rubygems/validator.rb +9 -29
- data/lib/rubygems/version.rb +5 -3
- data/rubygems-update.gemspec +3 -3
- data/test/rubygems/plugin/load/rubygems_plugin.rb +2 -0
- data/test/rubygems/test_bundled_ca.rb +4 -7
- data/test/rubygems/test_deprecate.rb +3 -0
- data/test/rubygems/test_gem.rb +183 -176
- data/test/rubygems/test_gem_available_set.rb +3 -2
- data/test/rubygems/test_gem_bundler_version_finder.rb +3 -1
- data/test/rubygems/test_gem_command.rb +94 -5
- data/test/rubygems/test_gem_command_manager.rb +5 -13
- data/test/rubygems/test_gem_commands_build_command.rb +142 -4
- data/test/rubygems/test_gem_commands_cert_command.rb +15 -1
- data/test/rubygems/test_gem_commands_cleanup_command.rb +22 -6
- data/test/rubygems/test_gem_commands_dependency_command.rb +1 -1
- data/test/rubygems/test_gem_commands_environment_command.rb +1 -11
- data/test/rubygems/test_gem_commands_help_command.rb +2 -0
- data/test/rubygems/test_gem_commands_info_command.rb +1 -0
- data/test/rubygems/test_gem_commands_install_command.rb +207 -2
- data/test/rubygems/test_gem_commands_mirror.rb +1 -0
- data/test/rubygems/test_gem_commands_outdated_command.rb +1 -0
- data/test/rubygems/test_gem_commands_owner_command.rb +4 -5
- data/test/rubygems/test_gem_commands_pristine_command.rb +56 -4
- data/test/rubygems/test_gem_commands_push_command.rb +19 -14
- data/test/rubygems/test_gem_commands_query_command.rb +27 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +62 -37
- data/test/rubygems/test_gem_commands_signin_command.rb +5 -4
- data/test/rubygems/test_gem_commands_sources_command.rb +20 -6
- data/test/rubygems/test_gem_commands_uninstall_command.rb +107 -50
- data/test/rubygems/test_gem_commands_update_command.rb +86 -23
- data/test/rubygems/test_gem_commands_yank_command.rb +46 -1
- data/test/rubygems/test_gem_config_file.rb +9 -2
- data/test/rubygems/test_gem_dependency.rb +6 -0
- data/test/rubygems/test_gem_dependency_installer.rb +67 -36
- data/test/rubygems/test_gem_dependency_list.rb +21 -14
- data/test/rubygems/test_gem_ext_builder.rb +5 -1
- data/test/rubygems/test_gem_ext_cmake_builder.rb +2 -0
- data/test/rubygems/test_gem_ext_configure_builder.rb +8 -0
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +12 -0
- data/test/rubygems/test_gem_ext_rake_builder.rb +2 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -8
- data/test/rubygems/test_gem_indexer.rb +31 -40
- data/test/rubygems/test_gem_install_update_options.rb +31 -17
- data/test/rubygems/test_gem_installer.rb +383 -223
- data/test/rubygems/test_gem_package.rb +99 -14
- data/test/rubygems/test_gem_package_old.rb +57 -54
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +6 -5
- data/test/rubygems/test_gem_package_tar_writer.rb +11 -6
- data/test/rubygems/test_gem_path_support.rb +19 -13
- data/test/rubygems/test_gem_platform.rb +4 -2
- data/test/rubygems/test_gem_rdoc.rb +1 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +29 -16
- data/test/rubygems/test_gem_request.rb +19 -4
- data/test/rubygems/test_gem_request_connection_pools.rb +6 -2
- data/test/rubygems/test_gem_request_set.rb +33 -8
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +1 -1
- data/test/rubygems/test_gem_request_set_lockfile.rb +1 -0
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +2 -1
- data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +2 -0
- data/test/rubygems/test_gem_requirement.rb +7 -1
- data/test/rubygems/test_gem_resolver.rb +67 -23
- data/test/rubygems/test_gem_resolver_activation_request.rb +3 -32
- data/test/rubygems/test_gem_resolver_conflict.rb +0 -4
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -0
- data/test/rubygems/test_gem_resolver_index_specification.rb +7 -2
- data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -1
- data/test/rubygems/test_gem_resolver_installer_set.rb +3 -1
- data/test/rubygems/test_gem_resolver_specification.rb +2 -0
- data/test/rubygems/test_gem_security.rb +6 -2
- data/test/rubygems/test_gem_security_signer.rb +1 -0
- data/test/rubygems/test_gem_server.rb +7 -2
- data/test/rubygems/test_gem_silent_ui.rb +1 -0
- data/test/rubygems/test_gem_source.rb +7 -7
- data/test/rubygems/test_gem_source_fetch_problem.rb +1 -0
- data/test/rubygems/test_gem_source_git.rb +4 -9
- data/test/rubygems/test_gem_source_installed.rb +6 -6
- data/test/rubygems/test_gem_source_list.rb +1 -0
- data/test/rubygems/test_gem_source_local.rb +5 -4
- data/test/rubygems/test_gem_source_lock.rb +12 -12
- data/test/rubygems/test_gem_source_specific_file.rb +7 -6
- data/test/rubygems/test_gem_source_vendor.rb +4 -4
- data/test/rubygems/test_gem_specification.rb +75 -43
- data/test/rubygems/test_gem_stream_ui.rb +2 -0
- data/test/rubygems/test_gem_stub_specification.rb +3 -1
- data/test/rubygems/test_gem_text.rb +1 -0
- data/test/rubygems/test_gem_uninstaller.rb +31 -10
- data/test/rubygems/test_gem_util.rb +6 -4
- data/test/rubygems/test_gem_validator.rb +3 -4
- data/test/rubygems/test_gem_version.rb +16 -8
- data/test/rubygems/test_kernel.rb +1 -0
- data/test/rubygems/test_rake_package.rb +26 -0
- data/test/rubygems/test_remote_fetch_error.rb +1 -0
- data/test/rubygems/test_require.rb +107 -3
- data/util/bisect +31 -0
- data/util/ci.sh +50 -0
- data/util/generate_spdx_license_list.rb +4 -2
- data/util/rubocop +2 -2
- data/util/update_bundled_ca_certificates.rb +3 -1
- metadata +97 -25
- data/appveyor.yml +0 -43
- data/bundler/CONTRIBUTING.md +0 -17
- data/bundler/exe/bundle_ruby +0 -60
- data/bundler/lib/bundler/cli/cache.rb +0 -36
- data/bundler/lib/bundler/compatibility_guard.rb +0 -14
- data/bundler/lib/bundler/ssl_certs/.document +0 -1
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +0 -21
- data/util/ci +0 -82
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "remote_specification"
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class StubSpecification < RemoteSpecification
|
@@ -13,17 +13,13 @@ module Bundler
|
|
13
13
|
|
14
14
|
attr_accessor :stub, :ignored
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
return unless source.respond_to?(:extension_dir_name)
|
24
|
-
path = File.join(stub.extensions_dir, source.extension_dir_name)
|
25
|
-
stub.extension_dir = File.expand_path(path)
|
26
|
-
end
|
16
|
+
def source=(source)
|
17
|
+
super
|
18
|
+
# Stub has no concept of source, which means that extension_dir may be wrong
|
19
|
+
# This is the case for git-based gems. So, instead manually assign the extension dir
|
20
|
+
return unless source.respond_to?(:extension_dir_name)
|
21
|
+
path = File.join(stub.extensions_dir, source.extension_dir_name)
|
22
|
+
stub.extension_dir = File.expand_path(path)
|
27
23
|
end
|
28
24
|
|
29
25
|
def to_yaml
|
@@ -32,11 +28,9 @@ module Bundler
|
|
32
28
|
|
33
29
|
# @!group Stub Delegates
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
stub.missing_extensions?
|
39
|
-
end
|
31
|
+
# This is defined directly to avoid having to load every installed spec
|
32
|
+
def missing_extensions?
|
33
|
+
stub.missing_extensions?
|
40
34
|
end
|
41
35
|
|
42
36
|
def activated
|
@@ -57,26 +51,20 @@ module Bundler
|
|
57
51
|
stub.full_gem_path || method_missing(:full_gem_path)
|
58
52
|
end
|
59
53
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
54
|
+
def full_require_paths
|
55
|
+
stub.full_require_paths
|
56
|
+
end
|
64
57
|
|
65
|
-
|
66
|
-
|
67
|
-
def load_paths
|
68
|
-
full_require_paths
|
69
|
-
end
|
58
|
+
def load_paths
|
59
|
+
full_require_paths
|
70
60
|
end
|
71
61
|
|
72
62
|
def loaded_from
|
73
63
|
stub.loaded_from
|
74
64
|
end
|
75
65
|
|
76
|
-
|
77
|
-
|
78
|
-
stub.matches_for_glob(glob)
|
79
|
-
end
|
66
|
+
def matches_for_glob(glob)
|
67
|
+
stub.matches_for_glob(glob)
|
80
68
|
end
|
81
69
|
|
82
70
|
def raw_require_paths
|
@@ -11,7 +11,7 @@
|
|
11
11
|
require "rubygems"
|
12
12
|
|
13
13
|
m = Module.new do
|
14
|
-
|
14
|
+
module_function
|
15
15
|
|
16
16
|
def invoked_as_script?
|
17
17
|
File.expand_path($0) == File.expand_path(__FILE__)
|
@@ -31,7 +31,7 @@ m = Module.new do
|
|
31
31
|
bundler_version = a
|
32
32
|
end
|
33
33
|
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
-
bundler_version = $1
|
34
|
+
bundler_version = $1
|
35
35
|
update_index = i
|
36
36
|
end
|
37
37
|
bundler_version
|
@@ -61,32 +61,41 @@ m = Module.new do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def bundler_version
|
64
|
-
@bundler_version ||=
|
64
|
+
@bundler_version ||=
|
65
65
|
env_var_version || cli_arg_version ||
|
66
|
-
lockfile_version
|
67
|
-
|
66
|
+
lockfile_version
|
67
|
+
end
|
68
|
+
|
69
|
+
def bundler_requirement
|
70
|
+
return "#{Gem::Requirement.default}.a" unless bundler_version
|
71
|
+
|
72
|
+
bundler_gem_version = Gem::Version.new(bundler_version)
|
73
|
+
|
74
|
+
requirement = bundler_gem_version.approximate_recommendation
|
75
|
+
|
76
|
+
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
|
77
|
+
|
78
|
+
requirement += ".a" if bundler_gem_version.prerelease?
|
79
|
+
|
80
|
+
requirement
|
68
81
|
end
|
69
82
|
|
70
83
|
def load_bundler!
|
71
84
|
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
72
85
|
|
73
|
-
|
74
|
-
activate_bundler(bundler_version.dup)
|
86
|
+
activate_bundler
|
75
87
|
end
|
76
88
|
|
77
|
-
def activate_bundler
|
78
|
-
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
|
79
|
-
bundler_version = "< 2"
|
80
|
-
end
|
89
|
+
def activate_bundler
|
81
90
|
gem_error = activation_error_handling do
|
82
|
-
gem "bundler",
|
91
|
+
gem "bundler", bundler_requirement
|
83
92
|
end
|
84
93
|
return if gem_error.nil?
|
85
94
|
require_error = activation_error_handling do
|
86
95
|
require "bundler/version"
|
87
96
|
end
|
88
|
-
return if require_error.nil? && Gem::Requirement.new(
|
89
|
-
warn "Activating bundler (#{
|
97
|
+
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
98
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
90
99
|
exit 42
|
91
100
|
end
|
92
101
|
|
@@ -68,7 +68,7 @@ members of the project's leadership.
|
|
68
68
|
## Attribution
|
69
69
|
|
70
70
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
72
|
|
73
|
-
[homepage]:
|
74
|
-
[version]:
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
@@ -1,6 +1,12 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
-
|
5
3
|
# Specify your gem's dependencies in <%= config[:name] %>.gemspec
|
6
4
|
gemspec
|
5
|
+
|
6
|
+
gem "rake", "~> 12.0"
|
7
|
+
<%- if config[:ext] -%>
|
8
|
+
gem "rake-compiler"
|
9
|
+
<%- end -%>
|
10
|
+
<%- if config[:test] -%>
|
11
|
+
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
12
|
+
<%- end -%>
|
@@ -14,7 +14,7 @@ gem '<%= config[:name] %>'
|
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
$ bundle
|
17
|
+
$ bundle install
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
@@ -32,7 +32,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
|
36
|
+
|
36
37
|
<% if config[:mit] -%>
|
37
38
|
|
38
39
|
## License
|
@@ -43,5 +44,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
43
44
|
|
44
45
|
## Code of Conduct
|
45
46
|
|
46
|
-
Everyone interacting in the <%= config[:constant_name] %> project
|
47
|
+
Everyone interacting in the <%= config[:constant_name] %> project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).
|
47
48
|
<% end -%>
|
@@ -1,10 +1,4 @@
|
|
1
|
-
|
2
|
-
# coding: utf-8
|
3
|
-
<%- end -%>
|
4
|
-
|
5
|
-
lib = File.expand_path("../lib", __FILE__)
|
6
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
-
require "<%= config[:namespaced_path] %>/version"
|
1
|
+
require_relative 'lib/<%=config[:namespaced_path]%>/version'
|
8
2
|
|
9
3
|
Gem::Specification.new do |spec|
|
10
4
|
spec.name = <%= config[:name].inspect %>
|
@@ -18,19 +12,13 @@ Gem::Specification.new do |spec|
|
|
18
12
|
<%- if config[:mit] -%>
|
19
13
|
spec.license = "MIT"
|
20
14
|
<%- end -%>
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
21
16
|
|
22
|
-
|
23
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
24
|
-
if spec.respond_to?(:metadata)
|
25
|
-
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
17
|
+
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
26
18
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
else
|
31
|
-
raise "RubyGems 2.0 or newer is required to protect against " \
|
32
|
-
"public gem pushes."
|
33
|
-
end
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
|
21
|
+
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
34
22
|
|
35
23
|
# Specify which files should be added to the gem when it is released.
|
36
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -43,13 +31,4 @@ Gem::Specification.new do |spec|
|
|
43
31
|
<%- if config[:ext] -%>
|
44
32
|
spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
|
45
33
|
<%- end -%>
|
46
|
-
|
47
|
-
spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
|
48
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
49
|
-
<%- if config[:ext] -%>
|
50
|
-
spec.add_development_dependency "rake-compiler"
|
51
|
-
<%- end -%>
|
52
|
-
<%- if config[:test] -%>
|
53
|
-
spec.add_development_dependency "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
54
|
-
<%- end -%>
|
55
34
|
end
|
data/bundler/lib/bundler/ui.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
module UI
|
5
|
-
autoload :RGProxy, "
|
6
|
-
autoload :Shell, "
|
7
|
-
autoload :Silent, "
|
5
|
+
autoload :RGProxy, File.expand_path("ui/rg_proxy", __dir__)
|
6
|
+
autoload :Shell, File.expand_path("ui/shell", __dir__)
|
7
|
+
autoload :Silent, File.expand_path("ui/silent", __dir__)
|
8
8
|
end
|
9
9
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../vendored_thor"
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
module UI
|
@@ -10,9 +10,7 @@ module Bundler
|
|
10
10
|
attr_writer :shell
|
11
11
|
|
12
12
|
def initialize(options = {})
|
13
|
-
|
14
|
-
Thor::Base.shell = Thor::Shell::Basic
|
15
|
-
end
|
13
|
+
Thor::Base.shell = options["no-color"] ? Thor::Shell::Basic : nil
|
16
14
|
@shell = Thor::Base.shell.new
|
17
15
|
@level = ENV["DEBUG"] ? "debug" : "info"
|
18
16
|
@warning_history = []
|
@@ -35,14 +33,12 @@ module Bundler
|
|
35
33
|
return if @warning_history.include? msg
|
36
34
|
@warning_history << msg
|
37
35
|
|
38
|
-
|
39
|
-
tell_me(msg, :yellow, newline)
|
36
|
+
tell_err(msg, :yellow, newline)
|
40
37
|
end
|
41
38
|
|
42
39
|
def error(msg, newline = nil)
|
43
40
|
return unless level("error")
|
44
|
-
|
45
|
-
tell_me(msg, :red, newline)
|
41
|
+
tell_err(msg, :red, newline)
|
46
42
|
end
|
47
43
|
|
48
44
|
def debug(msg, newline = nil)
|
@@ -0,0 +1,161 @@
|
|
1
|
+
require_relative 'connection_pool/version'
|
2
|
+
require_relative 'connection_pool/timed_stack'
|
3
|
+
|
4
|
+
|
5
|
+
# Generic connection pool class for e.g. sharing a limited number of network connections
|
6
|
+
# among many threads. Note: Connections are lazily created.
|
7
|
+
#
|
8
|
+
# Example usage with block (faster):
|
9
|
+
#
|
10
|
+
# @pool = Bundler::ConnectionPool.new { Redis.new }
|
11
|
+
#
|
12
|
+
# @pool.with do |redis|
|
13
|
+
# redis.lpop('my-list') if redis.llen('my-list') > 0
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# Using optional timeout override (for that single invocation)
|
17
|
+
#
|
18
|
+
# @pool.with(timeout: 2.0) do |redis|
|
19
|
+
# redis.lpop('my-list') if redis.llen('my-list') > 0
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# Example usage replacing an existing connection (slower):
|
23
|
+
#
|
24
|
+
# $redis = Bundler::ConnectionPool.wrap { Redis.new }
|
25
|
+
#
|
26
|
+
# def do_work
|
27
|
+
# $redis.lpop('my-list') if $redis.llen('my-list') > 0
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# Accepts the following options:
|
31
|
+
# - :size - number of connections to pool, defaults to 5
|
32
|
+
# - :timeout - amount of time to wait for a connection if none currently available, defaults to 5 seconds
|
33
|
+
#
|
34
|
+
class Bundler::ConnectionPool
|
35
|
+
DEFAULTS = {size: 5, timeout: 5}
|
36
|
+
|
37
|
+
class Error < RuntimeError
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.wrap(options, &block)
|
41
|
+
Wrapper.new(options, &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
def initialize(options = {}, &block)
|
45
|
+
raise ArgumentError, 'Connection pool requires a block' unless block
|
46
|
+
|
47
|
+
options = DEFAULTS.merge(options)
|
48
|
+
|
49
|
+
@size = options.fetch(:size)
|
50
|
+
@timeout = options.fetch(:timeout)
|
51
|
+
|
52
|
+
@available = TimedStack.new(@size, &block)
|
53
|
+
@key = :"current-#{@available.object_id}"
|
54
|
+
@key_count = :"current-#{@available.object_id}-count"
|
55
|
+
end
|
56
|
+
|
57
|
+
if Thread.respond_to?(:handle_interrupt)
|
58
|
+
|
59
|
+
# MRI
|
60
|
+
def with(options = {})
|
61
|
+
Thread.handle_interrupt(Exception => :never) do
|
62
|
+
conn = checkout(options)
|
63
|
+
begin
|
64
|
+
Thread.handle_interrupt(Exception => :immediate) do
|
65
|
+
yield conn
|
66
|
+
end
|
67
|
+
ensure
|
68
|
+
checkin
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
else
|
74
|
+
|
75
|
+
# jruby 1.7.x
|
76
|
+
def with(options = {})
|
77
|
+
conn = checkout(options)
|
78
|
+
begin
|
79
|
+
yield conn
|
80
|
+
ensure
|
81
|
+
checkin
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
def checkout(options = {})
|
88
|
+
if ::Thread.current[@key]
|
89
|
+
::Thread.current[@key_count]+= 1
|
90
|
+
::Thread.current[@key]
|
91
|
+
else
|
92
|
+
::Thread.current[@key_count]= 1
|
93
|
+
::Thread.current[@key]= @available.pop(options[:timeout] || @timeout)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def checkin
|
98
|
+
if ::Thread.current[@key]
|
99
|
+
if ::Thread.current[@key_count] == 1
|
100
|
+
@available.push(::Thread.current[@key])
|
101
|
+
::Thread.current[@key]= nil
|
102
|
+
else
|
103
|
+
::Thread.current[@key_count]-= 1
|
104
|
+
end
|
105
|
+
else
|
106
|
+
raise Bundler::ConnectionPool::Error, 'no connections are checked out'
|
107
|
+
end
|
108
|
+
|
109
|
+
nil
|
110
|
+
end
|
111
|
+
|
112
|
+
def shutdown(&block)
|
113
|
+
@available.shutdown(&block)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Size of this connection pool
|
117
|
+
def size
|
118
|
+
@size
|
119
|
+
end
|
120
|
+
|
121
|
+
# Number of pool entries available for checkout at this instant.
|
122
|
+
def available
|
123
|
+
@available.length
|
124
|
+
end
|
125
|
+
|
126
|
+
private
|
127
|
+
|
128
|
+
class Wrapper < ::BasicObject
|
129
|
+
METHODS = [:with, :pool_shutdown]
|
130
|
+
|
131
|
+
def initialize(options = {}, &block)
|
132
|
+
@pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
|
133
|
+
end
|
134
|
+
|
135
|
+
def with(&block)
|
136
|
+
@pool.with(&block)
|
137
|
+
end
|
138
|
+
|
139
|
+
def pool_shutdown(&block)
|
140
|
+
@pool.shutdown(&block)
|
141
|
+
end
|
142
|
+
|
143
|
+
def pool_size
|
144
|
+
@pool.size
|
145
|
+
end
|
146
|
+
|
147
|
+
def pool_available
|
148
|
+
@pool.available
|
149
|
+
end
|
150
|
+
|
151
|
+
def respond_to?(id, *args)
|
152
|
+
METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
|
153
|
+
end
|
154
|
+
|
155
|
+
def method_missing(name, *args, &block)
|
156
|
+
with do |connection|
|
157
|
+
connection.send(name, *args, &block)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|