rubygems-update 2.6.4 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +18 -24
- data/CODE_OF_CONDUCT.md +2 -2
- data/CONTRIBUTING.rdoc +1 -1
- data/History.txt +30 -1
- data/Manifest.txt +233 -3
- data/Rakefile +30 -1
- data/appveyor.yml +0 -2
- data/bundler/CHANGELOG.md +2407 -0
- data/bundler/CODE_OF_CONDUCT.md +42 -0
- data/bundler/CONTRIBUTING.md +36 -0
- data/bundler/DEVELOPMENT.md +148 -0
- data/bundler/ISSUES.md +100 -0
- data/bundler/LICENSE.md +23 -0
- data/bundler/README.md +40 -0
- data/bundler/exe/bundle +35 -0
- data/bundler/exe/bundle_ruby +61 -0
- data/bundler/exe/bundler +22 -0
- data/bundler/lib/bundler.rb +455 -0
- data/bundler/lib/bundler/capistrano.rb +17 -0
- data/bundler/lib/bundler/cli.rb +497 -0
- data/bundler/lib/bundler/cli/binstubs.rb +40 -0
- data/bundler/lib/bundler/cli/cache.rb +35 -0
- data/bundler/lib/bundler/cli/check.rb +40 -0
- data/bundler/lib/bundler/cli/clean.rb +26 -0
- data/bundler/lib/bundler/cli/common.rb +56 -0
- data/bundler/lib/bundler/cli/config.rb +100 -0
- data/bundler/lib/bundler/cli/console.rb +39 -0
- data/bundler/lib/bundler/cli/exec.rb +82 -0
- data/bundler/lib/bundler/cli/gem.rb +214 -0
- data/bundler/lib/bundler/cli/init.rb +33 -0
- data/bundler/lib/bundler/cli/inject.rb +33 -0
- data/bundler/lib/bundler/cli/install.rb +225 -0
- data/bundler/lib/bundler/cli/lock.rb +48 -0
- data/bundler/lib/bundler/cli/open.rb +25 -0
- data/bundler/lib/bundler/cli/outdated.rb +151 -0
- data/bundler/lib/bundler/cli/package.rb +46 -0
- data/bundler/lib/bundler/cli/platform.rb +45 -0
- data/bundler/lib/bundler/cli/plugin.rb +23 -0
- data/bundler/lib/bundler/cli/show.rb +75 -0
- data/bundler/lib/bundler/cli/update.rb +72 -0
- data/bundler/lib/bundler/cli/viz.rb +27 -0
- data/bundler/lib/bundler/constants.rb +6 -0
- data/bundler/lib/bundler/current_ruby.rb +84 -0
- data/bundler/lib/bundler/definition.rb +744 -0
- data/bundler/lib/bundler/dep_proxy.rb +46 -0
- data/bundler/lib/bundler/dependency.rb +127 -0
- data/bundler/lib/bundler/deployment.rb +63 -0
- data/bundler/lib/bundler/deprecate.rb +16 -0
- data/bundler/lib/bundler/dsl.rb +512 -0
- data/bundler/lib/bundler/endpoint_specification.rb +129 -0
- data/bundler/lib/bundler/env.rb +83 -0
- data/bundler/lib/bundler/environment.rb +42 -0
- data/bundler/lib/bundler/environment_preserver.rb +38 -0
- data/bundler/lib/bundler/errors.rb +124 -0
- data/bundler/lib/bundler/fetcher.rb +304 -0
- data/bundler/lib/bundler/fetcher/base.rb +41 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +103 -0
- data/bundler/lib/bundler/fetcher/dependency.rb +92 -0
- data/bundler/lib/bundler/fetcher/downloader.rb +66 -0
- data/bundler/lib/bundler/fetcher/index.rb +51 -0
- data/bundler/lib/bundler/friendly_errors.rb +103 -0
- data/bundler/lib/bundler/gem_helper.rb +188 -0
- data/bundler/lib/bundler/gem_helpers.rb +32 -0
- data/bundler/lib/bundler/gem_remote_fetcher.rb +42 -0
- data/bundler/lib/bundler/gem_tasks.rb +6 -0
- data/bundler/lib/bundler/graph.rb +172 -0
- data/bundler/lib/bundler/index.rb +191 -0
- data/bundler/lib/bundler/injector.rb +63 -0
- data/bundler/lib/bundler/inline.rb +74 -0
- data/bundler/lib/bundler/installer.rb +217 -0
- data/bundler/lib/bundler/installer/gem_installer.rb +77 -0
- data/bundler/lib/bundler/installer/parallel_installer.rb +126 -0
- data/bundler/lib/bundler/installer/standalone.rb +52 -0
- data/bundler/lib/bundler/lazy_specification.rb +85 -0
- data/bundler/lib/bundler/lockfile_parser.rb +233 -0
- data/bundler/lib/bundler/match_platform.rb +14 -0
- data/bundler/lib/bundler/mirror.rb +218 -0
- data/bundler/lib/bundler/plugin.rb +156 -0
- data/bundler/lib/bundler/plugin/api.rb +56 -0
- data/bundler/lib/bundler/plugin/dsl.rb +29 -0
- data/bundler/lib/bundler/plugin/index.rb +88 -0
- data/bundler/lib/bundler/plugin/installer.rb +99 -0
- data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
- data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/bundler/lib/bundler/plugin/source_list.rb +24 -0
- data/bundler/lib/bundler/postit_trampoline.rb +57 -0
- data/bundler/lib/bundler/psyched_yaml.rb +27 -0
- data/bundler/lib/bundler/remote_specification.rb +85 -0
- data/bundler/lib/bundler/resolver.rb +368 -0
- data/bundler/lib/bundler/retry.rb +61 -0
- data/bundler/lib/bundler/ruby_dsl.rb +17 -0
- data/bundler/lib/bundler/ruby_version.rb +140 -0
- data/bundler/lib/bundler/rubygems_ext.rb +178 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +10 -0
- data/bundler/lib/bundler/rubygems_integration.rb +710 -0
- data/bundler/lib/bundler/runtime.rb +282 -0
- data/bundler/lib/bundler/settings.rb +259 -0
- data/bundler/lib/bundler/setup.rb +28 -0
- data/bundler/lib/bundler/shared_helpers.rb +212 -0
- data/bundler/lib/bundler/similarity_detector.rb +62 -0
- data/bundler/lib/bundler/source.rb +37 -0
- data/bundler/lib/bundler/source/gemspec.rb +13 -0
- data/bundler/lib/bundler/source/git.rb +297 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +218 -0
- data/bundler/lib/bundler/source/path.rb +245 -0
- data/bundler/lib/bundler/source/path/installer.rb +44 -0
- data/bundler/lib/bundler/source/rubygems.rb +450 -0
- data/bundler/lib/bundler/source/rubygems/remote.rb +59 -0
- data/bundler/lib/bundler/source_list.rb +106 -0
- data/bundler/lib/bundler/spec_set.rb +157 -0
- data/bundler/lib/bundler/ssl_certs/.document +1 -0
- data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +65 -0
- data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
- data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
- data/bundler/lib/bundler/stub_specification.rb +24 -0
- data/bundler/lib/bundler/templates/Executable +17 -0
- data/bundler/lib/bundler/templates/Executable.standalone +12 -0
- data/bundler/lib/bundler/templates/Gemfile +5 -0
- data/bundler/lib/bundler/templates/newgem/.travis.yml.tt +5 -0
- data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +4 -0
- data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- data/bundler/lib/bundler/templates/newgem/README.md.tt +41 -0
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
- data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
- data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- data/bundler/lib/bundler/templates/newgem/gitignore.tt +16 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
- data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +46 -0
- data/bundler/lib/bundler/templates/newgem/rspec.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
- data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
- data/bundler/lib/bundler/ui.rb +8 -0
- data/bundler/lib/bundler/ui/rg_proxy.rb +18 -0
- data/bundler/lib/bundler/ui/shell.rb +114 -0
- data/bundler/lib/bundler/ui/silent.rb +48 -0
- data/bundler/lib/bundler/uri_credentials_filter.rb +36 -0
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +79 -0
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +98 -0
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +80 -0
- data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +4 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +10 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +203 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +5 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +100 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +65 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +460 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +45 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +54 -0
- data/bundler/lib/bundler/vendor/net/http/faster.rb +26 -0
- data/bundler/lib/bundler/vendor/net/http/persistent.rb +1230 -0
- data/bundler/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit.rb +15 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit/environment.rb +44 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit/installer.rb +28 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit/parser.rb +21 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit/setup.rb +12 -0
- data/bundler/lib/bundler/vendor/postit/lib/postit/version.rb +3 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +484 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
- data/bundler/lib/bundler/vendored_molinillo.rb +3 -0
- data/bundler/lib/bundler/vendored_persistent.rb +12 -0
- data/bundler/lib/bundler/vendored_thor.rb +4 -0
- data/bundler/lib/bundler/version.rb +11 -0
- data/bundler/lib/bundler/vlad.rb +12 -0
- data/bundler/lib/bundler/worker.rb +82 -0
- data/bundler/lib/bundler/yaml_serializer.rb +67 -0
- data/bundler/man/bundle-config.ronn +193 -0
- data/bundler/man/bundle-exec.ronn +136 -0
- data/bundler/man/bundle-gem.ronn +77 -0
- data/bundler/man/bundle-install.ronn +404 -0
- data/bundler/man/bundle-lock.ronn +47 -0
- data/bundler/man/bundle-package.ronn +67 -0
- data/bundler/man/bundle-platform.ronn +42 -0
- data/bundler/man/bundle-update.ronn +194 -0
- data/bundler/man/bundle.ronn +98 -0
- data/bundler/man/gemfile.5.ronn +499 -0
- data/bundler/man/index.txt +8 -0
- data/lib/rubygems.rb +42 -2
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/defaults.rb +18 -0
- data/lib/rubygems/installer.rb +1 -0
- data/lib/rubygems/package.rb +3 -1
- data/lib/rubygems/package/tar_writer.rb +10 -16
- data/lib/rubygems/remote_fetcher.rb +1 -15
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +57 -145
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
- data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +55 -54
- data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
- data/lib/rubygems/security/signer.rb +2 -0
- data/lib/rubygems/specification.rb +4 -4
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
- data/test/rubygems/alternate_cert.pem +10 -9
- data/test/rubygems/alternate_cert_32.pem +10 -9
- data/test/rubygems/child_cert.pem +11 -9
- data/test/rubygems/child_cert_32.pem +11 -9
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/expired_cert.pem +9 -8
- data/test/rubygems/future_cert.pem +9 -8
- data/test/rubygems/future_cert_32.pem +9 -8
- data/test/rubygems/grandchild_cert.pem +11 -9
- data/test/rubygems/grandchild_cert_32.pem +11 -9
- data/test/rubygems/invalid_issuer_cert.pem +11 -9
- data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
- data/test/rubygems/invalid_signer_cert.pem +10 -9
- data/test/rubygems/invalid_signer_cert_32.pem +10 -9
- data/test/rubygems/invalidchild_cert.pem +11 -9
- data/test/rubygems/invalidchild_cert_32.pem +11 -9
- data/test/rubygems/public_cert.pem +11 -9
- data/test/rubygems/public_cert_32.pem +10 -9
- data/test/rubygems/test_bundled_ca.rb +1 -1
- data/test/rubygems/test_gem.rb +7 -0
- data/test/rubygems/test_gem_installer.rb +119 -0
- data/test/rubygems/test_gem_package.rb +9 -3
- data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -12
- data/test/rubygems/test_gem_security_signer.rb +8 -0
- data/test/rubygems/test_gem_specification.rb +1 -1
- data/test/rubygems/wrong_key_cert.pem +10 -9
- data/test/rubygems/wrong_key_cert_32.pem +10 -9
- data/util/ci +73 -0
- data/util/create_certs.rb +64 -49
- data/util/update_bundled_ca_certificates.rb +23 -2
- metadata +257 -19
- data/lib/gauntlet_rubygems.rb +0 -51
- data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Capistrano task for Bundler.
|
3
|
+
#
|
4
|
+
# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
|
5
|
+
# Bundler will be activated after each new deployment.
|
6
|
+
require "bundler/deployment"
|
7
|
+
require "capistrano/version"
|
8
|
+
|
9
|
+
if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
10
|
+
raise "For Capistrano 3.x integration, please use http://github.com/capistrano/bundler"
|
11
|
+
end
|
12
|
+
|
13
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
14
|
+
before "deploy:finalize_update", "bundle:install"
|
15
|
+
Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
|
16
|
+
set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
|
17
|
+
end
|
@@ -0,0 +1,497 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "bundler"
|
3
|
+
require "bundler/vendored_thor"
|
4
|
+
|
5
|
+
module Bundler
|
6
|
+
class CLI < Thor
|
7
|
+
include Thor::Actions
|
8
|
+
AUTO_INSTALL_CMDS = %w(show binstubs outdated exec open console licenses clean).freeze
|
9
|
+
|
10
|
+
def self.start(*)
|
11
|
+
super
|
12
|
+
rescue Exception => e
|
13
|
+
Bundler.ui = UI::Shell.new
|
14
|
+
raise e
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(*args)
|
18
|
+
super
|
19
|
+
Bundler.reset!
|
20
|
+
|
21
|
+
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
22
|
+
ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile && !custom_gemfile.empty?
|
23
|
+
|
24
|
+
Bundler.settings[:retry] = options[:retry] if options[:retry]
|
25
|
+
|
26
|
+
current_cmd = args.last[:current_command].name
|
27
|
+
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
28
|
+
rescue UnknownArgumentError => e
|
29
|
+
raise InvalidOption, e.message
|
30
|
+
ensure
|
31
|
+
self.options ||= {}
|
32
|
+
Bundler.ui = UI::Shell.new(options)
|
33
|
+
Bundler.ui.level = "debug" if options["verbose"]
|
34
|
+
|
35
|
+
if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
|
36
|
+
Bundler.ui.warn(
|
37
|
+
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
|
38
|
+
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
|
39
|
+
"To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
check_unknown_options!(:except => [:config, :exec])
|
44
|
+
stop_on_unknown_option! :exec
|
45
|
+
|
46
|
+
default_task :install
|
47
|
+
class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
|
48
|
+
class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
|
49
|
+
:desc => "Specify the number of times you wish to attempt network commands"
|
50
|
+
class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
|
51
|
+
|
52
|
+
def help(cli = nil)
|
53
|
+
case cli
|
54
|
+
when "gemfile" then command = "gemfile.5"
|
55
|
+
when nil then command = "bundle"
|
56
|
+
else command = "bundle-#{cli}"
|
57
|
+
end
|
58
|
+
|
59
|
+
manpages = %w(
|
60
|
+
bundle
|
61
|
+
bundle-config
|
62
|
+
bundle-exec
|
63
|
+
bundle-gem
|
64
|
+
bundle-install
|
65
|
+
bundle-package
|
66
|
+
bundle-update
|
67
|
+
bundle-platform
|
68
|
+
gemfile.5)
|
69
|
+
|
70
|
+
if manpages.include?(command)
|
71
|
+
root = File.expand_path("../man", __FILE__)
|
72
|
+
|
73
|
+
if Bundler.which("man") && root !~ %r{^file:/.+!/META-INF/jruby.home/.+}
|
74
|
+
Kernel.exec "man #{root}/#{command}"
|
75
|
+
else
|
76
|
+
puts File.read("#{root}/#{command}.txt")
|
77
|
+
end
|
78
|
+
elsif command_path = Bundler.which("bundler-#{cli}")
|
79
|
+
Kernel.exec(command_path, "--help")
|
80
|
+
else
|
81
|
+
super
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.handle_no_command_error(command, has_namespace = $thor_runner)
|
86
|
+
if Bundler.settings[:plugins] && Bundler::Plugin.command?(command)
|
87
|
+
return Bundler::Plugin.exec_command(command, ARGV[1..-1])
|
88
|
+
end
|
89
|
+
|
90
|
+
return super unless command_path = Bundler.which("bundler-#{command}")
|
91
|
+
|
92
|
+
Kernel.exec(command_path, *ARGV[1..-1])
|
93
|
+
end
|
94
|
+
|
95
|
+
desc "init [OPTIONS]", "Generates a Gemfile into the current working directory"
|
96
|
+
long_desc <<-D
|
97
|
+
Init generates a default Gemfile in the current working directory. When adding a
|
98
|
+
Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
|
99
|
+
dependency listed in the gemspec file to the newly created Gemfile.
|
100
|
+
D
|
101
|
+
method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
|
102
|
+
def init
|
103
|
+
require "bundler/cli/init"
|
104
|
+
Init.new(options.dup).run
|
105
|
+
end
|
106
|
+
|
107
|
+
desc "check [OPTIONS]", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
|
108
|
+
long_desc <<-D
|
109
|
+
Check searches the local machine for each of the gems requested in the Gemfile. If
|
110
|
+
all gems are found, Bundler prints a success message and exits with a status of 0.
|
111
|
+
If not, the first missing gem is listed and Bundler exits status 1.
|
112
|
+
D
|
113
|
+
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
114
|
+
"Lock the Gemfile"
|
115
|
+
method_option "gemfile", :type => :string, :banner =>
|
116
|
+
"Use the specified gemfile instead of Gemfile"
|
117
|
+
method_option "path", :type => :string, :banner =>
|
118
|
+
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
119
|
+
map "c" => "check"
|
120
|
+
def check
|
121
|
+
require "bundler/cli/check"
|
122
|
+
Check.new(options).run
|
123
|
+
end
|
124
|
+
|
125
|
+
desc "install [OPTIONS]", "Install the current environment to the system"
|
126
|
+
long_desc <<-D
|
127
|
+
Install will install all of the gems in the current bundle, making them available
|
128
|
+
for use. In a freshly checked out repository, this command will give you the same
|
129
|
+
gem versions as the last person who updated the Gemfile and ran `bundle update`.
|
130
|
+
|
131
|
+
Passing [DIR] to install (e.g. vendor) will cause the unpacked gems to be installed
|
132
|
+
into the [DIR] directory rather than into system gems.
|
133
|
+
|
134
|
+
If the bundle has already been installed, bundler will tell you so and then exit.
|
135
|
+
D
|
136
|
+
method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
|
137
|
+
"Generate bin stubs for bundled gems to ./bin"
|
138
|
+
method_option "clean", :type => :boolean, :banner =>
|
139
|
+
"Run bundle clean automatically after install"
|
140
|
+
method_option "deployment", :type => :boolean, :banner =>
|
141
|
+
"Install using defaults tuned for deployment environments"
|
142
|
+
method_option "frozen", :type => :boolean, :banner =>
|
143
|
+
"Do not allow the Gemfile.lock to be updated after this install"
|
144
|
+
method_option "full-index", :type => :boolean, :banner =>
|
145
|
+
"Fall back to using the single-file index of all gems"
|
146
|
+
method_option "gemfile", :type => :string, :banner =>
|
147
|
+
"Use the specified gemfile instead of Gemfile"
|
148
|
+
method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
|
149
|
+
"Specify the number of jobs to run in parallel"
|
150
|
+
method_option "local", :type => :boolean, :banner =>
|
151
|
+
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
152
|
+
method_option "no-cache", :type => :boolean, :banner =>
|
153
|
+
"Don't update the existing gem cache."
|
154
|
+
method_option "force", :type => :boolean, :banner =>
|
155
|
+
"Force downloading every gem."
|
156
|
+
method_option "no-prune", :type => :boolean, :banner =>
|
157
|
+
"Don't remove stale gems from the cache."
|
158
|
+
method_option "path", :type => :string, :banner =>
|
159
|
+
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
160
|
+
method_option "quiet", :type => :boolean, :banner =>
|
161
|
+
"Only output warnings and errors."
|
162
|
+
method_option "shebang", :type => :string, :banner =>
|
163
|
+
"Specify a different shebang executable name than the default (usually 'ruby')"
|
164
|
+
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
|
165
|
+
"Make a bundle that can work without the Bundler runtime"
|
166
|
+
method_option "system", :type => :boolean, :banner =>
|
167
|
+
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
168
|
+
method_option "trust-policy", :alias => "P", :type => :string, :banner =>
|
169
|
+
"Gem trust policy (like gem install -P). Must be one of " +
|
170
|
+
Bundler.rubygems.security_policy_keys.join("|")
|
171
|
+
method_option "without", :type => :array, :banner =>
|
172
|
+
"Exclude gems that are part of the specified named group."
|
173
|
+
method_option "with", :type => :array, :banner =>
|
174
|
+
"Include gems that are part of the specified named group."
|
175
|
+
map "i" => "install"
|
176
|
+
def install
|
177
|
+
require "bundler/cli/install"
|
178
|
+
no_install = Bundler.settings[:no_install]
|
179
|
+
Bundler.settings[:no_install] = false if no_install == true
|
180
|
+
Install.new(options.dup).run
|
181
|
+
ensure
|
182
|
+
Bundler.settings[:no_install] = no_install unless no_install.nil?
|
183
|
+
end
|
184
|
+
|
185
|
+
desc "update [OPTIONS]", "update the current environment"
|
186
|
+
long_desc <<-D
|
187
|
+
Update will install the newest versions of the gems listed in the Gemfile. Use
|
188
|
+
update when you have changed the Gemfile, or if you want to get the newest
|
189
|
+
possible versions of the gems in the bundle.
|
190
|
+
D
|
191
|
+
method_option "full-index", :type => :boolean, :banner =>
|
192
|
+
"Fall back to using the single-file index of all gems"
|
193
|
+
method_option "group", :aliases => "-g", :type => :array, :banner =>
|
194
|
+
"Update a specific group"
|
195
|
+
method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
|
196
|
+
"Specify the number of jobs to run in parallel"
|
197
|
+
method_option "local", :type => :boolean, :banner =>
|
198
|
+
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
199
|
+
method_option "quiet", :type => :boolean, :banner =>
|
200
|
+
"Only output warnings and errors."
|
201
|
+
method_option "source", :type => :array, :banner =>
|
202
|
+
"Update a specific source (and all gems associated with it)"
|
203
|
+
method_option "force", :type => :boolean, :banner =>
|
204
|
+
"Force downloading every gem."
|
205
|
+
method_option "ruby", :type => :boolean, :banner =>
|
206
|
+
"Update ruby specified in Gemfile.lock"
|
207
|
+
method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
|
208
|
+
"Update the locked version of bundler"
|
209
|
+
def update(*gems)
|
210
|
+
require "bundler/cli/update"
|
211
|
+
Update.new(options, gems).run
|
212
|
+
end
|
213
|
+
|
214
|
+
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
|
215
|
+
long_desc <<-D
|
216
|
+
Show lists the names and versions of all gems that are required by your Gemfile.
|
217
|
+
Calling show with [GEM] will list the exact location of that gem on your machine.
|
218
|
+
D
|
219
|
+
method_option "paths", :type => :boolean,
|
220
|
+
:banner => "List the paths of all gems that are required by your Gemfile."
|
221
|
+
method_option "outdated", :type => :boolean,
|
222
|
+
:banner => "Show verbose output including whether gems are outdated."
|
223
|
+
def show(gem_name = nil)
|
224
|
+
require "bundler/cli/show"
|
225
|
+
Show.new(options, gem_name).run
|
226
|
+
end
|
227
|
+
map %w(list) => "show"
|
228
|
+
|
229
|
+
desc "binstubs GEM [OPTIONS]", "Install the binstubs of the listed gem"
|
230
|
+
long_desc <<-D
|
231
|
+
Generate binstubs for executables in [GEM]. Binstubs are put into bin,
|
232
|
+
or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]]
|
233
|
+
will create binstubs for all given gems.
|
234
|
+
D
|
235
|
+
method_option "force", :type => :boolean, :default => false, :banner =>
|
236
|
+
"Overwrite existing binstubs if they exist"
|
237
|
+
method_option "path", :type => :string, :lazy_default => "bin", :banner =>
|
238
|
+
"Binstub destination directory (default bin)"
|
239
|
+
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
|
240
|
+
"Make binstubs that can work without the Bundler runtime"
|
241
|
+
def binstubs(*gems)
|
242
|
+
require "bundler/cli/binstubs"
|
243
|
+
Binstubs.new(options, gems).run
|
244
|
+
end
|
245
|
+
|
246
|
+
desc "outdated GEM [OPTIONS]", "list installed gems with newer versions available"
|
247
|
+
long_desc <<-D
|
248
|
+
Outdated lists the names and versions of gems that have a newer version available
|
249
|
+
in the given source. Calling outdated with [GEM [GEM]] will only check for newer
|
250
|
+
versions of the given gems. Prerelease gems are ignored by default. If your gems
|
251
|
+
are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
252
|
+
D
|
253
|
+
method_option "local", :type => :boolean, :banner =>
|
254
|
+
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
255
|
+
method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
|
256
|
+
method_option "source", :type => :array, :banner => "Check against a specific source"
|
257
|
+
method_option "strict", :type => :boolean, :banner =>
|
258
|
+
"Only list newer versions allowed by your Gemfile requirements"
|
259
|
+
method_option "major", :type => :boolean, :banner => "Only list major newer versions"
|
260
|
+
method_option "minor", :type => :boolean, :banner => "Only list minor newer versions"
|
261
|
+
method_option "patch", :type => :boolean, :banner => "Only list patch newer versions"
|
262
|
+
method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
|
263
|
+
"Use minimal formatting for more parseable output"
|
264
|
+
def outdated(*gems)
|
265
|
+
require "bundler/cli/outdated"
|
266
|
+
Outdated.new(options, gems).run
|
267
|
+
end
|
268
|
+
|
269
|
+
desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
|
270
|
+
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
|
271
|
+
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
272
|
+
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
273
|
+
def cache
|
274
|
+
require "bundler/cli/cache"
|
275
|
+
Cache.new(options).run
|
276
|
+
end
|
277
|
+
|
278
|
+
desc "package [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
279
|
+
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
|
280
|
+
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
281
|
+
method_option "cache-path", :type => :string, :banner =>
|
282
|
+
"Specify a different cache path than the default (vendor/cache)."
|
283
|
+
method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
|
284
|
+
method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only the package."
|
285
|
+
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
286
|
+
method_option "path", :type => :string, :banner =>
|
287
|
+
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
288
|
+
method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
|
289
|
+
method_option "frozen", :type => :boolean, :banner =>
|
290
|
+
"Do not allow the Gemfile.lock to be updated after this package operation's install"
|
291
|
+
long_desc <<-D
|
292
|
+
The package command will copy the .gem files for every gem in the bundle into the
|
293
|
+
directory ./vendor/cache. If you then check that directory into your source
|
294
|
+
control repository, others who check out your source will be able to install the
|
295
|
+
bundle without having to download any additional gems.
|
296
|
+
D
|
297
|
+
def package
|
298
|
+
require "bundler/cli/package"
|
299
|
+
Package.new(options).run
|
300
|
+
end
|
301
|
+
map %w(pack) => :package
|
302
|
+
|
303
|
+
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
304
|
+
method_option :keep_file_descriptors, :type => :boolean, :default => false
|
305
|
+
long_desc <<-D
|
306
|
+
Exec runs a command, providing it access to the gems in the bundle. While using
|
307
|
+
bundle exec you can require and call the bundled gems as if they were installed
|
308
|
+
into the system wide Rubygems repository.
|
309
|
+
D
|
310
|
+
map "e" => "exec"
|
311
|
+
def exec(*args)
|
312
|
+
require "bundler/cli/exec"
|
313
|
+
Exec.new(options, args).run
|
314
|
+
end
|
315
|
+
|
316
|
+
desc "config NAME [VALUE]", "retrieve or set a configuration value"
|
317
|
+
long_desc <<-D
|
318
|
+
Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
|
319
|
+
existing value with the newly provided one.
|
320
|
+
|
321
|
+
By default, setting a configuration value sets it for all projects
|
322
|
+
on the machine.
|
323
|
+
|
324
|
+
If a global setting is superceded by local configuration, this command
|
325
|
+
will show the current value, as well as any superceded values and
|
326
|
+
where they were specified.
|
327
|
+
D
|
328
|
+
def config(*args)
|
329
|
+
require "bundler/cli/config"
|
330
|
+
Config.new(options, args, self).run
|
331
|
+
end
|
332
|
+
|
333
|
+
desc "open GEM", "Opens the source directory of the given bundled gem"
|
334
|
+
def open(name)
|
335
|
+
require "bundler/cli/open"
|
336
|
+
Open.new(options, name).run
|
337
|
+
end
|
338
|
+
|
339
|
+
desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
|
340
|
+
def console(group = nil)
|
341
|
+
require "bundler/cli/console"
|
342
|
+
Console.new(options, group).run
|
343
|
+
end
|
344
|
+
|
345
|
+
desc "version", "Prints the bundler's version information"
|
346
|
+
def version
|
347
|
+
Bundler.ui.info "Bundler version #{Bundler::VERSION}"
|
348
|
+
end
|
349
|
+
map %w(-v --version) => :version
|
350
|
+
|
351
|
+
desc "licenses", "Prints the license of all gems in the bundle"
|
352
|
+
def licenses
|
353
|
+
Bundler.load.specs.sort_by {|s| s.license.to_s }.reverse_each do |s|
|
354
|
+
gem_name = s.name
|
355
|
+
license = s.license || s.licenses
|
356
|
+
|
357
|
+
if license.empty?
|
358
|
+
Bundler.ui.warn "#{gem_name}: Unknown"
|
359
|
+
else
|
360
|
+
Bundler.ui.info "#{gem_name}: #{license}"
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
desc "viz [OPTIONS]", "Generates a visual dependency graph"
|
366
|
+
long_desc <<-D
|
367
|
+
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
368
|
+
Viz requires the ruby-graphviz gem (and its dependencies).
|
369
|
+
The associated gems must also be installed via 'bundle install'.
|
370
|
+
D
|
371
|
+
method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
|
372
|
+
method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
|
373
|
+
method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
|
374
|
+
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
375
|
+
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
376
|
+
def viz
|
377
|
+
require "bundler/cli/viz"
|
378
|
+
Viz.new(options.dup).run
|
379
|
+
end
|
380
|
+
|
381
|
+
desc "gem GEM [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
382
|
+
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
|
383
|
+
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
|
384
|
+
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
|
385
|
+
:lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
|
386
|
+
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
|
387
|
+
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
|
388
|
+
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config gem.mit true`."
|
389
|
+
method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
|
390
|
+
:desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`."
|
391
|
+
def gem(name)
|
392
|
+
require "bundler/cli/gem"
|
393
|
+
Gem.new(options, name, self).run
|
394
|
+
end
|
395
|
+
|
396
|
+
def self.source_root
|
397
|
+
File.expand_path(File.join(File.dirname(__FILE__), "templates"))
|
398
|
+
end
|
399
|
+
|
400
|
+
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
|
401
|
+
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
402
|
+
"Only print out changes, do not clean gems"
|
403
|
+
method_option "force", :type => :boolean, :default => false, :banner =>
|
404
|
+
"Forces clean even if --path is not set"
|
405
|
+
def clean
|
406
|
+
require "bundler/cli/clean"
|
407
|
+
Clean.new(options.dup).run
|
408
|
+
end
|
409
|
+
|
410
|
+
desc "platform [OPTIONS]", "Displays platform compatibility information"
|
411
|
+
method_option "ruby", :type => :boolean, :default => false, :banner =>
|
412
|
+
"only display ruby related platform information"
|
413
|
+
def platform
|
414
|
+
require "bundler/cli/platform"
|
415
|
+
Platform.new(options).run
|
416
|
+
end
|
417
|
+
|
418
|
+
desc "inject GEM VERSION ...", "Add the named gem(s), with version requirements, to the resolved Gemfile"
|
419
|
+
def inject(name, version, *gems)
|
420
|
+
require "bundler/cli/inject"
|
421
|
+
Inject.new(options, name, version, gems).run
|
422
|
+
end
|
423
|
+
|
424
|
+
desc "lock", "Creates a lockfile without installing"
|
425
|
+
method_option "update", :type => :array, :lazy_default => [], :banner =>
|
426
|
+
"ignore the existing lockfile, update all gems by default, or update list of given gems"
|
427
|
+
method_option "local", :type => :boolean, :default => false, :banner =>
|
428
|
+
"do not attempt to fetch remote gemspecs and use the local gem cache only"
|
429
|
+
method_option "print", :type => :boolean, :default => false, :banner =>
|
430
|
+
"print the lockfile to STDOUT instead of writing to the file system"
|
431
|
+
method_option "lockfile", :type => :string, :default => nil, :banner =>
|
432
|
+
"the path the lockfile should be written to"
|
433
|
+
method_option "full-index", :type => :boolean, :default => false, :banner =>
|
434
|
+
"Fall back to using the single-file index of all gems"
|
435
|
+
method_option "add-platform", :type => :array, :default => [], :banner =>
|
436
|
+
"add a new platform to the lockfile"
|
437
|
+
def lock
|
438
|
+
require "bundler/cli/lock"
|
439
|
+
Lock.new(options).run
|
440
|
+
end
|
441
|
+
|
442
|
+
desc "env", "Print information about the environment Bundler is running under"
|
443
|
+
def env
|
444
|
+
Env.new.write($stdout)
|
445
|
+
end
|
446
|
+
|
447
|
+
if Bundler.settings[:plugins]
|
448
|
+
require "bundler/cli/plugin"
|
449
|
+
desc "plugin SUBCOMMAND ...ARGS", "manage the bundler plugins"
|
450
|
+
subcommand "plugin", Plugin
|
451
|
+
end
|
452
|
+
|
453
|
+
# Reformat the arguments passed to bundle that include a --help flag
|
454
|
+
# into the corresponding `bundle help #{command}` call
|
455
|
+
def self.reformatted_help_args(args)
|
456
|
+
bundler_commands = all_commands.keys
|
457
|
+
help_flags = %w(--help -h)
|
458
|
+
exec_commands = %w(e ex exe exec)
|
459
|
+
help_used = args.index {|a| help_flags.include? a }
|
460
|
+
exec_used = args.index {|a| exec_commands.include? a }
|
461
|
+
command = args.find {|a| bundler_commands.include? a }
|
462
|
+
if exec_used && help_used
|
463
|
+
if exec_used + help_used == 1
|
464
|
+
%w(help exec)
|
465
|
+
else
|
466
|
+
args
|
467
|
+
end
|
468
|
+
elsif command.nil?
|
469
|
+
abort("Could not find command \"#{args.join(" ")}\".")
|
470
|
+
else
|
471
|
+
["help", command || args].flatten.compact
|
472
|
+
end
|
473
|
+
end
|
474
|
+
|
475
|
+
private
|
476
|
+
|
477
|
+
# Automatically invoke `bundle install` and resume if
|
478
|
+
# Bundler.settings[:auto_install] exists. This is set through config cmd
|
479
|
+
# `bundle config auto_install 1`.
|
480
|
+
#
|
481
|
+
# Note that this method `nil`s out the global Definition object, so it
|
482
|
+
# should be called first, before you instantiate anything like an
|
483
|
+
# `Installer` that'll keep a reference to the old one instead.
|
484
|
+
def auto_install
|
485
|
+
return unless Bundler.settings[:auto_install]
|
486
|
+
|
487
|
+
begin
|
488
|
+
Bundler.definition.specs
|
489
|
+
rescue GemNotFound
|
490
|
+
Bundler.ui.info "Automatically installing missing gems."
|
491
|
+
Bundler.reset!
|
492
|
+
invoke :install, []
|
493
|
+
Bundler.reset!
|
494
|
+
end
|
495
|
+
end
|
496
|
+
end
|
497
|
+
end
|