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