bundler 1.17.2 → 2.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2095 -1251
- data/LICENSE.md +18 -19
- data/README.md +10 -11
- data/bundler.gemspec +10 -28
- data/exe/bundle +22 -3
- data/lib/bundler/build_metadata.rb +4 -12
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +24 -17
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +39 -13
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +20 -9
- data/lib/bundler/cli/exec.rb +8 -25
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +213 -32
- data/lib/bundler/cli/info.rb +42 -7
- data/lib/bundler/cli/init.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +34 -44
- data/lib/bundler/cli/issue.rb +8 -7
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +11 -8
- data/lib/bundler/cli/outdated.rb +142 -118
- data/lib/bundler/cli/plugin.rb +19 -2
- data/lib/bundler/cli/pristine.rb +6 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +43 -16
- data/lib/bundler/cli.rb +211 -150
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +15 -28
- data/lib/bundler/compact_index_client.rb +28 -12
- data/lib/bundler/current_ruby.rb +14 -11
- data/lib/bundler/definition.rb +207 -368
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +19 -14
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +81 -81
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +9 -14
- data/lib/bundler/environment_preserver.rb +29 -3
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +14 -33
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +28 -14
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +14 -8
- data/lib/bundler/fetcher/index.rb +8 -8
- data/lib/bundler/fetcher.rb +22 -17
- data/lib/bundler/friendly_errors.rb +29 -48
- data/lib/bundler/gem_helper.rb +79 -43
- data/lib/bundler/gem_helpers.rb +38 -29
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +5 -5
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +33 -13
- data/lib/bundler/inline.rb +41 -30
- data/lib/bundler/installer/gem_installer.rb +9 -18
- data/lib/bundler/installer/parallel_installer.rb +50 -33
- data/lib/bundler/installer/standalone.rb +30 -11
- data/lib/bundler/installer.rb +39 -66
- data/lib/bundler/lazy_specification.rb +63 -28
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +19 -52
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/{man → lib/bundler/man}/bundle-add.1 +10 -2
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-config.1 +59 -60
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +77 -78
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +38 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-init.1 +2 -2
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-install.1 +37 -7
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-update.1 +7 -7
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle.1 +7 -3
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +5 -2
- data/{man → lib/bundler/man}/gemfile.5 +44 -21
- data/{man → lib/bundler/man}/gemfile.5.ronn +24 -20
- data/{man → lib/bundler/man}/index.txt +1 -1
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +5 -5
- data/lib/bundler/plugin/api/source.rb +27 -7
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +27 -4
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +35 -22
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +100 -42
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +5 -4
- data/lib/bundler/resolver/spec_group.rb +57 -53
- data/lib/bundler/resolver.rb +127 -113
- data/lib/bundler/retry.rb +4 -4
- data/lib/bundler/ruby_version.rb +5 -20
- data/lib/bundler/rubygems_ext.rb +103 -79
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +181 -446
- data/lib/bundler/runtime.rb +24 -34
- data/lib/bundler/settings.rb +159 -110
- data/lib/bundler/setup.rb +11 -12
- data/lib/bundler/shared_helpers.rb +56 -90
- data/lib/bundler/similarity_detector.rb +3 -3
- data/lib/bundler/source/git/git_proxy.rb +106 -105
- data/lib/bundler/source/git.rb +66 -39
- data/lib/bundler/source/metadata.rb +9 -9
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +23 -12
- data/lib/bundler/source/rubygems/remote.rb +3 -4
- data/lib/bundler/source/rubygems.rb +136 -120
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +27 -6
- data/lib/bundler/source_list.rb +101 -66
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +49 -53
- data/lib/bundler/stub_specification.rb +40 -34
- data/lib/bundler/templates/Executable.bundler +24 -15
- data/lib/bundler/templates/Gemfile +1 -1
- data/lib/bundler/templates/gems.rb +1 -1
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
- data/lib/bundler/templates/newgem/README.md.tt +7 -5
- data/lib/bundler/templates/newgem/Rakefile.tt +23 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +29 -40
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +7 -11
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/uri_credentials_filter.rb +10 -4
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +126 -0
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +38 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
- data/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +16 -9
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -12
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +2 -2
- data/lib/bundler/worker.rb +21 -8
- data/lib/bundler/yaml_serializer.rb +3 -4
- data/lib/bundler.rb +248 -118
- metadata +115 -190
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/man/bundle-add.1.txt +0 -52
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -529
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -396
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -391
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -113
- data/man/gemfile.5.txt +0 -653
data/lib/bundler/cli/gem.rb
CHANGED
@@ -11,7 +11,8 @@ module Bundler
|
|
11
11
|
class CLI::Gem
|
12
12
|
TEST_FRAMEWORK_VERSIONS = {
|
13
13
|
"rspec" => "3.0",
|
14
|
-
"minitest" => "5.0"
|
14
|
+
"minitest" => "5.0",
|
15
|
+
"test-unit" => "3.0",
|
15
16
|
}.freeze
|
16
17
|
|
17
18
|
attr_reader :options, :gem_name, :thor, :name, :target
|
@@ -38,11 +39,19 @@ module Bundler
|
|
38
39
|
constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
|
39
40
|
constant_array = constant_name.split("::")
|
40
41
|
|
41
|
-
|
42
|
+
use_git = Bundler.git_present? && options[:git]
|
42
43
|
|
43
|
-
git_author_name =
|
44
|
-
|
45
|
-
git_user_email =
|
44
|
+
git_author_name = use_git ? `git config user.name`.chomp : ""
|
45
|
+
git_username = use_git ? `git config github.user`.chomp : ""
|
46
|
+
git_user_email = use_git ? `git config user.email`.chomp : ""
|
47
|
+
|
48
|
+
github_username = if options[:github_username].nil?
|
49
|
+
git_username
|
50
|
+
elsif options[:github_username] == false
|
51
|
+
""
|
52
|
+
else
|
53
|
+
options[:github_username]
|
54
|
+
end
|
46
55
|
|
47
56
|
config = {
|
48
57
|
:name => name,
|
@@ -57,19 +66,22 @@ module Bundler
|
|
57
66
|
:ext => options[:ext],
|
58
67
|
:exe => options[:exe],
|
59
68
|
:bundler_version => bundler_dependency_version,
|
60
|
-
:
|
69
|
+
:git => use_git,
|
70
|
+
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
71
|
+
:required_ruby_version => required_ruby_version,
|
61
72
|
}
|
62
73
|
ensure_safe_gem_name(name, constant_array)
|
63
74
|
|
64
75
|
templates = {
|
65
|
-
"
|
76
|
+
"#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
|
66
77
|
"lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
|
67
78
|
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
|
79
|
+
"sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
|
68
80
|
"newgem.gemspec.tt" => "#{name}.gemspec",
|
69
81
|
"Rakefile.tt" => "Rakefile",
|
70
82
|
"README.md.tt" => "README.md",
|
71
83
|
"bin/console.tt" => "bin/console",
|
72
|
-
"bin/setup.tt" => "bin/setup"
|
84
|
+
"bin/setup.tt" => "bin/setup",
|
73
85
|
}
|
74
86
|
|
75
87
|
executables = %w[
|
@@ -77,14 +89,12 @@ module Bundler
|
|
77
89
|
bin/setup
|
78
90
|
]
|
79
91
|
|
80
|
-
templates.merge!("gitignore.tt" => ".gitignore") if
|
92
|
+
templates.merge!("gitignore.tt" => ".gitignore") if use_git
|
81
93
|
|
82
94
|
if test_framework = ask_and_set_test_framework
|
83
95
|
config[:test] = test_framework
|
84
96
|
config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
|
85
97
|
|
86
|
-
templates.merge!("travis.yml.tt" => ".travis.yml")
|
87
|
-
|
88
98
|
case test_framework
|
89
99
|
when "rspec"
|
90
100
|
templates.merge!(
|
@@ -92,15 +102,33 @@ module Bundler
|
|
92
102
|
"spec/spec_helper.rb.tt" => "spec/spec_helper.rb",
|
93
103
|
"spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
|
94
104
|
)
|
105
|
+
config[:test_task] = :spec
|
95
106
|
when "minitest"
|
96
107
|
templates.merge!(
|
97
|
-
"test/test_helper.rb.tt" => "test/test_helper.rb",
|
98
|
-
"test/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
108
|
+
"test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
|
109
|
+
"test/minitest/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
99
110
|
)
|
111
|
+
config[:test_task] = :test
|
112
|
+
when "test-unit"
|
113
|
+
templates.merge!(
|
114
|
+
"test/test-unit/test_helper.rb.tt" => "test/test_helper.rb",
|
115
|
+
"test/test-unit/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
116
|
+
)
|
117
|
+
config[:test_task] = :test
|
100
118
|
end
|
101
119
|
end
|
102
120
|
|
103
|
-
config[:
|
121
|
+
config[:ci] = ask_and_set_ci
|
122
|
+
case config[:ci]
|
123
|
+
when "github"
|
124
|
+
templates.merge!("github/workflows/main.yml.tt" => ".github/workflows/main.yml")
|
125
|
+
when "travis"
|
126
|
+
templates.merge!("travis.yml.tt" => ".travis.yml")
|
127
|
+
when "gitlab"
|
128
|
+
templates.merge!("gitlab-ci.yml.tt" => ".gitlab-ci.yml")
|
129
|
+
when "circle"
|
130
|
+
templates.merge!("circleci/config.yml.tt" => ".circleci/config.yml")
|
131
|
+
end
|
104
132
|
|
105
133
|
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
|
106
134
|
"This means that any other developer or company will be legally allowed to use your code " \
|
@@ -124,6 +152,30 @@ module Bundler
|
|
124
152
|
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
|
125
153
|
end
|
126
154
|
|
155
|
+
if ask_and_set(:changelog, "Do you want to include a changelog?",
|
156
|
+
"A changelog is a file which contains a curated, chronologically ordered list of notable " \
|
157
|
+
"changes for each version of a project. To make it easier for users and contributors to" \
|
158
|
+
" see precisely what notable changes have been made between each release (or version) of" \
|
159
|
+
" the project. Whether consumers or developers, the end users of software are" \
|
160
|
+
" human beings who care about what's in the software. When the software changes, people " \
|
161
|
+
"want to know why and how. see https://keepachangelog.com")
|
162
|
+
config[:changelog] = true
|
163
|
+
Bundler.ui.info "Changelog enabled in config"
|
164
|
+
templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
|
165
|
+
end
|
166
|
+
|
167
|
+
config[:linter] = ask_and_set_linter
|
168
|
+
case config[:linter]
|
169
|
+
when "rubocop"
|
170
|
+
config[:linter_version] = rubocop_version
|
171
|
+
Bundler.ui.info "RuboCop enabled in config"
|
172
|
+
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
173
|
+
when "standard"
|
174
|
+
config[:linter_version] = standard_version
|
175
|
+
Bundler.ui.info "Standard enabled in config"
|
176
|
+
templates.merge!("standard.yml.tt" => ".standard.yml")
|
177
|
+
end
|
178
|
+
|
127
179
|
templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
|
128
180
|
|
129
181
|
if options[:ext]
|
@@ -134,24 +186,32 @@ module Bundler
|
|
134
186
|
)
|
135
187
|
end
|
136
188
|
|
189
|
+
if target.exist? && !target.directory?
|
190
|
+
Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
|
191
|
+
exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
|
192
|
+
end
|
193
|
+
|
194
|
+
if use_git
|
195
|
+
Bundler.ui.info "Initializing git repo in #{target}"
|
196
|
+
require "shellwords"
|
197
|
+
`git init #{target.to_s.shellescape}`
|
198
|
+
|
199
|
+
config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
|
200
|
+
end
|
201
|
+
|
137
202
|
templates.each do |src, dst|
|
138
203
|
destination = target.join(dst)
|
139
|
-
|
140
|
-
thor.template("newgem/#{src}", destination, config)
|
141
|
-
end
|
204
|
+
thor.template("newgem/#{src}", destination, config)
|
142
205
|
end
|
143
206
|
|
144
207
|
executables.each do |file|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end
|
208
|
+
path = target.join(file)
|
209
|
+
executable = (path.stat.mode | 0o111)
|
210
|
+
path.chmod(executable)
|
149
211
|
end
|
150
212
|
|
151
|
-
if
|
152
|
-
Bundler.ui.info "Initializing git repo in #{target}"
|
213
|
+
if use_git
|
153
214
|
Dir.chdir(target) do
|
154
|
-
`git init`
|
155
215
|
`git add .`
|
156
216
|
end
|
157
217
|
end
|
@@ -161,11 +221,9 @@ module Bundler
|
|
161
221
|
|
162
222
|
Bundler.ui.info "Gem '#{name}' was successfully created. " \
|
163
223
|
"For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
|
164
|
-
rescue Errno::EEXIST => e
|
165
|
-
raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
|
166
224
|
end
|
167
225
|
|
168
|
-
|
226
|
+
private
|
169
227
|
|
170
228
|
def resolve_name(name)
|
171
229
|
SharedHelpers.pwd.join(name).basename.to_s
|
@@ -190,18 +248,19 @@ module Bundler
|
|
190
248
|
Bundler.ui.error "You have specified a gem name which does not conform to the \n" \
|
191
249
|
"naming guidelines for C extensions. For more information, \n" \
|
192
250
|
"see the 'Extension Naming' section at the following URL:\n" \
|
193
|
-
"
|
251
|
+
"https://guides.rubygems.org/gems-with-extensions/\n"
|
194
252
|
exit 1
|
195
253
|
end
|
196
254
|
|
197
255
|
def ask_and_set_test_framework
|
198
256
|
test_framework = options[:test] || Bundler.settings["gem.test"]
|
199
257
|
|
200
|
-
if test_framework.
|
258
|
+
if test_framework.to_s.empty?
|
201
259
|
Bundler.ui.confirm "Do you want to generate tests with your gem?"
|
202
|
-
|
203
|
-
|
204
|
-
|
260
|
+
Bundler.ui.info hint_text("test")
|
261
|
+
|
262
|
+
result = Bundler.ui.ask "Enter a test framework. rspec/minitest/test-unit/(none):"
|
263
|
+
if result =~ /rspec|minitest|test-unit/
|
205
264
|
test_framework = result
|
206
265
|
else
|
207
266
|
test_framework = false
|
@@ -212,9 +271,106 @@ module Bundler
|
|
212
271
|
Bundler.settings.set_global("gem.test", test_framework)
|
213
272
|
end
|
214
273
|
|
274
|
+
if options[:test] == Bundler.settings["gem.test"]
|
275
|
+
Bundler.ui.info "#{options[:test]} is already configured, ignoring --test flag."
|
276
|
+
end
|
277
|
+
|
215
278
|
test_framework
|
216
279
|
end
|
217
280
|
|
281
|
+
def hint_text(setting)
|
282
|
+
if Bundler.settings["gem.#{setting}"] == false
|
283
|
+
"Your choice will only be applied to this gem."
|
284
|
+
else
|
285
|
+
"Future `bundle gem` calls will use your choice. " \
|
286
|
+
"This setting can be changed anytime with `bundle config gem.#{setting}`."
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
def ask_and_set_ci
|
291
|
+
ci_template = options[:ci] || Bundler.settings["gem.ci"]
|
292
|
+
|
293
|
+
if ci_template.to_s.empty?
|
294
|
+
Bundler.ui.confirm "Do you want to set up continuous integration for your gem? " \
|
295
|
+
"Supported services:\n" \
|
296
|
+
"* CircleCI: https://circleci.com/\n" \
|
297
|
+
"* GitHub Actions: https://github.com/features/actions\n" \
|
298
|
+
"* GitLab CI: https://docs.gitlab.com/ee/ci/\n" \
|
299
|
+
"* Travis CI: https://travis-ci.org/\n" \
|
300
|
+
"\n"
|
301
|
+
Bundler.ui.info hint_text("ci")
|
302
|
+
|
303
|
+
result = Bundler.ui.ask "Enter a CI service. github/travis/gitlab/circle/(none):"
|
304
|
+
if result =~ /github|travis|gitlab|circle/
|
305
|
+
ci_template = result
|
306
|
+
else
|
307
|
+
ci_template = false
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
if Bundler.settings["gem.ci"].nil?
|
312
|
+
Bundler.settings.set_global("gem.ci", ci_template)
|
313
|
+
end
|
314
|
+
|
315
|
+
if options[:ci] == Bundler.settings["gem.ci"]
|
316
|
+
Bundler.ui.info "#{options[:ci]} is already configured, ignoring --ci flag."
|
317
|
+
end
|
318
|
+
|
319
|
+
ci_template
|
320
|
+
end
|
321
|
+
|
322
|
+
def ask_and_set_linter
|
323
|
+
linter_template = options[:linter] || Bundler.settings["gem.linter"]
|
324
|
+
linter_template = deprecated_rubocop_option if linter_template.nil?
|
325
|
+
|
326
|
+
if linter_template.to_s.empty?
|
327
|
+
Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
|
328
|
+
"Supported Linters:\n" \
|
329
|
+
"* RuboCop: https://rubocop.org\n" \
|
330
|
+
"* Standard: https://github.com/testdouble/standard\n" \
|
331
|
+
"\n"
|
332
|
+
Bundler.ui.info hint_text("linter")
|
333
|
+
|
334
|
+
result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
|
335
|
+
if result =~ /rubocop|standard/
|
336
|
+
linter_template = result
|
337
|
+
else
|
338
|
+
linter_template = false
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
if Bundler.settings["gem.linter"].nil?
|
343
|
+
Bundler.settings.set_global("gem.linter", linter_template)
|
344
|
+
end
|
345
|
+
|
346
|
+
# Once gem.linter safely set, unset the deprecated gem.rubocop
|
347
|
+
unless Bundler.settings["gem.rubocop"].nil?
|
348
|
+
Bundler.settings.set_global("gem.rubocop", nil)
|
349
|
+
end
|
350
|
+
|
351
|
+
if options[:linter] == Bundler.settings["gem.linter"]
|
352
|
+
Bundler.ui.info "#{options[:linter]} is already configured, ignoring --linter flag."
|
353
|
+
end
|
354
|
+
|
355
|
+
linter_template
|
356
|
+
end
|
357
|
+
|
358
|
+
def deprecated_rubocop_option
|
359
|
+
if !options[:rubocop].nil?
|
360
|
+
if options[:rubocop]
|
361
|
+
Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop"
|
362
|
+
"rubocop"
|
363
|
+
else
|
364
|
+
Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter"
|
365
|
+
false
|
366
|
+
end
|
367
|
+
elsif !Bundler.settings["gem.rubocop"].nil?
|
368
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
369
|
+
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
|
370
|
+
Bundler.settings["gem.rubocop"] ? "rubocop" : false
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
218
374
|
def bundler_dependency_version
|
219
375
|
v = Gem::Version.new(Bundler::VERSION)
|
220
376
|
req = v.segments[0..1]
|
@@ -248,5 +404,30 @@ module Bundler
|
|
248
404
|
def open_editor(editor, file)
|
249
405
|
thor.run(%(#{editor} "#{file}"))
|
250
406
|
end
|
407
|
+
|
408
|
+
def required_ruby_version
|
409
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "2.3.0"
|
410
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "2.4.0"
|
411
|
+
elsif Gem.ruby_version < Gem::Version.new("2.6.a") then "2.5.0"
|
412
|
+
else
|
413
|
+
"2.6.0"
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
def rubocop_version
|
418
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.81.0"
|
419
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.12"
|
420
|
+
else
|
421
|
+
"1.21"
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
def standard_version
|
426
|
+
if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.2.5"
|
427
|
+
elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.0"
|
428
|
+
else
|
429
|
+
"1.3"
|
430
|
+
end
|
431
|
+
end
|
251
432
|
end
|
252
433
|
end
|
data/lib/bundler/cli/info.rb
CHANGED
@@ -9,18 +9,25 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
+
Bundler.ui.silence do
|
13
|
+
Bundler.definition.validate_runtime!
|
14
|
+
Bundler.load.lock
|
15
|
+
end
|
16
|
+
|
12
17
|
spec = spec_for_gem(gem_name)
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
if spec
|
20
|
+
return print_gem_path(spec) if @options[:path]
|
21
|
+
return print_gem_version(spec) if @options[:version]
|
22
|
+
print_gem_info(spec)
|
23
|
+
end
|
17
24
|
end
|
18
25
|
|
19
|
-
|
26
|
+
private
|
20
27
|
|
21
28
|
def spec_for_gem(gem_name)
|
22
29
|
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
|
23
|
-
spec || default_gem_spec(gem_name)
|
30
|
+
spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
24
31
|
end
|
25
32
|
|
26
33
|
def default_gem_spec(gem_name)
|
@@ -33,17 +40,45 @@ module Bundler
|
|
33
40
|
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
|
34
41
|
end
|
35
42
|
|
43
|
+
def print_gem_version(spec)
|
44
|
+
Bundler.ui.info spec.version.to_s
|
45
|
+
end
|
46
|
+
|
36
47
|
def print_gem_path(spec)
|
37
|
-
|
48
|
+
name = spec.name
|
49
|
+
if name == "bundler"
|
50
|
+
path = File.expand_path("../../../..", __FILE__)
|
51
|
+
else
|
52
|
+
path = spec.full_gem_path
|
53
|
+
if spec.deleted_gem?
|
54
|
+
return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Bundler.ui.info path
|
38
59
|
end
|
39
60
|
|
40
61
|
def print_gem_info(spec)
|
62
|
+
metadata = spec.metadata
|
63
|
+
name = spec.name
|
41
64
|
gem_info = String.new
|
42
|
-
gem_info << " * #{
|
65
|
+
gem_info << " * #{name} (#{spec.version}#{spec.git_version})\n"
|
43
66
|
gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
|
44
67
|
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
|
68
|
+
gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
|
69
|
+
gem_info << "\tSource Code: #{metadata["source_code_uri"]}\n" if metadata.key?("source_code_uri")
|
70
|
+
gem_info << "\tFunding: #{metadata["funding_uri"]}\n" if metadata.key?("funding_uri")
|
71
|
+
gem_info << "\tWiki: #{metadata["wiki_uri"]}\n" if metadata.key?("wiki_uri")
|
72
|
+
gem_info << "\tChangelog: #{metadata["changelog_uri"]}\n" if metadata.key?("changelog_uri")
|
73
|
+
gem_info << "\tBug Tracker: #{metadata["bug_tracker_uri"]}\n" if metadata.key?("bug_tracker_uri")
|
74
|
+
gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
|
45
75
|
gem_info << "\tPath: #{spec.full_gem_path}\n"
|
46
76
|
gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
|
77
|
+
|
78
|
+
if name != "bundler" && spec.deleted_gem?
|
79
|
+
return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
|
80
|
+
end
|
81
|
+
|
47
82
|
Bundler.ui.info gem_info
|
48
83
|
end
|
49
84
|
end
|
data/lib/bundler/cli/init.rb
CHANGED
@@ -38,10 +38,10 @@ module Bundler
|
|
38
38
|
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
|
39
39
|
end
|
40
40
|
|
41
|
-
|
41
|
+
private
|
42
42
|
|
43
43
|
def gemfile
|
44
|
-
@gemfile ||= Bundler.
|
44
|
+
@gemfile ||= Bundler.preferred_gemfile_name
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/bundler/cli/inject.rb
CHANGED
data/lib/bundler/cli/install.rb
CHANGED
@@ -8,12 +8,10 @@ module Bundler
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run
|
11
|
-
Bundler.ui.level = "
|
11
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
12
12
|
|
13
13
|
warn_if_root
|
14
14
|
|
15
|
-
normalize_groups
|
16
|
-
|
17
15
|
Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
|
18
16
|
|
19
17
|
# Disable color in deployment mode
|
@@ -35,11 +33,8 @@ module Bundler
|
|
35
33
|
|
36
34
|
options[:local] = true if Bundler.app_cache.exist?
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
else
|
41
|
-
Bundler.settings.set_command_option :frozen, true
|
42
|
-
end
|
36
|
+
Bundler.settings.set_command_option :deployment, true if options[:deployment]
|
37
|
+
Bundler.settings.set_command_option :frozen, true if options[:frozen]
|
43
38
|
end
|
44
39
|
|
45
40
|
# When install is called with --no-deployment, disable deployment mode
|
@@ -54,7 +49,7 @@ module Bundler
|
|
54
49
|
|
55
50
|
if options["binstubs"]
|
56
51
|
Bundler::SharedHelpers.major_deprecation 2,
|
57
|
-
"The --binstubs option will be removed in favor of `bundle binstubs`"
|
52
|
+
"The --binstubs option will be removed in favor of `bundle binstubs --all`"
|
58
53
|
end
|
59
54
|
|
60
55
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
@@ -63,10 +58,13 @@ module Bundler
|
|
63
58
|
definition.validate_runtime!
|
64
59
|
|
65
60
|
installer = Installer.install(Bundler.root, definition, options)
|
66
|
-
|
61
|
+
|
62
|
+
Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
|
63
|
+
Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
64
|
+
end
|
67
65
|
|
68
66
|
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
69
|
-
Bundler::CLI::Common.output_without_groups_message
|
67
|
+
Bundler::CLI::Common.output_without_groups_message(:install)
|
70
68
|
|
71
69
|
if Bundler.use_system_gems?
|
72
70
|
Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
|
@@ -80,31 +78,20 @@ module Bundler
|
|
80
78
|
warn_ambiguous_gems
|
81
79
|
|
82
80
|
if CLI::Common.clean_after_install?
|
83
|
-
|
81
|
+
require_relative "clean"
|
84
82
|
Bundler::CLI::Clean.new(options).run
|
85
83
|
end
|
86
|
-
rescue GemNotFound, VersionConflict => e
|
87
|
-
if options[:local] && Bundler.app_cache.exist?
|
88
|
-
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
|
89
|
-
end
|
90
84
|
|
91
|
-
|
92
|
-
|
93
|
-
Your Gemfile has no gem server sources. If you need gems that are \
|
94
|
-
not already on your machine, add a line like this to your Gemfile:
|
95
|
-
source 'https://rubygems.org'
|
96
|
-
WARN
|
97
|
-
end
|
98
|
-
raise e
|
99
|
-
rescue Gem::InvalidSpecificationException => e
|
85
|
+
Bundler::CLI::Common.output_fund_metadata_summary
|
86
|
+
rescue Gem::InvalidSpecificationException
|
100
87
|
Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
|
101
|
-
raise
|
88
|
+
raise
|
102
89
|
end
|
103
90
|
|
104
|
-
|
91
|
+
private
|
105
92
|
|
106
93
|
def warn_if_root
|
107
|
-
return if Bundler.settings[:silence_root_warning] ||
|
94
|
+
return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
|
108
95
|
Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
|
109
96
|
"if it is needed, and installing your bundle as root will break this " \
|
110
97
|
"application for all non-root users on this machine.", :wrap => true
|
@@ -164,12 +151,20 @@ module Bundler
|
|
164
151
|
|
165
152
|
options[:with] = with
|
166
153
|
options[:without] = without
|
154
|
+
|
155
|
+
unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
|
156
|
+
# need to nil them out first to get around validation for backwards compatibility
|
157
|
+
Bundler.settings.set_command_option :without, nil
|
158
|
+
Bundler.settings.set_command_option :with, nil
|
159
|
+
Bundler.settings.set_command_option :without, options[:without] - options[:with]
|
160
|
+
Bundler.settings.set_command_option :with, options[:with]
|
161
|
+
end
|
167
162
|
end
|
168
163
|
|
169
164
|
def normalize_settings
|
170
165
|
Bundler.settings.set_command_option :path, nil if options[:system]
|
171
166
|
Bundler.settings.temporary(:path_relative_to_cwd => false) do
|
172
|
-
Bundler.settings.set_command_option :path, "vendor/bundle" if
|
167
|
+
Bundler.settings.set_command_option :path, "vendor/bundle" if Bundler.settings[:deployment] && Bundler.settings[:path].nil?
|
173
168
|
end
|
174
169
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
175
170
|
Bundler.settings.temporary(:path_relative_to_cwd => false) do
|
@@ -190,27 +185,22 @@ module Bundler
|
|
190
185
|
|
191
186
|
Bundler.settings.set_command_option_if_given :clean, options["clean"]
|
192
187
|
|
193
|
-
|
194
|
-
# need to nil them out first to get around validation for backwards compatibility
|
195
|
-
Bundler.settings.set_command_option :without, nil
|
196
|
-
Bundler.settings.set_command_option :with, nil
|
197
|
-
Bundler.settings.set_command_option :without, options[:without] - options[:with]
|
198
|
-
Bundler.settings.set_command_option :with, options[:with]
|
199
|
-
end
|
188
|
+
normalize_groups
|
200
189
|
|
201
190
|
options[:force] = options[:redownload]
|
202
191
|
end
|
203
192
|
|
204
193
|
def warn_ambiguous_gems
|
194
|
+
# TODO: remove this when we drop Bundler 1.x support
|
205
195
|
Installer.ambiguous_gems.to_a.each do |name, installed_from_uri, *also_found_in_uris|
|
206
|
-
Bundler.ui.
|
207
|
-
Bundler.ui.
|
208
|
-
Bundler.ui.
|
209
|
-
also_found_in_uris.each {|uri| Bundler.ui.
|
210
|
-
Bundler.ui.
|
211
|
-
Bundler.ui.
|
212
|
-
Bundler.ui.
|
213
|
-
Bundler.ui.
|
196
|
+
Bundler.ui.warn "Warning: the gem '#{name}' was found in multiple sources."
|
197
|
+
Bundler.ui.warn "Installed from: #{installed_from_uri}"
|
198
|
+
Bundler.ui.warn "Also found in:"
|
199
|
+
also_found_in_uris.each {|uri| Bundler.ui.warn " * #{uri}" }
|
200
|
+
Bundler.ui.warn "You should add a source requirement to restrict this gem to your preferred source."
|
201
|
+
Bundler.ui.warn "For example:"
|
202
|
+
Bundler.ui.warn " gem '#{name}', :source => '#{installed_from_uri}'"
|
203
|
+
Bundler.ui.warn "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again."
|
214
204
|
end
|
215
205
|
end
|
216
206
|
end
|
data/lib/bundler/cli/issue.rb
CHANGED
@@ -10,19 +10,20 @@ module Bundler
|
|
10
10
|
be sure to check out these resources:
|
11
11
|
|
12
12
|
1. Check out our troubleshooting guide for quick fixes to common issues:
|
13
|
-
https://github.com/
|
13
|
+
https://github.com/rubygems/rubygems/blob/master/bundler/doc/TROUBLESHOOTING.md
|
14
14
|
|
15
15
|
2. Instructions for common Bundler uses can be found on the documentation
|
16
|
-
site:
|
16
|
+
site: https://bundler.io/
|
17
17
|
|
18
18
|
3. Information about each Bundler command can be found in the Bundler
|
19
|
-
man pages:
|
19
|
+
man pages: https://bundler.io/man/bundle.1.html
|
20
20
|
|
21
21
|
Hopefully the troubleshooting steps above resolved your problem! If things
|
22
22
|
still aren't working the way you expect them to, please let us know so
|
23
|
-
that we can diagnose and help fix the problem you're having
|
24
|
-
|
25
|
-
https://github.com/
|
23
|
+
that we can diagnose and help fix the problem you're having, by filling
|
24
|
+
in the new issue form located at
|
25
|
+
https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md,
|
26
|
+
and copy and pasting the information below.
|
26
27
|
|
27
28
|
EOS
|
28
29
|
|
@@ -33,7 +34,7 @@ module Bundler
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def doctor
|
36
|
-
|
37
|
+
require_relative "doctor"
|
37
38
|
Bundler::CLI::Doctor.new({}).run
|
38
39
|
end
|
39
40
|
end
|