bundler 1.13.6 → 1.17.3
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 +554 -9
- data/README.md +28 -5
- data/bundler.gemspec +40 -11
- data/exe/bundle +4 -8
- data/exe/bundle_ruby +4 -3
- data/lib/bundler.rb +162 -68
- data/lib/bundler/build_metadata.rb +53 -0
- data/lib/bundler/capistrano.rb +5 -0
- data/lib/bundler/cli.rb +360 -118
- data/lib/bundler/cli/add.rb +35 -0
- data/lib/bundler/cli/binstubs.rb +18 -10
- data/lib/bundler/cli/cache.rb +6 -5
- data/lib/bundler/cli/check.rb +4 -6
- data/lib/bundler/cli/clean.rb +6 -7
- data/lib/bundler/cli/common.rb +47 -1
- data/lib/bundler/cli/config.rb +26 -7
- data/lib/bundler/cli/console.rb +2 -1
- data/lib/bundler/cli/doctor.rb +63 -18
- data/lib/bundler/cli/exec.rb +12 -5
- data/lib/bundler/cli/gem.rb +59 -21
- data/lib/bundler/cli/info.rb +50 -0
- data/lib/bundler/cli/init.rb +21 -7
- data/lib/bundler/cli/inject.rb +13 -4
- data/lib/bundler/cli/install.rb +72 -101
- data/lib/bundler/cli/issue.rb +40 -0
- data/lib/bundler/cli/list.rb +58 -0
- data/lib/bundler/cli/lock.rb +9 -6
- data/lib/bundler/cli/open.rb +4 -3
- data/lib/bundler/cli/outdated.rb +175 -60
- data/lib/bundler/cli/package.rb +9 -6
- data/lib/bundler/cli/platform.rb +2 -1
- data/lib/bundler/cli/plugin.rb +1 -0
- data/lib/bundler/cli/pristine.rb +47 -0
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +44 -34
- data/lib/bundler/cli/viz.rb +5 -1
- data/lib/bundler/compact_index_client.rb +109 -0
- data/lib/bundler/compact_index_client/cache.rb +118 -0
- data/lib/bundler/compact_index_client/updater.rb +116 -0
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +1 -0
- data/lib/bundler/current_ruby.rb +17 -8
- data/lib/bundler/definition.rb +353 -182
- data/lib/bundler/dep_proxy.rb +3 -1
- data/lib/bundler/dependency.rb +22 -10
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/deprecate.rb +15 -3
- data/lib/bundler/dsl.rb +122 -64
- data/lib/bundler/endpoint_specification.rb +13 -3
- data/lib/bundler/env.rb +110 -38
- data/lib/bundler/environment_preserver.rb +27 -6
- data/lib/bundler/errors.rb +24 -0
- data/lib/bundler/feature_flag.rb +74 -0
- data/lib/bundler/fetcher.rb +18 -11
- data/lib/bundler/fetcher/base.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +7 -5
- data/lib/bundler/fetcher/dependency.rb +3 -2
- data/lib/bundler/fetcher/downloader.rb +25 -7
- data/lib/bundler/fetcher/index.rb +3 -2
- data/lib/bundler/friendly_errors.rb +33 -7
- data/lib/bundler/gem_helper.rb +25 -11
- data/lib/bundler/gem_helpers.rb +70 -1
- data/lib/bundler/gem_remote_fetcher.rb +1 -0
- data/lib/bundler/gem_tasks.rb +1 -0
- data/lib/bundler/gem_version_promoter.rb +17 -2
- data/lib/bundler/gemdeps.rb +29 -0
- data/lib/bundler/graph.rb +1 -0
- data/lib/bundler/index.rb +28 -15
- data/lib/bundler/injector.rb +216 -33
- data/lib/bundler/inline.rb +12 -12
- data/lib/bundler/installer.rb +139 -53
- data/lib/bundler/installer/gem_installer.rb +15 -5
- data/lib/bundler/installer/parallel_installer.rb +113 -28
- data/lib/bundler/installer/standalone.rb +1 -0
- data/lib/bundler/lazy_specification.rb +31 -3
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +50 -37
- data/lib/bundler/match_platform.rb +13 -3
- data/lib/bundler/mirror.rb +10 -5
- data/lib/bundler/plugin.rb +22 -8
- data/lib/bundler/plugin/api.rb +2 -1
- data/lib/bundler/plugin/api/source.rb +17 -4
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +9 -2
- data/lib/bundler/plugin/installer.rb +7 -6
- data/lib/bundler/plugin/source_list.rb +7 -8
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +10 -0
- data/lib/bundler/remote_specification.rb +30 -1
- data/lib/bundler/resolver.rb +187 -194
- data/lib/bundler/resolver/spec_group.rb +106 -0
- data/lib/bundler/retry.rb +5 -1
- data/lib/bundler/ruby_dsl.rb +1 -0
- data/lib/bundler/ruby_version.rb +12 -2
- data/lib/bundler/rubygems_ext.rb +23 -8
- data/lib/bundler/rubygems_gem_installer.rb +90 -0
- data/lib/bundler/rubygems_integration.rb +193 -70
- data/lib/bundler/runtime.rb +39 -22
- data/lib/bundler/settings.rb +245 -85
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/setup.rb +4 -7
- data/lib/bundler/shared_helpers.rb +183 -40
- data/lib/bundler/similarity_detector.rb +1 -0
- data/lib/bundler/source.rb +58 -1
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git.rb +52 -23
- data/lib/bundler/source/git/git_proxy.rb +30 -14
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path.rb +42 -16
- data/lib/bundler/source/path/installer.rb +4 -2
- data/lib/bundler/source/rubygems.rb +171 -82
- data/lib/bundler/source/rubygems/remote.rb +12 -2
- data/lib/bundler/source_list.rb +75 -15
- data/lib/bundler/spec_set.rb +67 -32
- data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
- data/lib/bundler/stub_specification.rb +86 -2
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +13 -1
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Executable.standalone +5 -5
- data/lib/bundler/templates/Gemfile +3 -0
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -2
- data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +14 -8
- data/lib/bundler/templates/newgem/Rakefile.tt +5 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -1
- 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/gitignore.tt +5 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -6
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -12
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -3
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +13 -1
- data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +1 -1
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +3 -3
- data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/lib/bundler/ui.rb +1 -0
- data/lib/bundler/ui/rg_proxy.rb +1 -0
- data/lib/bundler/ui/shell.rb +30 -10
- data/lib/bundler/ui/silent.rb +21 -1
- data/lib/bundler/uri_credentials_filter.rb +1 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +26 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +2 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +12 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +3 -2
- 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 +11 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +13 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +18 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -7
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +499 -128
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +27 -24
- data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +46 -21
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +24 -22
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +66 -18
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +17 -15
- data/lib/bundler/vendor/thor/lib/thor/base.rb +55 -32
- data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -11
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +7 -5
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +94 -63
- data/lib/bundler/vendor/thor/lib/thor/error.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/group.rb +13 -13
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +4 -5
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +16 -16
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +42 -21
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -10
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +31 -29
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +49 -33
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +1 -0
- data/lib/bundler/vendored_persistent.rb +43 -3
- data/lib/bundler/vendored_thor.rb +6 -2
- data/lib/bundler/version.rb +19 -2
- data/lib/bundler/version_ranges.rb +76 -0
- data/lib/bundler/vlad.rb +5 -0
- data/lib/bundler/worker.rb +30 -6
- data/lib/bundler/yaml_serializer.rb +4 -4
- data/man/bundle-add.1 +58 -0
- data/man/bundle-add.1.txt +52 -0
- data/man/bundle-add.ronn +40 -0
- data/{lib/bundler/man/bundle-binstubs → man/bundle-binstubs.1} +11 -1
- data/man/bundle-binstubs.1.txt +48 -0
- data/man/bundle-binstubs.ronn +15 -1
- data/man/bundle-check.1 +31 -0
- data/man/bundle-check.1.txt +33 -0
- data/man/bundle-check.ronn +26 -0
- data/man/bundle-clean.1 +24 -0
- data/man/bundle-clean.1.txt +26 -0
- data/man/bundle-clean.ronn +18 -0
- data/man/bundle-config.1 +497 -0
- data/man/bundle-config.1.txt +529 -0
- data/man/bundle-config.ronn +233 -61
- data/man/bundle-doctor.1 +44 -0
- data/man/bundle-doctor.1.txt +44 -0
- data/man/bundle-doctor.ronn +33 -0
- data/{lib/bundler/man/bundle-exec → man/bundle-exec.1} +6 -3
- data/man/bundle-exec.1.txt +178 -0
- data/man/bundle-exec.ronn +10 -3
- data/{lib/bundler/man/bundle-gem → man/bundle-gem.1} +4 -4
- data/man/bundle-gem.1.txt +91 -0
- data/man/bundle-gem.ronn +3 -2
- data/man/bundle-info.1 +20 -0
- data/man/bundle-info.1.txt +21 -0
- data/man/bundle-info.ronn +17 -0
- data/man/bundle-init.1 +25 -0
- data/man/bundle-init.1.txt +34 -0
- data/man/bundle-init.ronn +29 -0
- data/man/bundle-inject.1 +33 -0
- data/man/bundle-inject.1.txt +32 -0
- data/man/bundle-inject.ronn +22 -0
- data/{lib/bundler/man/bundle-install → man/bundle-install.1} +32 -29
- data/man/bundle-install.1.txt +396 -0
- data/man/bundle-install.ronn +45 -36
- data/man/bundle-list.1 +50 -0
- data/man/bundle-list.1.txt +43 -0
- data/man/bundle-list.ronn +33 -0
- data/{lib/bundler/man/bundle-lock → man/bundle-lock.1} +43 -2
- data/man/bundle-lock.1.txt +93 -0
- data/man/bundle-lock.ronn +47 -0
- data/man/bundle-open.1 +32 -0
- data/man/bundle-open.1.txt +29 -0
- data/man/bundle-open.ronn +19 -0
- data/man/bundle-outdated.1 +155 -0
- data/man/bundle-outdated.1.txt +131 -0
- data/man/bundle-outdated.ronn +111 -0
- data/{lib/bundler/man/bundle-package → man/bundle-package.1} +6 -3
- data/man/bundle-package.1.txt +79 -0
- data/man/bundle-package.ronn +7 -2
- data/{lib/bundler/man/bundle-platform → man/bundle-platform.1} +1 -1
- data/man/bundle-platform.1.txt +57 -0
- data/man/bundle-pristine.1 +34 -0
- data/man/bundle-pristine.1.txt +44 -0
- data/man/bundle-pristine.ronn +34 -0
- data/man/bundle-remove.1 +31 -0
- data/man/bundle-remove.1.txt +34 -0
- data/man/bundle-remove.ronn +23 -0
- data/man/bundle-show.1 +23 -0
- data/man/bundle-show.1.txt +27 -0
- data/man/bundle-show.ronn +21 -0
- data/man/bundle-update.1 +394 -0
- data/man/bundle-update.1.txt +391 -0
- data/man/bundle-update.ronn +172 -16
- data/man/bundle-viz.1 +39 -0
- data/man/bundle-viz.1.txt +39 -0
- data/man/bundle-viz.ronn +30 -0
- data/{lib/bundler/man/bundle → man/bundle.1} +44 -28
- data/man/bundle.1.txt +116 -0
- data/man/bundle.ronn +39 -27
- data/{lib/bundler/man → man}/gemfile.5 +67 -84
- data/man/gemfile.5.ronn +77 -55
- data/man/gemfile.5.txt +653 -0
- data/man/index.txt +25 -8
- metadata +118 -58
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -128
- data/.rubocop_todo.yml +0 -248
- data/.travis.yml +0 -108
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -36
- data/DEVELOPMENT.md +0 -148
- data/ISSUES.md +0 -100
- data/Rakefile +0 -333
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/lib/bundler/man/bundle-binstubs.txt +0 -33
- data/lib/bundler/man/bundle-config +0 -254
- data/lib/bundler/man/bundle-config.txt +0 -282
- data/lib/bundler/man/bundle-exec.txt +0 -171
- data/lib/bundler/man/bundle-gem.txt +0 -90
- data/lib/bundler/man/bundle-install.txt +0 -385
- data/lib/bundler/man/bundle-lock.txt +0 -52
- data/lib/bundler/man/bundle-package.txt +0 -74
- data/lib/bundler/man/bundle-platform.txt +0 -57
- data/lib/bundler/man/bundle-update +0 -221
- data/lib/bundler/man/bundle-update.txt +0 -227
- data/lib/bundler/man/bundle.txt +0 -104
- data/lib/bundler/man/gemfile.5.txt +0 -636
- data/lib/bundler/postit_trampoline.rb +0 -68
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -112
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
- data/lib/bundler/vendor/postit/lib/postit.rb +0 -15
- data/lib/bundler/vendor/postit/lib/postit/environment.rb +0 -44
- data/lib/bundler/vendor/postit/lib/postit/installer.rb +0 -28
- data/lib/bundler/vendor/postit/lib/postit/parser.rb +0 -21
- data/lib/bundler/vendor/postit/lib/postit/setup.rb +0 -12
- data/lib/bundler/vendor/postit/lib/postit/version.rb +0 -3
data/lib/bundler/cli/gem.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "pathname"
|
3
4
|
|
4
5
|
module Bundler
|
6
|
+
class CLI
|
7
|
+
Bundler.require_thor_actions
|
8
|
+
include Thor::Actions
|
9
|
+
end
|
10
|
+
|
5
11
|
class CLI::Gem
|
6
12
|
TEST_FRAMEWORK_VERSIONS = {
|
7
13
|
"rspec" => "3.0",
|
@@ -13,7 +19,10 @@ module Bundler
|
|
13
19
|
def initialize(options, gem_name, thor)
|
14
20
|
@options = options
|
15
21
|
@gem_name = resolve_name(gem_name)
|
22
|
+
|
16
23
|
@thor = thor
|
24
|
+
thor.behavior = :invoke
|
25
|
+
thor.destination_root = nil
|
17
26
|
|
18
27
|
@name = @gem_name
|
19
28
|
@target = SharedHelpers.pwd.join(gem_name)
|
@@ -29,8 +38,11 @@ module Bundler
|
|
29
38
|
constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
|
30
39
|
constant_array = constant_name.split("::")
|
31
40
|
|
32
|
-
|
33
|
-
|
41
|
+
git_installed = Bundler.git_present?
|
42
|
+
|
43
|
+
git_author_name = git_installed ? `git config user.name`.chomp : ""
|
44
|
+
github_username = git_installed ? `git config github.user`.chomp : ""
|
45
|
+
git_user_email = git_installed ? `git config user.email`.chomp : ""
|
34
46
|
|
35
47
|
config = {
|
36
48
|
:name => name,
|
@@ -39,18 +51,18 @@ module Bundler
|
|
39
51
|
:makefile_path => "#{underscored_name}/#{underscored_name}",
|
40
52
|
:constant_name => constant_name,
|
41
53
|
:constant_array => constant_array,
|
42
|
-
:author =>
|
54
|
+
:author => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
|
43
55
|
:email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
|
44
56
|
:test => options[:test],
|
45
57
|
:ext => options[:ext],
|
46
58
|
:exe => options[:exe],
|
47
|
-
:bundler_version => bundler_dependency_version
|
59
|
+
:bundler_version => bundler_dependency_version,
|
60
|
+
:github_username => github_username.empty? ? "[USERNAME]" : github_username
|
48
61
|
}
|
49
62
|
ensure_safe_gem_name(name, constant_array)
|
50
63
|
|
51
64
|
templates = {
|
52
65
|
"Gemfile.tt" => "Gemfile",
|
53
|
-
"gitignore.tt" => ".gitignore",
|
54
66
|
"lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
|
55
67
|
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
|
56
68
|
"newgem.gemspec.tt" => "#{name}.gemspec",
|
@@ -60,16 +72,18 @@ module Bundler
|
|
60
72
|
"bin/setup.tt" => "bin/setup"
|
61
73
|
}
|
62
74
|
|
63
|
-
executables = %w
|
75
|
+
executables = %w[
|
64
76
|
bin/console
|
65
77
|
bin/setup
|
66
|
-
|
78
|
+
]
|
79
|
+
|
80
|
+
templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present?
|
67
81
|
|
68
82
|
if test_framework = ask_and_set_test_framework
|
69
83
|
config[:test] = test_framework
|
70
84
|
config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
|
71
85
|
|
72
|
-
templates.merge!("
|
86
|
+
templates.merge!("travis.yml.tt" => ".travis.yml")
|
73
87
|
|
74
88
|
case test_framework
|
75
89
|
when "rspec"
|
@@ -91,7 +105,7 @@ module Bundler
|
|
91
105
|
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
|
92
106
|
"This means that any other developer or company will be legally allowed to use your code " \
|
93
107
|
"for free as long as they admit you created it. You can read more about the MIT license " \
|
94
|
-
"at
|
108
|
+
"at https://choosealicense.com/licenses/mit.")
|
95
109
|
config[:mit] = true
|
96
110
|
Bundler.ui.info "MIT License enabled in config"
|
97
111
|
templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
|
@@ -104,7 +118,7 @@ module Bundler
|
|
104
118
|
"of enforcing it, so be sure that you are prepared to do that. Be sure that your email " \
|
105
119
|
"address is specified as a contact in the generated code of conduct so that people know " \
|
106
120
|
"who to contact in case of a violation. For suggestions about " \
|
107
|
-
"how to enforce codes of conduct, see
|
121
|
+
"how to enforce codes of conduct, see https://bit.ly/coc-enforcement.")
|
108
122
|
config[:coc] = true
|
109
123
|
Bundler.ui.info "Code of conduct enabled in config"
|
110
124
|
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
|
@@ -121,23 +135,34 @@ module Bundler
|
|
121
135
|
end
|
122
136
|
|
123
137
|
templates.each do |src, dst|
|
124
|
-
|
138
|
+
destination = target.join(dst)
|
139
|
+
SharedHelpers.filesystem_access(destination) do
|
140
|
+
thor.template("newgem/#{src}", destination, config)
|
141
|
+
end
|
125
142
|
end
|
126
143
|
|
127
144
|
executables.each do |file|
|
128
|
-
|
129
|
-
|
130
|
-
|
145
|
+
SharedHelpers.filesystem_access(target.join(file)) do |path|
|
146
|
+
executable = (path.stat.mode | 0o111)
|
147
|
+
path.chmod(executable)
|
148
|
+
end
|
131
149
|
end
|
132
150
|
|
133
|
-
Bundler.
|
134
|
-
|
135
|
-
|
136
|
-
|
151
|
+
if Bundler.git_present?
|
152
|
+
Bundler.ui.info "Initializing git repo in #{target}"
|
153
|
+
Dir.chdir(target) do
|
154
|
+
`git init`
|
155
|
+
`git add .`
|
156
|
+
end
|
137
157
|
end
|
138
158
|
|
139
159
|
# Open gemspec in editor
|
140
160
|
open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
|
161
|
+
|
162
|
+
Bundler.ui.info "Gem '#{name}' was successfully created. " \
|
163
|
+
"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.")
|
141
166
|
end
|
142
167
|
|
143
168
|
private
|
@@ -201,10 +226,23 @@ module Bundler
|
|
201
226
|
if name =~ /^\d/
|
202
227
|
Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers."
|
203
228
|
exit 1
|
204
|
-
elsif constant_array.inject(Object) {|c, s| (c.const_defined?(s) && c.const_get(s)) || break }
|
205
|
-
Bundler.ui.error "Invalid gem name #{name} constant #{constant_array.join("::")} is already in use. Please choose another gem name."
|
206
|
-
exit 1
|
207
229
|
end
|
230
|
+
|
231
|
+
constant_name = constant_array.join("::")
|
232
|
+
|
233
|
+
existing_constant = constant_array.inject(Object) do |c, s|
|
234
|
+
defined = begin
|
235
|
+
c.const_defined?(s)
|
236
|
+
rescue NameError
|
237
|
+
Bundler.ui.error "Invalid gem name #{name} -- `#{constant_name}` is an invalid constant name"
|
238
|
+
exit 1
|
239
|
+
end
|
240
|
+
(defined && c.const_get(s)) || break
|
241
|
+
end
|
242
|
+
|
243
|
+
return unless existing_constant
|
244
|
+
Bundler.ui.error "Invalid gem name #{name} constant #{constant_name} is already in use. Please choose another gem name."
|
245
|
+
exit 1
|
208
246
|
end
|
209
247
|
|
210
248
|
def open_editor(editor, file)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bundler
|
4
|
+
class CLI::Info
|
5
|
+
attr_reader :gem_name, :options
|
6
|
+
def initialize(options, gem_name)
|
7
|
+
@options = options
|
8
|
+
@gem_name = gem_name
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
spec = spec_for_gem(gem_name)
|
13
|
+
|
14
|
+
spec_not_found(gem_name) unless spec
|
15
|
+
return print_gem_path(spec) if @options[:path]
|
16
|
+
print_gem_info(spec)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def spec_for_gem(gem_name)
|
22
|
+
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
|
23
|
+
spec || default_gem_spec(gem_name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def default_gem_spec(gem_name)
|
27
|
+
return unless Gem::Specification.respond_to?(:find_all_by_name)
|
28
|
+
gem_spec = Gem::Specification.find_all_by_name(gem_name).last
|
29
|
+
return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem?
|
30
|
+
end
|
31
|
+
|
32
|
+
def spec_not_found(gem_name)
|
33
|
+
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
|
34
|
+
end
|
35
|
+
|
36
|
+
def print_gem_path(spec)
|
37
|
+
Bundler.ui.info spec.full_gem_path
|
38
|
+
end
|
39
|
+
|
40
|
+
def print_gem_info(spec)
|
41
|
+
gem_info = String.new
|
42
|
+
gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
|
43
|
+
gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
|
44
|
+
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
|
45
|
+
gem_info << "\tPath: #{spec.full_gem_path}\n"
|
46
|
+
gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
|
47
|
+
Bundler.ui.info gem_info
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/lib/bundler/cli/init.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class CLI::Init
|
4
5
|
attr_reader :options
|
@@ -7,8 +8,13 @@ module Bundler
|
|
7
8
|
end
|
8
9
|
|
9
10
|
def run
|
10
|
-
if File.exist?(
|
11
|
-
Bundler.ui.error "
|
11
|
+
if File.exist?(gemfile)
|
12
|
+
Bundler.ui.error "#{gemfile} already exists at #{File.expand_path(gemfile)}"
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
unless File.writable?(Dir.pwd)
|
17
|
+
Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
|
12
18
|
exit 1
|
13
19
|
end
|
14
20
|
|
@@ -18,16 +24,24 @@ module Bundler
|
|
18
24
|
Bundler.ui.error "Gem specification #{gemspec} doesn't exist"
|
19
25
|
exit 1
|
20
26
|
end
|
21
|
-
|
22
|
-
|
23
|
-
|
27
|
+
|
28
|
+
spec = Bundler.load_gemspec_uncached(gemspec)
|
29
|
+
|
30
|
+
File.open(gemfile, "wb") do |file|
|
24
31
|
file << "# Generated from #{gemspec}\n"
|
25
32
|
file << spec.to_gemfile
|
26
33
|
end
|
27
34
|
else
|
28
|
-
|
29
|
-
FileUtils.cp(File.expand_path("../../templates/Gemfile", __FILE__), "Gemfile")
|
35
|
+
FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
|
30
36
|
end
|
37
|
+
|
38
|
+
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def gemfile
|
44
|
+
@gemfile ||= Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
|
31
45
|
end
|
32
46
|
end
|
33
47
|
end
|
data/lib/bundler/cli/inject.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class CLI::Inject
|
4
5
|
attr_reader :options, :name, :version, :group, :source, :gems
|
5
|
-
def initialize(options, name, version
|
6
|
+
def initialize(options, name, version)
|
6
7
|
@options = options
|
7
8
|
@name = name
|
8
9
|
@version = version || last_version_number
|
9
|
-
@group = options[:group]
|
10
|
+
@group = options[:group].split(",") unless options[:group].nil?
|
10
11
|
@source = options[:source]
|
11
|
-
@gems =
|
12
|
+
@gems = []
|
12
13
|
end
|
13
14
|
|
14
15
|
def run
|
@@ -18,6 +19,8 @@ module Bundler
|
|
18
19
|
|
19
20
|
# Build an array of Dependency objects out of the arguments
|
20
21
|
deps = []
|
22
|
+
# when `inject` support addition of more than one gem, then this loop will
|
23
|
+
# help. Currently this loop is running once.
|
21
24
|
gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
|
22
25
|
ops = Gem::Requirement::OPS.map {|key, _val| key }
|
23
26
|
has_op = ops.any? {|op| gem_version.start_with? op }
|
@@ -29,7 +32,13 @@ module Bundler
|
|
29
32
|
|
30
33
|
if added.any?
|
31
34
|
Bundler.ui.confirm "Added to Gemfile:"
|
32
|
-
Bundler.ui.confirm
|
35
|
+
Bundler.ui.confirm(added.map do |d|
|
36
|
+
name = "'#{d.name}'"
|
37
|
+
requirement = ", '#{d.requirement}'"
|
38
|
+
group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
|
39
|
+
source = ", :source => '#{d.source}'" unless d.source.nil?
|
40
|
+
%(gem #{name}#{requirement}#{group}#{source})
|
41
|
+
end.join("\n"))
|
33
42
|
else
|
34
43
|
Bundler.ui.confirm "All gems were already present in the Gemfile"
|
35
44
|
end
|
data/lib/bundler/cli/install.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class CLI::Install
|
4
5
|
attr_reader :options
|
@@ -11,19 +12,9 @@ module Bundler
|
|
11
12
|
|
12
13
|
warn_if_root
|
13
14
|
|
14
|
-
warn_if_outdated
|
15
|
-
|
16
|
-
[:with, :without].each do |option|
|
17
|
-
if options[option]
|
18
|
-
options[option] = options[option].join(":").tr(" ", ":").split(":")
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
check_for_group_conflicts
|
23
|
-
|
24
15
|
normalize_groups
|
25
16
|
|
26
|
-
|
17
|
+
Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
|
27
18
|
|
28
19
|
# Disable color in deployment mode
|
29
20
|
Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
|
@@ -32,22 +23,28 @@ module Bundler
|
|
32
23
|
|
33
24
|
check_trust_policy
|
34
25
|
|
35
|
-
if options[:deployment] || options[:frozen]
|
26
|
+
if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
|
36
27
|
unless Bundler.default_lockfile.exist?
|
37
|
-
flag
|
38
|
-
|
28
|
+
flag = "--deployment flag" if options[:deployment]
|
29
|
+
flag ||= "--frozen flag" if options[:frozen]
|
30
|
+
flag ||= "deployment setting"
|
31
|
+
raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
|
39
32
|
"sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
|
40
33
|
"before deploying."
|
41
34
|
end
|
42
35
|
|
43
36
|
options[:local] = true if Bundler.app_cache.exist?
|
44
37
|
|
45
|
-
Bundler.
|
38
|
+
if Bundler.feature_flag.deployment_means_frozen?
|
39
|
+
Bundler.settings.set_command_option :deployment, true
|
40
|
+
else
|
41
|
+
Bundler.settings.set_command_option :frozen, true
|
42
|
+
end
|
46
43
|
end
|
47
44
|
|
48
45
|
# When install is called with --no-deployment, disable deployment mode
|
49
46
|
if options[:deployment] == false
|
50
|
-
Bundler.settings.
|
47
|
+
Bundler.settings.set_command_option :frozen, nil
|
51
48
|
options[:system] = true
|
52
49
|
end
|
53
50
|
|
@@ -56,41 +53,33 @@ module Bundler
|
|
56
53
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
57
54
|
|
58
55
|
if options["binstubs"]
|
59
|
-
Bundler::SharedHelpers.major_deprecation
|
60
|
-
"
|
56
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
57
|
+
"The --binstubs option will be removed in favor of `bundle binstubs`"
|
61
58
|
end
|
62
59
|
|
63
|
-
|
64
|
-
Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
|
65
|
-
|
66
|
-
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
|
60
|
+
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
67
61
|
|
68
62
|
definition = Bundler.definition
|
69
|
-
definition.
|
63
|
+
definition.validate_runtime!
|
70
64
|
|
71
65
|
installer = Installer.install(Bundler.root, definition, options)
|
72
|
-
Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.
|
66
|
+
Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
73
67
|
|
74
68
|
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
75
|
-
|
69
|
+
Bundler::CLI::Common.output_without_groups_message
|
76
70
|
|
77
|
-
if Bundler.
|
78
|
-
|
79
|
-
relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
|
80
|
-
Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
|
71
|
+
if Bundler.use_system_gems?
|
72
|
+
Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
|
81
73
|
else
|
82
|
-
Bundler.
|
74
|
+
relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd
|
75
|
+
Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
|
83
76
|
end
|
84
77
|
|
85
|
-
|
86
|
-
installer.post_install_messages.to_a.each do |name, msg|
|
87
|
-
print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
|
88
|
-
end
|
89
|
-
end
|
78
|
+
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
|
90
79
|
|
91
80
|
warn_ambiguous_gems
|
92
81
|
|
93
|
-
if
|
82
|
+
if CLI::Common.clean_after_install?
|
94
83
|
require "bundler/cli/clean"
|
95
84
|
Bundler::CLI::Clean.new(options).run
|
96
85
|
end
|
@@ -121,26 +110,6 @@ module Bundler
|
|
121
110
|
"application for all non-root users on this machine.", :wrap => true
|
122
111
|
end
|
123
112
|
|
124
|
-
def warn_if_outdated
|
125
|
-
return if ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].nil?
|
126
|
-
installed_version = Gem::Version.new(ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].dup)
|
127
|
-
running_version = Gem::Version.new(Bundler::VERSION)
|
128
|
-
return if Gem::Requirement.new(installed_version).satisfied_by?(running_version)
|
129
|
-
if Bundler.settings[:warned_version].nil? || running_version > Gem::Version.new(Bundler.settings[:warned_version])
|
130
|
-
Bundler.settings[:warned_version] = running_version
|
131
|
-
Bundler.ui.warn "You're running Bundler #{installed_version} but this " \
|
132
|
-
"project uses #{running_version}. To update, run `bundle update " \
|
133
|
-
"--bundler`. You won't see this message again unless you upgrade " \
|
134
|
-
"to a newer version of Bundler.", :wrap => true
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
def confirm_without_groups
|
139
|
-
return unless Bundler.settings.without.any?
|
140
|
-
require "bundler/cli/common"
|
141
|
-
Bundler.ui.confirm Bundler::CLI::Common.without_groups_message
|
142
|
-
end
|
143
|
-
|
144
113
|
def dependencies_count_for(definition)
|
145
114
|
count = definition.dependencies.count
|
146
115
|
"#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
|
@@ -151,54 +120,46 @@ module Bundler
|
|
151
120
|
"#{count} #{count == 1 ? "gem" : "gems"} now installed"
|
152
121
|
end
|
153
122
|
|
154
|
-
def
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
def check_for_group_conflicts
|
160
|
-
if options[:without] && options[:with]
|
161
|
-
conflicting_groups = options[:without] & options[:with]
|
162
|
-
unless conflicting_groups.empty?
|
163
|
-
Bundler.ui.error "You can't list a group in both, --with and --without." \
|
164
|
-
"The offending groups are: #{conflicting_groups.join(", ")}."
|
165
|
-
exit 1
|
166
|
-
end
|
167
|
-
end
|
123
|
+
def check_for_group_conflicts_in_cli_options
|
124
|
+
conflicting_groups = Array(options[:without]) & Array(options[:with])
|
125
|
+
return if conflicting_groups.empty?
|
126
|
+
raise InvalidOption, "You can't list a group in both with and without." \
|
127
|
+
" The offending groups are: #{conflicting_groups.join(", ")}."
|
168
128
|
end
|
169
129
|
|
170
130
|
def check_for_options_conflicts
|
171
131
|
if (options[:path] || options[:deployment]) && options[:system]
|
172
132
|
error_message = String.new
|
173
|
-
error_message << "You have specified both
|
174
|
-
error_message << "You have specified both --deployment as well as --system. Please choose.\n" if options[:deployment]
|
133
|
+
error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
|
134
|
+
error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
|
175
135
|
raise InvalidOption.new(error_message)
|
176
136
|
end
|
177
137
|
end
|
178
138
|
|
179
139
|
def check_trust_policy
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
exit 1
|
185
|
-
end
|
186
|
-
Bundler.settings["trust-policy"] = options["trust-policy"]
|
187
|
-
else
|
188
|
-
Bundler.settings["trust-policy"] = nil if Bundler.settings["trust-policy"]
|
140
|
+
trust_policy = options["trust-policy"]
|
141
|
+
unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
|
142
|
+
raise InvalidOption, "RubyGems doesn't know about trust policy '#{trust_policy}'. " \
|
143
|
+
"The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
|
189
144
|
end
|
145
|
+
Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
|
190
146
|
end
|
191
147
|
|
192
148
|
def normalize_groups
|
193
|
-
|
194
|
-
|
149
|
+
options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
|
150
|
+
options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
|
151
|
+
|
152
|
+
check_for_group_conflicts_in_cli_options
|
153
|
+
|
154
|
+
Bundler.settings.set_command_option :with, nil if options[:with] == []
|
155
|
+
Bundler.settings.set_command_option :without, nil if options[:without] == []
|
195
156
|
|
196
|
-
with = options.fetch(
|
197
|
-
with |= Bundler.settings
|
157
|
+
with = options.fetch(:with, [])
|
158
|
+
with |= Bundler.settings[:with].map(&:to_s)
|
198
159
|
with -= options[:without] if options[:without]
|
199
160
|
|
200
|
-
without = options.fetch(
|
201
|
-
without |= Bundler.settings
|
161
|
+
without = options.fetch(:without, [])
|
162
|
+
without |= Bundler.settings[:without].map(&:to_s)
|
202
163
|
without -= options[:with] if options[:with]
|
203
164
|
|
204
165
|
options[:with] = with
|
@@ -206,28 +167,38 @@ module Bundler
|
|
206
167
|
end
|
207
168
|
|
208
169
|
def normalize_settings
|
209
|
-
Bundler.settings
|
210
|
-
Bundler.settings
|
211
|
-
|
212
|
-
|
170
|
+
Bundler.settings.set_command_option :path, nil if options[:system]
|
171
|
+
Bundler.settings.temporary(:path_relative_to_cwd => false) do
|
172
|
+
Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
|
173
|
+
end
|
174
|
+
Bundler.settings.set_command_option_if_given :path, options[:path]
|
175
|
+
Bundler.settings.temporary(:path_relative_to_cwd => false) do
|
176
|
+
Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
|
177
|
+
end
|
213
178
|
|
214
|
-
|
215
|
-
|
179
|
+
bin_option = options["binstubs"]
|
180
|
+
bin_option = nil if bin_option && bin_option.empty?
|
181
|
+
Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
|
216
182
|
|
217
|
-
Bundler.settings
|
183
|
+
Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
|
218
184
|
|
219
|
-
Bundler.settings
|
185
|
+
Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
|
220
186
|
|
221
|
-
Bundler.settings
|
187
|
+
Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
|
222
188
|
|
223
|
-
Bundler.settings
|
189
|
+
Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
|
224
190
|
|
225
|
-
Bundler.settings
|
191
|
+
Bundler.settings.set_command_option_if_given :clean, options["clean"]
|
226
192
|
|
227
|
-
Bundler.settings
|
228
|
-
|
193
|
+
unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
|
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
|
229
200
|
|
230
|
-
|
201
|
+
options[:force] = options[:redownload]
|
231
202
|
end
|
232
203
|
|
233
204
|
def warn_ambiguous_gems
|