bundler 1.11.1 → 2.2.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +2125 -840
- data/LICENSE.md +18 -19
- data/README.md +33 -11
- data/bundler.gemspec +34 -21
- data/exe/bundle +36 -6
- data/exe/bundler +2 -18
- data/lib/bundler.rb +435 -160
- data/lib/bundler/build_metadata.rb +45 -0
- data/lib/bundler/capistrano.rb +9 -3
- data/lib/bundler/cli.rb +550 -130
- data/lib/bundler/cli/add.rb +47 -0
- data/lib/bundler/cli/binstubs.rb +26 -10
- data/lib/bundler/cli/cache.rb +25 -17
- data/lib/bundler/cli/check.rb +8 -7
- data/lib/bundler/cli/clean.rb +8 -8
- data/lib/bundler/cli/common.rb +69 -9
- data/lib/bundler/cli/config.rb +170 -76
- data/lib/bundler/cli/console.rb +6 -1
- data/lib/bundler/cli/doctor.rb +140 -0
- data/lib/bundler/cli/exec.rb +63 -21
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +158 -42
- data/lib/bundler/cli/info.rb +73 -0
- data/lib/bundler/cli/init.rb +22 -7
- data/lib/bundler/cli/inject.rb +38 -10
- data/lib/bundler/cli/install.rb +139 -104
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +60 -0
- data/lib/bundler/cli/lock.rb +27 -5
- data/lib/bundler/cli/open.rb +13 -5
- data/lib/bundler/cli/outdated.rb +251 -46
- data/lib/bundler/cli/platform.rb +6 -2
- data/lib/bundler/cli/plugin.rb +41 -0
- data/lib/bundler/cli/pristine.rb +52 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +5 -4
- data/lib/bundler/cli/update.rb +67 -26
- data/lib/bundler/cli/viz.rb +11 -6
- data/lib/bundler/compact_index_client.rb +125 -0
- data/lib/bundler/compact_index_client/cache.rb +110 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +104 -0
- data/lib/bundler/constants.rb +2 -0
- data/lib/bundler/current_ruby.rb +51 -174
- data/lib/bundler/definition.rb +533 -216
- data/lib/bundler/dep_proxy.rb +18 -8
- data/lib/bundler/dependency.rb +39 -12
- data/lib/bundler/deployment.rb +7 -0
- data/lib/bundler/deprecate.rb +31 -2
- data/lib/bundler/dsl.rb +188 -91
- data/lib/bundler/endpoint_specification.rb +51 -10
- data/lib/bundler/env.rb +116 -48
- data/lib/bundler/environment_preserver.rb +82 -0
- data/lib/bundler/errors.rb +108 -31
- data/lib/bundler/feature_flag.rb +60 -0
- data/lib/bundler/fetcher.rb +81 -52
- data/lib/bundler/fetcher/base.rb +15 -3
- data/lib/bundler/fetcher/compact_index.rb +140 -0
- data/lib/bundler/fetcher/dependency.rb +36 -42
- data/lib/bundler/fetcher/downloader.rb +39 -12
- data/lib/bundler/fetcher/index.rb +34 -9
- data/lib/bundler/friendly_errors.rb +132 -88
- data/lib/bundler/gem_helper.rb +92 -50
- data/lib/bundler/gem_helpers.rb +90 -5
- data/lib/bundler/gem_tasks.rb +3 -1
- data/lib/bundler/gem_version_promoter.rb +190 -0
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +20 -41
- data/lib/bundler/index.rb +74 -57
- data/lib/bundler/injector.rb +242 -31
- data/lib/bundler/inline.rb +49 -23
- data/lib/bundler/installer.rb +190 -74
- data/lib/bundler/installer/gem_installer.rb +33 -20
- data/lib/bundler/installer/parallel_installer.rb +201 -97
- data/lib/bundler/installer/standalone.rb +10 -6
- data/lib/bundler/lazy_specification.rb +74 -10
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +126 -74
- data/lib/bundler/{ssl_certs → man}/.document +0 -0
- data/lib/bundler/man/bundle-add.1 +66 -0
- data/lib/bundler/man/bundle-add.1.ronn +46 -0
- data/lib/bundler/man/bundle-binstubs.1 +42 -0
- data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
- data/lib/bundler/man/bundle-cache.1 +55 -0
- data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
- data/lib/bundler/man/bundle-check.1 +31 -0
- data/lib/bundler/man/bundle-check.1.ronn +26 -0
- data/lib/bundler/man/bundle-clean.1 +24 -0
- data/lib/bundler/man/bundle-clean.1.ronn +18 -0
- data/lib/bundler/man/bundle-config.1 +488 -0
- data/lib/bundler/man/bundle-config.1.ronn +388 -0
- data/lib/bundler/man/bundle-doctor.1 +44 -0
- data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
- data/lib/bundler/man/bundle-exec.1 +165 -0
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
- data/lib/bundler/man/bundle-gem.1 +102 -0
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
- data/lib/bundler/man/bundle-info.1 +20 -0
- data/lib/bundler/man/bundle-info.1.ronn +17 -0
- data/lib/bundler/man/bundle-init.1 +25 -0
- data/lib/bundler/man/bundle-init.1.ronn +29 -0
- data/lib/bundler/man/bundle-inject.1 +33 -0
- data/lib/bundler/man/bundle-inject.1.ronn +22 -0
- data/lib/bundler/man/bundle-install.1 +338 -0
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
- data/lib/bundler/man/bundle-list.1 +50 -0
- data/lib/bundler/man/bundle-list.1.ronn +33 -0
- data/lib/bundler/man/bundle-lock.1 +84 -0
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
- data/lib/bundler/man/bundle-open.1 +32 -0
- data/lib/bundler/man/bundle-open.1.ronn +19 -0
- data/lib/bundler/man/bundle-outdated.1 +155 -0
- data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
- data/lib/bundler/man/bundle-platform.1 +61 -0
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
- data/lib/bundler/man/bundle-pristine.1 +34 -0
- data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
- data/lib/bundler/man/bundle-remove.1 +31 -0
- data/lib/bundler/man/bundle-remove.1.ronn +23 -0
- data/lib/bundler/man/bundle-show.1 +23 -0
- data/lib/bundler/man/bundle-show.1.ronn +21 -0
- data/lib/bundler/man/bundle-update.1 +394 -0
- data/lib/bundler/man/bundle-update.1.ronn +350 -0
- data/lib/bundler/man/bundle-viz.1 +39 -0
- data/lib/bundler/man/bundle-viz.1.ronn +30 -0
- data/lib/bundler/man/bundle.1 +136 -0
- data/lib/bundler/man/bundle.1.ronn +111 -0
- data/lib/bundler/man/gemfile.5 +686 -0
- data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
- data/lib/bundler/man/index.txt +25 -0
- data/lib/bundler/match_platform.rb +15 -4
- data/lib/bundler/mirror.rb +223 -0
- data/lib/bundler/plugin.rb +330 -0
- data/lib/bundler/plugin/api.rb +81 -0
- data/lib/bundler/plugin/api/source.rb +304 -0
- data/lib/bundler/plugin/dsl.rb +53 -0
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +182 -0
- data/lib/bundler/plugin/installer.rb +109 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +27 -0
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +2 -6
- data/lib/bundler/remote_specification.rb +42 -9
- data/lib/bundler/resolver.rb +312 -225
- data/lib/bundler/resolver/spec_group.rb +122 -0
- data/lib/bundler/retry.rb +11 -5
- data/lib/bundler/ruby_dsl.rb +9 -2
- data/lib/bundler/ruby_version.rb +84 -61
- data/lib/bundler/rubygems_ext.rb +92 -53
- data/lib/bundler/rubygems_gem_installer.rb +84 -0
- data/lib/bundler/rubygems_integration.rb +320 -395
- data/lib/bundler/runtime.rb +87 -75
- data/lib/bundler/settings.rb +297 -119
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +13 -12
- data/lib/bundler/shared_helpers.rb +234 -53
- data/lib/bundler/similarity_detector.rb +5 -3
- data/lib/bundler/source.rb +63 -4
- data/lib/bundler/source/gemspec.rb +18 -0
- data/lib/bundler/source/git.rb +97 -50
- data/lib/bundler/source/git/git_proxy.rb +138 -65
- data/lib/bundler/source/metadata.rb +67 -0
- data/lib/bundler/source/path.rb +83 -47
- data/lib/bundler/source/path/installer.rb +42 -11
- data/lib/bundler/source/rubygems.rb +231 -116
- data/lib/bundler/source/rubygems/remote.rb +30 -1
- data/lib/bundler/source_list.rb +103 -21
- data/lib/bundler/spec_set.rb +96 -51
- data/lib/bundler/stub_specification.rb +87 -4
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +14 -1
- data/lib/bundler/templates/Executable.bundler +114 -0
- data/lib/bundler/templates/Executable.standalone +6 -4
- data/lib/bundler/templates/Gemfile +4 -1
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
- data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +16 -10
- data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
- data/lib/bundler/templates/newgem/bin/console.tt +2 -1
- 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/ext/newgem/newgem.c.tt +4 -4
- data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/lib/bundler/templates/newgem/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
- 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 → travis.yml.tt} +2 -0
- data/lib/bundler/ui.rb +5 -3
- data/lib/bundler/ui/rg_proxy.rb +3 -1
- data/lib/bundler/ui/shell.rb +54 -21
- data/lib/bundler/ui/silent.rb +26 -1
- data/lib/bundler/uri_credentials_filter.rb +43 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
- 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/thor/lib/thor.rb +58 -25
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
- data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
- data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
- data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -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/vendored_fileutils.rb +4 -0
- data/lib/bundler/vendored_molinillo.rb +3 -1
- data/lib/bundler/vendored_persistent.rb +45 -9
- data/lib/bundler/vendored_thor.rb +8 -3
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +7 -4
- data/lib/bundler/version_ranges.rb +122 -0
- data/lib/bundler/vlad.rb +8 -2
- data/lib/bundler/worker.rb +38 -6
- data/lib/bundler/yaml_serializer.rb +89 -0
- metadata +164 -158
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -105
- data/.rubocop_todo.yml +0 -120
- data/.travis.yml +0 -97
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -32
- data/DEVELOPMENT.md +0 -118
- data/ISSUES.md +0 -96
- data/Rakefile +0 -309
- data/bin/rake +0 -14
- data/bin/rspec +0 -10
- data/bin/rubocop +0 -11
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -45
- data/lib/bundler/environment.rb +0 -41
- data/lib/bundler/gem_path_manipulation.rb +0 -8
- data/lib/bundler/gem_remote_fetcher.rb +0 -41
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
- data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- data/lib/bundler/vendor/net/http/faster.rb +0 -26
- data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
- data/man/bundle-config.ronn +0 -187
- data/man/bundle-update.ronn +0 -188
- data/man/bundle.ronn +0 -98
- data/man/index.txt +0 -8
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Add
|
5
|
+
attr_reader :gems, :options, :version
|
6
|
+
|
7
|
+
def initialize(options, gems)
|
8
|
+
@gems = gems
|
9
|
+
@options = options
|
10
|
+
@options[:group] = options[:group].split(",").map(&:strip) unless options[:group].nil?
|
11
|
+
@version = options[:version].split(",").map(&:strip) unless options[:version].nil?
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
validate_options!
|
16
|
+
inject_dependencies
|
17
|
+
perform_bundle_install unless options["skip-install"]
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def perform_bundle_install
|
23
|
+
Installer.install(Bundler.root, Bundler.definition)
|
24
|
+
Bundler.load.cache if Bundler.app_cache.exist?
|
25
|
+
end
|
26
|
+
|
27
|
+
def inject_dependencies
|
28
|
+
dependencies = gems.map {|g| Bundler::Dependency.new(g, version, options) }
|
29
|
+
|
30
|
+
Injector.inject(dependencies,
|
31
|
+
:conservative_versioning => options[:version].nil?, # Perform conservative versioning only when version is not specified
|
32
|
+
:optimistic => options[:optimistic],
|
33
|
+
:strict => options[:strict])
|
34
|
+
end
|
35
|
+
|
36
|
+
def validate_options!
|
37
|
+
raise InvalidOption, "You can not specify `--strict` and `--optimistic` at the same time." if options[:strict] && options[:optimistic]
|
38
|
+
|
39
|
+
# raise error when no gems are specified
|
40
|
+
raise InvalidOption, "Please specify gems to add." if gems.empty?
|
41
|
+
|
42
|
+
version.to_a.each do |v|
|
43
|
+
raise InvalidOption, "Invalid gem requirement pattern '#{v}'" unless Gem::Requirement::PATTERN =~ v.to_s
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/bundler/cli/binstubs.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
class CLI::Binstubs
|
@@ -9,27 +9,43 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
Bundler.definition.
|
13
|
-
|
14
|
-
|
12
|
+
Bundler.definition.validate_runtime!
|
13
|
+
path_option = options["path"]
|
14
|
+
path_option = nil if path_option && path_option.empty?
|
15
|
+
Bundler.settings.set_command_option :bin, path_option if options["path"]
|
16
|
+
Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
|
15
17
|
installer = Installer.new(Bundler.root, Bundler.definition)
|
16
18
|
|
17
|
-
|
19
|
+
installer_opts = {
|
20
|
+
:force => options[:force],
|
21
|
+
:binstubs_cmd => true,
|
22
|
+
:all_platforms => options["all-platforms"],
|
23
|
+
}
|
24
|
+
|
25
|
+
if options[:all]
|
26
|
+
raise InvalidOption, "Cannot specify --all with specific gems" unless gems.empty?
|
27
|
+
@gems = Bundler.definition.specs.map(&:name)
|
28
|
+
installer_opts.delete(:binstubs_cmd)
|
29
|
+
elsif gems.empty?
|
18
30
|
Bundler.ui.error "`bundle binstubs` needs at least one gem to run."
|
19
31
|
exit 1
|
20
32
|
end
|
21
33
|
|
22
34
|
gems.each do |gem_name|
|
23
|
-
spec =
|
35
|
+
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
|
24
36
|
unless spec
|
25
37
|
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(
|
26
|
-
gem_name, Bundler.definition.specs
|
38
|
+
gem_name, Bundler.definition.specs
|
39
|
+
)
|
27
40
|
end
|
28
41
|
|
29
|
-
if
|
30
|
-
Bundler.ui.warn
|
42
|
+
if options[:standalone]
|
43
|
+
next Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") if gem_name == "bundler"
|
44
|
+
Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do
|
45
|
+
installer.generate_standalone_bundler_executable_stubs(spec, installer_opts)
|
46
|
+
end
|
31
47
|
else
|
32
|
-
installer.generate_bundler_executable_stubs(spec,
|
48
|
+
installer.generate_bundler_executable_stubs(spec, installer_opts)
|
33
49
|
end
|
34
50
|
end
|
35
51
|
end
|
data/lib/bundler/cli/cache.rb
CHANGED
@@ -1,34 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class CLI::Cache
|
3
5
|
attr_reader :options
|
6
|
+
|
4
7
|
def initialize(options)
|
5
8
|
@options = options
|
6
9
|
end
|
7
10
|
|
8
11
|
def run
|
9
|
-
Bundler.
|
10
|
-
Bundler.
|
12
|
+
Bundler.ui.level = "error" if options[:quiet]
|
13
|
+
Bundler.settings.set_command_option_if_given :path, options[:path]
|
14
|
+
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
|
15
|
+
|
11
16
|
setup_cache_all
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Bundler.
|
16
|
-
|
17
|
-
Bundler.
|
18
|
-
|
19
|
-
|
17
|
+
install
|
18
|
+
|
19
|
+
# TODO: move cache contents here now that all bundles are locked
|
20
|
+
custom_path = Bundler.settings[:path] if options[:path]
|
21
|
+
|
22
|
+
Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do
|
23
|
+
Bundler.load.cache(custom_path)
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
|
-
|
27
|
+
private
|
28
|
+
|
29
|
+
def install
|
30
|
+
require_relative "install"
|
31
|
+
options = self.options.dup
|
32
|
+
options["local"] = false if Bundler.settings[:cache_all_platforms]
|
33
|
+
Bundler::CLI::Install.new(options).run
|
34
|
+
end
|
23
35
|
|
24
36
|
def setup_cache_all
|
25
|
-
|
37
|
+
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
|
26
38
|
|
27
|
-
|
28
|
-
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
|
29
|
-
"to package them as well, please pass the --all flag. This will be the default " \
|
30
|
-
"on Bundler 2.0."
|
31
|
-
end
|
39
|
+
Bundler.settings.set_command_option_if_given :cache_all, all
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
data/lib/bundler/cli/check.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class CLI::Check
|
3
5
|
attr_reader :options
|
6
|
+
|
4
7
|
def initialize(options)
|
5
8
|
@options = options
|
6
9
|
end
|
7
10
|
|
8
11
|
def run
|
9
|
-
|
10
|
-
|
11
|
-
Bundler.settings[:disable_shared_gems] = "1"
|
12
|
-
end
|
12
|
+
Bundler.settings.set_command_option_if_given :path, options[:path]
|
13
|
+
|
13
14
|
begin
|
14
15
|
definition = Bundler.definition
|
15
|
-
definition.
|
16
|
+
definition.validate_runtime!
|
16
17
|
not_installed = definition.missing_specs
|
17
18
|
rescue GemNotFound, VersionConflict
|
18
19
|
Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
|
@@ -25,11 +26,11 @@ module Bundler
|
|
25
26
|
not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
|
26
27
|
Bundler.ui.warn "Install missing gems with `bundle install`"
|
27
28
|
exit 1
|
28
|
-
elsif !Bundler.default_lockfile.
|
29
|
+
elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
|
29
30
|
Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
|
30
31
|
exit 1
|
31
32
|
else
|
32
|
-
Bundler.load.lock(:
|
33
|
+
Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"]
|
33
34
|
Bundler.ui.info "The Gemfile's dependencies are satisfied"
|
34
35
|
end
|
35
36
|
end
|
data/lib/bundler/cli/clean.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
class CLI::Clean
|
3
5
|
attr_reader :options
|
@@ -7,19 +9,17 @@ module Bundler
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def run
|
10
|
-
require_path_or_force
|
12
|
+
require_path_or_force unless options[:"dry-run"]
|
11
13
|
Bundler.load.clean(options[:"dry-run"])
|
12
14
|
end
|
13
15
|
|
14
|
-
|
16
|
+
protected
|
15
17
|
|
16
18
|
def require_path_or_force
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
exit 1
|
22
|
-
end
|
19
|
+
return unless Bundler.use_system_gems? && !options[:force]
|
20
|
+
raise InvalidOption, "Cleaning all the gems on your system is dangerous! " \
|
21
|
+
"If you're sure you want to remove every system gem not in this " \
|
22
|
+
"bundle, run `bundle clean --force`."
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/bundler/cli/common.rb
CHANGED
@@ -1,11 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
4
|
module CLI::Common
|
3
|
-
def self.
|
4
|
-
|
5
|
+
def self.output_post_install_messages(messages)
|
6
|
+
return if Bundler.settings["ignore_messages"]
|
7
|
+
messages.to_a.each do |name, msg|
|
8
|
+
print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.print_post_install_message(name, msg)
|
13
|
+
Bundler.ui.confirm "Post-install message from #{name}:"
|
14
|
+
Bundler.ui.info msg
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.output_fund_metadata_summary
|
18
|
+
definition = Bundler.definition
|
19
|
+
current_dependencies = definition.requested_dependencies
|
20
|
+
current_specs = definition.specs
|
21
|
+
|
22
|
+
count = current_dependencies.count {|dep| current_specs[dep.name].first.metadata.key?("funding_uri") }
|
23
|
+
|
24
|
+
return if count.zero?
|
25
|
+
|
26
|
+
intro = count > 1 ? "#{count} installed gems you directly depend on are" : "#{count} installed gem you directly depend on is"
|
27
|
+
message = "#{intro} looking for funding.\n Run `bundle fund` for details"
|
28
|
+
Bundler.ui.info message
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.output_without_groups_message(command)
|
32
|
+
return if Bundler.settings[:without].empty?
|
33
|
+
Bundler.ui.confirm without_groups_message(command)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.without_groups_message(command)
|
37
|
+
command_in_past_tense = command == :install ? "installed" : "updated"
|
38
|
+
groups = Bundler.settings[:without]
|
5
39
|
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
|
6
40
|
reject {|s| s.to_s.empty? }.join(" and ")
|
7
|
-
group_str =
|
8
|
-
"Gems in the #{group_str} #{group_list} were not
|
41
|
+
group_str = groups.size == 1 ? "group" : "groups"
|
42
|
+
"Gems in the #{group_str} #{group_list} were not #{command_in_past_tense}."
|
9
43
|
end
|
10
44
|
|
11
45
|
def self.select_spec(name, regex_match = nil)
|
@@ -30,10 +64,6 @@ module Bundler
|
|
30
64
|
end
|
31
65
|
|
32
66
|
def self.ask_for_spec_from(specs)
|
33
|
-
if !$stdout.tty? && ENV["BUNDLE_SPEC_RUN"].nil?
|
34
|
-
raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
|
35
|
-
end
|
36
|
-
|
37
67
|
specs.each_with_index do |spec, index|
|
38
68
|
Bundler.ui.info "#{index.succ} : #{spec.name}", true
|
39
69
|
end
|
@@ -44,12 +74,42 @@ module Bundler
|
|
44
74
|
end
|
45
75
|
|
46
76
|
def self.gem_not_found_message(missing_gem_name, alternatives)
|
47
|
-
|
77
|
+
require_relative "../similarity_detector"
|
48
78
|
message = "Could not find gem '#{missing_gem_name}'."
|
49
79
|
alternate_names = alternatives.map {|a| a.respond_to?(:name) ? a.name : a }
|
50
80
|
suggestions = SimilarityDetector.new(alternate_names).similar_word_list(missing_gem_name)
|
51
81
|
message += "\nDid you mean #{suggestions}?" if suggestions
|
52
82
|
message
|
53
83
|
end
|
84
|
+
|
85
|
+
def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
|
86
|
+
locked_names = locked_gems.specs.map(&:name).uniq
|
87
|
+
names.-(locked_names).each do |g|
|
88
|
+
raise GemNotFound, gem_not_found_message(g, locked_names)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.configure_gem_version_promoter(definition, options)
|
93
|
+
patch_level = patch_level_options(options)
|
94
|
+
patch_level << :patch if patch_level.empty? && Bundler.settings[:prefer_patch]
|
95
|
+
raise InvalidOption, "Provide only one of the following options: #{patch_level.join(", ")}" unless patch_level.length <= 1
|
96
|
+
|
97
|
+
definition.gem_version_promoter.tap do |gvp|
|
98
|
+
gvp.level = patch_level.first || :major
|
99
|
+
gvp.strict = options[:strict] || options["update-strict"] || options["filter-strict"]
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.patch_level_options(options)
|
104
|
+
[:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.clean_after_install?
|
108
|
+
clean = Bundler.settings[:clean]
|
109
|
+
return clean unless clean.nil?
|
110
|
+
clean ||= Bundler.feature_flag.auto_clean_without_path? && Bundler.settings[:path].nil?
|
111
|
+
clean &&= !Bundler.use_system_gems?
|
112
|
+
clean
|
113
|
+
end
|
54
114
|
end
|
55
115
|
end
|
data/lib/bundler/cli/config.rb
CHANGED
@@ -1,100 +1,194 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bundler
|
2
|
-
class CLI::Config
|
3
|
-
|
4
|
-
attr_accessor :args
|
5
|
-
|
6
|
-
def initialize(options, args, thor)
|
7
|
-
@options = options
|
8
|
-
@args = args
|
9
|
-
@thor = thor
|
10
|
-
@name = peek = args.shift
|
11
|
-
@scope = "global"
|
12
|
-
if peek && peek =~ /^\-\-/
|
13
|
-
@name = args.shift
|
14
|
-
@scope = $'
|
15
|
-
end
|
16
|
-
end
|
4
|
+
class CLI::Config < Thor
|
5
|
+
class_option :parseable, :type => :boolean, :banner => "Use minimal formatting for more parseable output"
|
17
6
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
7
|
+
def self.scope_options
|
8
|
+
method_option :global, :type => :boolean, :banner => "Only change the global config"
|
9
|
+
method_option :local, :type => :boolean, :banner => "Only change the local config"
|
10
|
+
end
|
11
|
+
private_class_method :scope_options
|
23
12
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
desc "base NAME [VALUE]", "The Bundler 1 config interface", :hide => true
|
14
|
+
scope_options
|
15
|
+
method_option :delete, :type => :boolean, :banner => "delete"
|
16
|
+
def base(name = nil, *value)
|
17
|
+
new_args =
|
18
|
+
if ARGV.size == 1
|
19
|
+
["config", "list"]
|
20
|
+
elsif ARGV.include?("--delete")
|
21
|
+
ARGV.map {|arg| arg == "--delete" ? "unset" : arg }
|
22
|
+
elsif ARGV.include?("--global") || ARGV.include?("--local") || ARGV.size == 3
|
23
|
+
["config", "set", *ARGV[1..-1]]
|
24
|
+
else
|
25
|
+
["config", "get", ARGV[1]]
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
Bundler.settings.set_global(name, nil)
|
32
|
-
return
|
33
|
-
end
|
28
|
+
SharedHelpers.major_deprecation 3,
|
29
|
+
"Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
return
|
38
|
-
end
|
31
|
+
Base.new(options, name, value, self).run
|
32
|
+
end
|
39
33
|
|
40
|
-
|
41
|
-
|
34
|
+
desc "list", "List out all configured settings"
|
35
|
+
def list
|
36
|
+
Base.new(options, nil, nil, self).run
|
42
37
|
end
|
43
38
|
|
44
|
-
|
39
|
+
desc "get NAME", "Returns the value for the given key"
|
40
|
+
def get(name)
|
41
|
+
Base.new(options, name, nil, self).run
|
42
|
+
end
|
45
43
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
show_pretty_values_for(setting)
|
51
|
-
Bundler.ui.confirm ""
|
52
|
-
end
|
44
|
+
desc "set NAME VALUE", "Sets the given value for the given key"
|
45
|
+
scope_options
|
46
|
+
def set(name, value, *value_)
|
47
|
+
Base.new(options, name, value_.unshift(value), self).run
|
53
48
|
end
|
54
49
|
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
desc "unset NAME", "Unsets the value for the given key"
|
51
|
+
scope_options
|
52
|
+
def unset(name)
|
53
|
+
options[:delete] = true
|
54
|
+
Base.new(options, name, nil, self).run
|
58
55
|
end
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
57
|
+
default_task :base
|
58
|
+
|
59
|
+
class Base
|
60
|
+
attr_reader :name, :value, :options, :scope, :thor
|
61
|
+
|
62
|
+
def initialize(options, name, value, thor)
|
63
|
+
@options = options
|
64
|
+
@name = name
|
65
|
+
value = Array(value)
|
66
|
+
@value = value.empty? ? nil : value.join(" ")
|
67
|
+
@thor = thor
|
68
|
+
validate_scope!
|
66
69
|
end
|
67
|
-
end
|
68
70
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
71
|
+
def run
|
72
|
+
unless name
|
73
|
+
warn_unused_scope "Ignoring --#{scope}"
|
74
|
+
confirm_all
|
75
|
+
return
|
76
|
+
end
|
77
|
+
|
78
|
+
if options[:delete]
|
79
|
+
if !explicit_scope? || scope != "global"
|
80
|
+
Bundler.settings.set_local(name, nil)
|
81
|
+
end
|
82
|
+
if !explicit_scope? || scope != "local"
|
83
|
+
Bundler.settings.set_global(name, nil)
|
84
|
+
end
|
85
|
+
return
|
86
|
+
end
|
87
|
+
|
88
|
+
if value.nil?
|
89
|
+
warn_unused_scope "Ignoring --#{scope} since no value to set was given"
|
90
|
+
|
91
|
+
if options[:parseable]
|
92
|
+
if value = Bundler.settings[name]
|
93
|
+
Bundler.ui.info("#{name}=#{value}")
|
94
|
+
end
|
95
|
+
return
|
96
|
+
end
|
97
|
+
|
98
|
+
confirm(name)
|
99
|
+
return
|
81
100
|
end
|
82
|
-
|
83
|
-
|
84
|
-
|
101
|
+
|
102
|
+
Bundler.ui.info(message) if message
|
103
|
+
Bundler.settings.send("set_#{scope}", name, new_value)
|
85
104
|
end
|
86
|
-
end
|
87
105
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
106
|
+
def confirm_all
|
107
|
+
if @options[:parseable]
|
108
|
+
thor.with_padding do
|
109
|
+
Bundler.settings.all.each do |setting|
|
110
|
+
val = Bundler.settings[setting]
|
111
|
+
Bundler.ui.info "#{setting}=#{val}"
|
112
|
+
end
|
113
|
+
end
|
114
|
+
else
|
115
|
+
Bundler.ui.confirm "Settings are listed in order of priority. The top value will be used.\n"
|
116
|
+
Bundler.settings.all.each do |setting|
|
117
|
+
Bundler.ui.confirm setting
|
118
|
+
show_pretty_values_for(setting)
|
119
|
+
Bundler.ui.confirm ""
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def confirm(name)
|
125
|
+
Bundler.ui.confirm "Settings for `#{name}` in order of priority. The top value will be used"
|
126
|
+
show_pretty_values_for(name)
|
127
|
+
end
|
128
|
+
|
129
|
+
def new_value
|
130
|
+
pathname = Pathname.new(value)
|
131
|
+
if name.start_with?("local.") && pathname.directory?
|
132
|
+
pathname.expand_path.to_s
|
133
|
+
else
|
134
|
+
value
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def message
|
139
|
+
locations = Bundler.settings.locations(name)
|
140
|
+
if @options[:parseable]
|
141
|
+
"#{name}=#{new_value}" if new_value
|
142
|
+
elsif scope == "global"
|
143
|
+
if !locations[:local].nil?
|
144
|
+
"Your application has set #{name} to #{locations[:local].inspect}. " \
|
145
|
+
"This will override the global value you are currently setting"
|
146
|
+
elsif locations[:env]
|
147
|
+
"You have a bundler environment variable for #{name} set to " \
|
148
|
+
"#{locations[:env].inspect}. This will take precedence over the global value you are setting"
|
149
|
+
elsif !locations[:global].nil? && locations[:global] != value
|
150
|
+
"You are replacing the current global value of #{name}, which is currently " \
|
151
|
+
"#{locations[:global].inspect}"
|
152
|
+
end
|
153
|
+
elsif scope == "local" && !locations[:local].nil? && locations[:local] != value
|
154
|
+
"You are replacing the current local value of #{name}, which is currently " \
|
155
|
+
"#{locations[:local].inspect}"
|
92
156
|
end
|
93
157
|
end
|
94
|
-
end
|
95
158
|
|
96
|
-
|
97
|
-
|
159
|
+
def show_pretty_values_for(setting)
|
160
|
+
thor.with_padding do
|
161
|
+
Bundler.settings.pretty_values_for(setting).each do |line|
|
162
|
+
Bundler.ui.info line
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
def explicit_scope?
|
168
|
+
@explicit_scope
|
169
|
+
end
|
170
|
+
|
171
|
+
def warn_unused_scope(msg)
|
172
|
+
return unless explicit_scope?
|
173
|
+
return if options[:parseable]
|
174
|
+
|
175
|
+
Bundler.ui.warn(msg)
|
176
|
+
end
|
177
|
+
|
178
|
+
def validate_scope!
|
179
|
+
@explicit_scope = true
|
180
|
+
scopes = %w[global local].select {|s| options[s] }
|
181
|
+
case scopes.size
|
182
|
+
when 0
|
183
|
+
@scope = "global"
|
184
|
+
@explicit_scope = false
|
185
|
+
when 1
|
186
|
+
@scope = scopes.first
|
187
|
+
else
|
188
|
+
raise InvalidOption,
|
189
|
+
"The options #{scopes.join " and "} were specified. Please only use one of the switches at a time."
|
190
|
+
end
|
191
|
+
end
|
98
192
|
end
|
99
193
|
end
|
100
194
|
end
|