bundler 1.10.6 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +105 -0
- data/.rubocop_todo.yml +120 -0
- data/.travis.yml +8 -23
- data/CHANGELOG.md +95 -0
- data/CODE_OF_CONDUCT.md +6 -4
- data/DEVELOPMENT.md +4 -5
- data/README.md +2 -2
- data/Rakefile +71 -88
- data/bin/rake +14 -0
- data/bin/rspec +10 -0
- data/bin/rubocop +11 -0
- data/bundler.gemspec +17 -15
- data/exe/bundle +20 -0
- data/{bin → exe}/bundle_ruby +6 -4
- data/exe/bundler +20 -0
- data/lib/bundler/capistrano.rb +2 -2
- data/lib/bundler/cli/binstubs.rb +1 -2
- data/lib/bundler/cli/cache.rb +0 -1
- data/lib/bundler/cli/check.rb +7 -5
- data/lib/bundler/cli/clean.rb +0 -1
- data/lib/bundler/cli/common.rb +6 -7
- data/lib/bundler/cli/config.rb +69 -56
- data/lib/bundler/cli/console.rb +8 -8
- data/lib/bundler/cli/exec.rb +5 -4
- data/lib/bundler/cli/gem.rb +52 -40
- data/lib/bundler/cli/init.rb +5 -6
- data/lib/bundler/cli/inject.rb +1 -2
- data/lib/bundler/cli/install.rb +18 -21
- data/lib/bundler/cli/lock.rb +8 -3
- data/lib/bundler/cli/open.rb +4 -5
- data/lib/bundler/cli/outdated.rb +7 -8
- data/lib/bundler/cli/package.rb +1 -1
- data/lib/bundler/cli/platform.rb +2 -3
- data/lib/bundler/cli/show.rb +9 -9
- data/lib/bundler/cli/update.rb +2 -3
- data/lib/bundler/cli/viz.rb +1 -2
- data/lib/bundler/cli.rb +85 -74
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +38 -3
- data/lib/bundler/definition.rb +83 -88
- data/lib/bundler/dep_proxy.rb +11 -9
- data/lib/bundler/dependency.rb +17 -11
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/deprecate.rb +3 -3
- data/lib/bundler/dsl.rb +62 -43
- data/lib/bundler/env.rb +19 -12
- data/lib/bundler/environment.rb +1 -2
- data/lib/bundler/errors.rb +82 -0
- data/lib/bundler/fetcher/base.rb +20 -7
- data/lib/bundler/fetcher/dependency.rb +5 -5
- data/lib/bundler/fetcher/downloader.rb +1 -2
- data/lib/bundler/fetcher/index.rb +4 -7
- data/lib/bundler/fetcher.rb +49 -40
- data/lib/bundler/friendly_errors.rb +15 -8
- data/lib/bundler/gem_helper.rb +44 -35
- data/lib/bundler/gem_helpers.rb +7 -8
- data/lib/bundler/gem_remote_fetcher.rb +41 -0
- data/lib/bundler/gem_tasks.rb +4 -1
- data/lib/bundler/graph.rb +25 -24
- data/lib/bundler/index.rb +21 -18
- data/lib/bundler/injector.rb +2 -4
- data/lib/bundler/inline.rb +3 -3
- data/lib/bundler/installer/gem_installer.rb +76 -0
- data/lib/bundler/installer/parallel_installer.rb +22 -13
- data/lib/bundler/installer/standalone.rb +48 -0
- data/lib/bundler/installer.rb +57 -144
- data/lib/bundler/lazy_specification.rb +4 -5
- data/lib/bundler/lockfile_parser.rb +21 -19
- data/lib/bundler/man/bundle +2 -2
- data/lib/bundler/man/bundle-config +2 -2
- data/lib/bundler/man/bundle-config.txt +6 -4
- data/lib/bundler/man/bundle-exec +1 -1
- data/lib/bundler/man/bundle-exec.txt +1 -1
- data/lib/bundler/man/bundle-gem +80 -0
- data/lib/bundler/man/bundle-gem.txt +90 -0
- data/lib/bundler/man/bundle-install +37 -6
- data/lib/bundler/man/bundle-install.txt +68 -44
- data/lib/bundler/man/bundle-lock +55 -0
- data/lib/bundler/man/bundle-lock.txt +60 -0
- data/lib/bundler/man/bundle-package +1 -1
- data/lib/bundler/man/bundle-package.txt +1 -1
- data/lib/bundler/man/bundle-platform +1 -1
- data/lib/bundler/man/bundle-platform.txt +1 -1
- data/lib/bundler/man/bundle-update +1 -1
- data/lib/bundler/man/bundle-update.txt +1 -1
- data/lib/bundler/man/bundle.txt +2 -2
- data/lib/bundler/man/gemfile.5 +17 -1
- data/lib/bundler/man/gemfile.5.txt +12 -1
- data/lib/bundler/match_platform.rb +4 -4
- data/lib/bundler/psyched_yaml.rb +5 -5
- data/lib/bundler/remote_specification.rb +1 -1
- data/lib/bundler/resolver.rb +93 -88
- data/lib/bundler/retry.rb +9 -10
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +7 -10
- data/lib/bundler/rubygems_ext.rb +32 -27
- data/lib/bundler/{gem_installer.rb → rubygems_gem_installer.rb} +2 -2
- data/lib/bundler/rubygems_integration.rb +85 -70
- data/lib/bundler/runtime.rb +65 -61
- data/lib/bundler/settings.rb +27 -26
- data/lib/bundler/setup.rb +3 -3
- data/lib/bundler/shared_helpers.rb +45 -20
- data/lib/bundler/similarity_detector.rb +19 -21
- data/lib/bundler/source/git/git_proxy.rb +52 -26
- data/lib/bundler/source/git.rb +29 -31
- data/lib/bundler/source/path/installer.rb +4 -4
- data/lib/bundler/source/path.rb +25 -28
- data/lib/bundler/source/rubygems/remote.rb +3 -3
- data/lib/bundler/source/rubygems.rb +62 -48
- data/lib/bundler/source.rb +4 -5
- data/lib/bundler/source_list.rb +4 -4
- data/lib/bundler/spec_set.rb +17 -15
- data/lib/bundler/ssl_certs/certificate_manager.rb +5 -6
- data/lib/bundler/stub_specification.rb +2 -2
- data/lib/bundler/templates/Executable +5 -5
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +42 -6
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +4 -2
- data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
- data/lib/bundler/ui/rg_proxy.rb +2 -2
- data/lib/bundler/ui/shell.rb +10 -6
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +82 -71
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +40 -21
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -0
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +3 -3
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/worker.rb +4 -5
- data/lib/bundler.rb +99 -120
- data/man/bundle-config.ronn +4 -2
- data/man/bundle-gem.ronn +77 -0
- data/man/bundle-install.ronn +13 -6
- data/man/bundle-lock.ronn +47 -0
- data/man/bundle.ronn +1 -1
- data/man/gemfile.5.ronn +8 -0
- data/man/index.txt +1 -0
- metadata +36 -8
- data/bin/bundle +0 -21
- data/bin/bundler +0 -21
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module Bundler; end
|
|
2
|
-
require
|
|
3
|
-
require
|
|
2
|
+
require "bundler/vendor/thor/lib/thor"
|
|
3
|
+
require "bundler/vendor/thor/lib/thor/actions"
|
data/lib/bundler/version.rb
CHANGED
|
@@ -2,5 +2,5 @@ module Bundler
|
|
|
2
2
|
# We're doing this because we might write tests that deal
|
|
3
3
|
# with other versions of bundler and we are unsure how to
|
|
4
4
|
# handle this better.
|
|
5
|
-
VERSION = "1.
|
|
5
|
+
VERSION = "1.11.2" unless defined?(::Bundler::VERSION)
|
|
6
6
|
end
|
data/lib/bundler/vlad.rb
CHANGED
data/lib/bundler/worker.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "thread"
|
|
2
2
|
|
|
3
3
|
module Bundler
|
|
4
4
|
class Worker
|
|
@@ -19,7 +19,7 @@ module Bundler
|
|
|
19
19
|
@request_queue = Queue.new
|
|
20
20
|
@response_queue = Queue.new
|
|
21
21
|
@func = func
|
|
22
|
-
@threads = size.times.map {
|
|
22
|
+
@threads = size.times.map {|i| Thread.start { process_queue(i) } }
|
|
23
23
|
trap("INT") { abort_threads }
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -61,13 +61,12 @@ module Bundler
|
|
|
61
61
|
# so as worker threads after retrieving it, shut themselves down
|
|
62
62
|
def stop_threads
|
|
63
63
|
@threads.each { @request_queue.enq POISON }
|
|
64
|
-
@threads.each
|
|
64
|
+
@threads.each(&:join)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def abort_threads
|
|
68
|
-
@threads.each
|
|
68
|
+
@threads.each(&:exit)
|
|
69
69
|
exit 1
|
|
70
70
|
end
|
|
71
|
-
|
|
72
71
|
end
|
|
73
72
|
end
|
data/lib/bundler.rb
CHANGED
|
@@ -1,89 +1,54 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
6
|
-
require
|
|
7
|
-
require
|
|
8
|
-
require
|
|
9
|
-
require
|
|
1
|
+
require "fileutils"
|
|
2
|
+
require "pathname"
|
|
3
|
+
require "rbconfig"
|
|
4
|
+
require "thread"
|
|
5
|
+
require "bundler/gem_path_manipulation"
|
|
6
|
+
require "bundler/gem_remote_fetcher"
|
|
7
|
+
require "bundler/rubygems_ext"
|
|
8
|
+
require "bundler/rubygems_integration"
|
|
9
|
+
require "bundler/version"
|
|
10
|
+
require "bundler/constants"
|
|
11
|
+
require "bundler/current_ruby"
|
|
12
|
+
require "bundler/errors"
|
|
10
13
|
|
|
11
14
|
module Bundler
|
|
12
15
|
preserve_gem_path
|
|
13
16
|
ORIGINAL_ENV = ENV.to_hash
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
autoload :
|
|
17
|
-
autoload :
|
|
18
|
-
autoload :
|
|
19
|
-
autoload :
|
|
20
|
-
autoload :
|
|
21
|
-
autoload :
|
|
22
|
-
autoload :
|
|
23
|
-
autoload :
|
|
24
|
-
autoload :
|
|
25
|
-
autoload :
|
|
26
|
-
autoload :
|
|
27
|
-
autoload :
|
|
28
|
-
autoload :
|
|
29
|
-
autoload :
|
|
30
|
-
autoload :
|
|
31
|
-
autoload :
|
|
32
|
-
autoload :
|
|
33
|
-
autoload :
|
|
34
|
-
autoload :
|
|
35
|
-
autoload :
|
|
36
|
-
autoload :
|
|
37
|
-
autoload :
|
|
38
|
-
autoload :
|
|
39
|
-
autoload :
|
|
40
|
-
autoload :
|
|
41
|
-
autoload :
|
|
42
|
-
autoload :
|
|
43
|
-
autoload :
|
|
44
|
-
autoload :
|
|
45
|
-
autoload :
|
|
46
|
-
autoload :
|
|
47
|
-
autoload :SystemRubyVersion,
|
|
48
|
-
autoload :UI,
|
|
49
|
-
|
|
50
|
-
class BundlerError < StandardError
|
|
51
|
-
def self.status_code(code)
|
|
52
|
-
define_method(:status_code) { code }
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
class GemfileNotFound < BundlerError; status_code(10) ; end
|
|
57
|
-
class GemNotFound < BundlerError; status_code(7) ; end
|
|
58
|
-
class GemfileError < BundlerError; status_code(4) ; end
|
|
59
|
-
class InstallError < BundlerError; status_code(5) ; end
|
|
60
|
-
class InstallHookError < BundlerError; status_code(8) ; end
|
|
61
|
-
class PathError < BundlerError; status_code(13) ; end
|
|
62
|
-
class GitError < BundlerError; status_code(11) ; end
|
|
63
|
-
class DeprecatedError < BundlerError; status_code(12) ; end
|
|
64
|
-
class GemspecError < BundlerError; status_code(14) ; end
|
|
65
|
-
class InvalidOption < BundlerError; status_code(15) ; end
|
|
66
|
-
class ProductionError < BundlerError; status_code(16) ; end
|
|
67
|
-
class HTTPError < BundlerError; status_code(17) ; end
|
|
68
|
-
class RubyVersionMismatch < BundlerError; status_code(18) ; end
|
|
69
|
-
class SecurityError < BundlerError; status_code(19) ; end
|
|
70
|
-
class LockfileError < BundlerError; status_code(20) ; end
|
|
71
|
-
class CyclicDependencyError < BundlerError; status_code(21) ; end
|
|
72
|
-
class GemfileLockNotFound < BundlerError; status_code(22) ; end
|
|
73
|
-
|
|
74
|
-
# Internal errors, should be rescued
|
|
75
|
-
class VersionConflict < BundlerError
|
|
76
|
-
attr_reader :conflicts
|
|
77
|
-
|
|
78
|
-
def initialize(conflicts, msg = nil)
|
|
79
|
-
super(msg)
|
|
80
|
-
@conflicts = conflicts
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
status_code(6)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
class MarshalError < StandardError; end
|
|
17
|
+
SUDO_MUTEX = Mutex.new
|
|
18
|
+
|
|
19
|
+
autoload :Definition, "bundler/definition"
|
|
20
|
+
autoload :Dependency, "bundler/dependency"
|
|
21
|
+
autoload :DepProxy, "bundler/dep_proxy"
|
|
22
|
+
autoload :Deprecate, "bundler/deprecate"
|
|
23
|
+
autoload :Dsl, "bundler/dsl"
|
|
24
|
+
autoload :EndpointSpecification, "bundler/endpoint_specification"
|
|
25
|
+
autoload :Environment, "bundler/environment"
|
|
26
|
+
autoload :Env, "bundler/env"
|
|
27
|
+
autoload :Fetcher, "bundler/fetcher"
|
|
28
|
+
autoload :GemHelper, "bundler/gem_helper"
|
|
29
|
+
autoload :GemHelpers, "bundler/gem_helpers"
|
|
30
|
+
autoload :RubyGemsGemInstaller, "bundler/rubygems_gem_installer"
|
|
31
|
+
autoload :Graph, "bundler/graph"
|
|
32
|
+
autoload :Index, "bundler/index"
|
|
33
|
+
autoload :Installer, "bundler/installer"
|
|
34
|
+
autoload :Injector, "bundler/injector"
|
|
35
|
+
autoload :LazySpecification, "bundler/lazy_specification"
|
|
36
|
+
autoload :LockfileParser, "bundler/lockfile_parser"
|
|
37
|
+
autoload :MatchPlatform, "bundler/match_platform"
|
|
38
|
+
autoload :RemoteSpecification, "bundler/remote_specification"
|
|
39
|
+
autoload :Resolver, "bundler/resolver"
|
|
40
|
+
autoload :Retry, "bundler/retry"
|
|
41
|
+
autoload :RubyVersion, "bundler/ruby_version"
|
|
42
|
+
autoload :RubyDsl, "bundler/ruby_dsl"
|
|
43
|
+
autoload :Runtime, "bundler/runtime"
|
|
44
|
+
autoload :Settings, "bundler/settings"
|
|
45
|
+
autoload :SharedHelpers, "bundler/shared_helpers"
|
|
46
|
+
autoload :SpecSet, "bundler/spec_set"
|
|
47
|
+
autoload :StubSpecification, "bundler/stub_specification"
|
|
48
|
+
autoload :Source, "bundler/source"
|
|
49
|
+
autoload :SourceList, "bundler/source_list"
|
|
50
|
+
autoload :SystemRubyVersion, "bundler/ruby_version"
|
|
51
|
+
autoload :UI, "bundler/ui"
|
|
87
52
|
|
|
88
53
|
class << self
|
|
89
54
|
attr_writer :bundle_path
|
|
@@ -111,7 +76,7 @@ module Bundler
|
|
|
111
76
|
@bin_path ||= begin
|
|
112
77
|
path = settings[:bin] || "bin"
|
|
113
78
|
path = Pathname.new(path).expand_path(root).expand_path
|
|
114
|
-
FileUtils.mkdir_p(
|
|
79
|
+
SharedHelpers.filesystem_access(path) {|p| FileUtils.mkdir_p(p) }
|
|
115
80
|
path
|
|
116
81
|
end
|
|
117
82
|
end
|
|
@@ -201,14 +166,16 @@ module Bundler
|
|
|
201
166
|
end
|
|
202
167
|
|
|
203
168
|
def app_config_path
|
|
204
|
-
ENV[
|
|
205
|
-
Pathname.new(ENV[
|
|
206
|
-
|
|
169
|
+
if ENV["BUNDLE_APP_CONFIG"]
|
|
170
|
+
Pathname.new(ENV["BUNDLE_APP_CONFIG"]).expand_path(root)
|
|
171
|
+
else
|
|
172
|
+
root.join(".bundle")
|
|
173
|
+
end
|
|
207
174
|
end
|
|
208
175
|
|
|
209
176
|
def app_cache(custom_path = nil)
|
|
210
177
|
path = custom_path || root
|
|
211
|
-
path.join(
|
|
178
|
+
path.join(settings.app_cache_path)
|
|
212
179
|
end
|
|
213
180
|
|
|
214
181
|
def tmp(name = Process.pid.to_s)
|
|
@@ -236,12 +203,19 @@ module Bundler
|
|
|
236
203
|
|
|
237
204
|
def with_clean_env
|
|
238
205
|
with_original_env do
|
|
239
|
-
ENV[
|
|
240
|
-
ENV.delete_if {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
ENV[
|
|
206
|
+
ENV["MANPATH"] = ENV["BUNDLE_ORIG_MANPATH"]
|
|
207
|
+
ENV.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
|
|
208
|
+
|
|
209
|
+
if ENV.key?("RUBYOPT")
|
|
210
|
+
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub "-rbundler/setup", ""
|
|
244
211
|
end
|
|
212
|
+
|
|
213
|
+
if ENV.key?("RUBYLIB")
|
|
214
|
+
rubylib = ENV["RUBYLIB"].split(File::PATH_SEPARATOR)
|
|
215
|
+
rubylib.delete(File.expand_path("..", __FILE__))
|
|
216
|
+
ENV["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
|
|
217
|
+
end
|
|
218
|
+
|
|
245
219
|
yield
|
|
246
220
|
end
|
|
247
221
|
end
|
|
@@ -278,9 +252,7 @@ module Bundler
|
|
|
278
252
|
def requires_sudo?
|
|
279
253
|
return @requires_sudo if defined?(@requires_sudo_ran)
|
|
280
254
|
|
|
281
|
-
if settings.allow_sudo?
|
|
282
|
-
sudo_present = which "sudo"
|
|
283
|
-
end
|
|
255
|
+
sudo_present = which "sudo" if settings.allow_sudo?
|
|
284
256
|
|
|
285
257
|
if sudo_present
|
|
286
258
|
# the bundle path and subdirectories need to be writable for Rubygems
|
|
@@ -293,8 +265,8 @@ module Bundler
|
|
|
293
265
|
bin_dir = bin_dir.parent until bin_dir.exist?
|
|
294
266
|
|
|
295
267
|
# if any directory is not writable, we need sudo
|
|
296
|
-
files = [path, bin_dir] | Dir[path.join(
|
|
297
|
-
sudo_needed = files.any?{|f| !File.writable?(f) }
|
|
268
|
+
files = [path, bin_dir] | Dir[path.join("build_info/*").to_s] | Dir[path.join("*").to_s]
|
|
269
|
+
sudo_needed = files.any? {|f| !File.writable?(f) }
|
|
298
270
|
end
|
|
299
271
|
|
|
300
272
|
@requires_sudo_ran = true
|
|
@@ -305,15 +277,17 @@ module Bundler
|
|
|
305
277
|
if requires_sudo?
|
|
306
278
|
sudo "mkdir -p '#{path}'" unless File.exist?(path)
|
|
307
279
|
else
|
|
308
|
-
|
|
280
|
+
SharedHelpers.filesystem_access(path, :write) do |p|
|
|
281
|
+
FileUtils.mkdir_p(p)
|
|
282
|
+
end
|
|
309
283
|
end
|
|
310
284
|
end
|
|
311
285
|
|
|
312
286
|
def which(executable)
|
|
313
287
|
if File.file?(executable) && File.executable?(executable)
|
|
314
288
|
executable
|
|
315
|
-
elsif ENV[
|
|
316
|
-
path = ENV[
|
|
289
|
+
elsif ENV["PATH"]
|
|
290
|
+
path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |p|
|
|
317
291
|
abs_path = File.join(p, executable)
|
|
318
292
|
File.file?(abs_path) && File.executable?(abs_path)
|
|
319
293
|
end
|
|
@@ -322,23 +296,25 @@ module Bundler
|
|
|
322
296
|
end
|
|
323
297
|
|
|
324
298
|
def sudo(str)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
299
|
+
SUDO_MUTEX.synchronize do
|
|
300
|
+
prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
|
|
301
|
+
Your user account isn't allowed to install to the system Rubygems.
|
|
302
|
+
You can cancel this installation and run:
|
|
328
303
|
|
|
329
|
-
|
|
304
|
+
bundle install --path vendor/bundle
|
|
330
305
|
|
|
331
|
-
|
|
332
|
-
|
|
306
|
+
to install the gems into ./vendor/bundle/, or you can enter your password
|
|
307
|
+
and install the bundled gems to Rubygems using sudo.
|
|
333
308
|
|
|
334
|
-
|
|
335
|
-
|
|
309
|
+
Password:
|
|
310
|
+
PROMPT
|
|
336
311
|
|
|
337
|
-
|
|
312
|
+
`sudo -p "#{prompt}" #{str}`
|
|
313
|
+
end
|
|
338
314
|
end
|
|
339
315
|
|
|
340
316
|
def read_file(file)
|
|
341
|
-
File.open(file, "rb"
|
|
317
|
+
File.open(file, "rb", &:read)
|
|
342
318
|
end
|
|
343
319
|
|
|
344
320
|
def load_marshal(data)
|
|
@@ -371,7 +347,7 @@ module Bundler
|
|
|
371
347
|
spec
|
|
372
348
|
end
|
|
373
349
|
rescue Gem::InvalidSpecificationException => e
|
|
374
|
-
|
|
350
|
+
UI::Shell.new.warn "The gemspec at #{file} is not valid. " \
|
|
375
351
|
"The validation error was '#{e.message}'"
|
|
376
352
|
nil
|
|
377
353
|
end
|
|
@@ -399,15 +375,15 @@ module Bundler
|
|
|
399
375
|
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
|
|
400
376
|
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
|
|
401
377
|
Gem::Specification.from_yaml(contents)
|
|
402
|
-
rescue
|
|
378
|
+
rescue YamlLibrarySyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
|
|
403
379
|
eval_gemspec(path, contents)
|
|
404
380
|
end
|
|
405
381
|
|
|
406
382
|
def eval_gemspec(path, contents)
|
|
407
383
|
eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s)
|
|
408
384
|
rescue ScriptError, StandardError => e
|
|
409
|
-
original_line = e.backtrace.find {
|
|
410
|
-
msg
|
|
385
|
+
original_line = e.backtrace.find {|line| line.include?(path.to_s) }
|
|
386
|
+
msg = "There was a #{e.class} while loading #{path.basename}: \n#{e.message}"
|
|
411
387
|
msg << " from\n #{original_line}" if original_line
|
|
412
388
|
msg << "\n"
|
|
413
389
|
|
|
@@ -419,12 +395,12 @@ module Bundler
|
|
|
419
395
|
end
|
|
420
396
|
|
|
421
397
|
def configure_gem_home_and_path
|
|
422
|
-
blank_home = ENV[
|
|
398
|
+
blank_home = ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
|
|
423
399
|
if settings[:disable_shared_gems]
|
|
424
|
-
ENV[
|
|
400
|
+
ENV["GEM_PATH"] = ""
|
|
425
401
|
elsif blank_home || Bundler.rubygems.gem_dir != bundle_path.to_s
|
|
426
402
|
possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
|
|
427
|
-
paths = possibles.flatten.compact.uniq.reject
|
|
403
|
+
paths = possibles.flatten.compact.uniq.reject(&:empty?)
|
|
428
404
|
ENV["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
|
|
429
405
|
end
|
|
430
406
|
|
|
@@ -434,9 +410,13 @@ module Bundler
|
|
|
434
410
|
|
|
435
411
|
def configure_gem_home
|
|
436
412
|
# TODO: This mkdir_p is only needed for JRuby <= 1.5 and should go away (GH #602)
|
|
437
|
-
|
|
413
|
+
begin
|
|
414
|
+
FileUtils.mkdir_p bundle_path.to_s
|
|
415
|
+
rescue
|
|
416
|
+
nil
|
|
417
|
+
end
|
|
438
418
|
|
|
439
|
-
ENV[
|
|
419
|
+
ENV["GEM_HOME"] = File.expand_path(bundle_path, root)
|
|
440
420
|
Bundler.rubygems.clear_paths
|
|
441
421
|
end
|
|
442
422
|
|
|
@@ -447,6 +427,5 @@ module Bundler
|
|
|
447
427
|
lockfile.rmtree
|
|
448
428
|
end
|
|
449
429
|
end
|
|
450
|
-
|
|
451
430
|
end
|
|
452
431
|
end
|
data/man/bundle-config.ronn
CHANGED
|
@@ -84,8 +84,10 @@ The following is a list of all configuration keys and their purpose. You can
|
|
|
84
84
|
learn more about their operation in [bundle install(1)][bundle-install].
|
|
85
85
|
|
|
86
86
|
* `path` (`BUNDLE_PATH`):
|
|
87
|
-
The location on disk
|
|
88
|
-
|
|
87
|
+
The location on disk where all gems in your bundle will be located regardless
|
|
88
|
+
of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
|
|
89
|
+
will be installed by `bundle install`. Defaults to `Gem.dir`. When --deployment is
|
|
90
|
+
used, defaults to vendor/bundle.
|
|
89
91
|
* `frozen` (`BUNDLE_FROZEN`):
|
|
90
92
|
Disallow changes to the `Gemfile`. Defaults to `true` when `--deployment`
|
|
91
93
|
is used.
|
data/man/bundle-gem.ronn
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
bundle-gem(1) -- Generate a project skeleton for creating a rubygem
|
|
2
|
+
====================================================================
|
|
3
|
+
|
|
4
|
+
## SYNOPSIS
|
|
5
|
+
|
|
6
|
+
`bundle gem` <GEM_NAME> [OPTIONS]
|
|
7
|
+
|
|
8
|
+
## DESCRIPTION
|
|
9
|
+
|
|
10
|
+
Generates a directory named `GEM_NAME` with a `Rakefile`, `GEM_NAME.gemspec`,
|
|
11
|
+
and other supporting files and directories that can be used to develop a
|
|
12
|
+
rubygem with that name.
|
|
13
|
+
|
|
14
|
+
Run `rake -T` in the resulting project for a list of Rake tasks that can used
|
|
15
|
+
to test and publish the gem to rubygems.org.
|
|
16
|
+
|
|
17
|
+
The generated project skeleton can be customized with OPTIONS, as explained
|
|
18
|
+
below. Note that these options can also be specified via Bundler's global
|
|
19
|
+
configuration file using the following names:
|
|
20
|
+
|
|
21
|
+
* `gem.coc`
|
|
22
|
+
* `gem.mit`
|
|
23
|
+
* `gem.test`
|
|
24
|
+
|
|
25
|
+
## OPTIONS
|
|
26
|
+
|
|
27
|
+
* `-b` or `--bin`:
|
|
28
|
+
Specify that Bundler should create a binary (as `exe/GEM_NAME`) in the
|
|
29
|
+
generated rubygem project. This binary will also be added to the
|
|
30
|
+
`GEM_NAME.gemspec` manifest. This behavior is disabled by default.
|
|
31
|
+
|
|
32
|
+
* `--no-bin`:
|
|
33
|
+
Do not create a binary (overrides `--bin` specified in the global config).
|
|
34
|
+
|
|
35
|
+
* `--coc`:
|
|
36
|
+
Add a `CODE_OF_CONDUCT.md` file to the root of the generated project. If
|
|
37
|
+
this option is unspecified, an interactive prompt will be displayed and the
|
|
38
|
+
answer will be saved in Bundler's global config for future `bundle gem` use.
|
|
39
|
+
|
|
40
|
+
* `--no-coc`:
|
|
41
|
+
Do not create a `CODE_OF_CONDUCT.md` (overrides `--coc` specified in the
|
|
42
|
+
global config).
|
|
43
|
+
|
|
44
|
+
* `--ext`:
|
|
45
|
+
Add boilerplate for C extension code to the generated project. This behavior
|
|
46
|
+
is disabled by default.
|
|
47
|
+
|
|
48
|
+
* `--no-ext`:
|
|
49
|
+
Do not add C extension code (overrides `--ext` specified in the global
|
|
50
|
+
config).
|
|
51
|
+
|
|
52
|
+
* `--mit`:
|
|
53
|
+
Add an MIT license to a `LICENSE.txt` file in the root of the generated
|
|
54
|
+
project. Your name from the global git config is used for the copyright
|
|
55
|
+
statement. If this option is unspecified, an interactive prompt will be
|
|
56
|
+
displayed and the answer will be saved in Bundler's global config for future
|
|
57
|
+
`bundle gem` use.
|
|
58
|
+
|
|
59
|
+
* `--no-mit`:
|
|
60
|
+
Do not create a `LICENSE.txt` (overrides `--mit` specified in the global
|
|
61
|
+
config).
|
|
62
|
+
|
|
63
|
+
* `-t`, `--test=minitest`, `--test=rspec`:
|
|
64
|
+
Specify the test framework that Bundler should use when generating the
|
|
65
|
+
project. Acceptable values are `minitest` and `rspec`. The `GEM_NAME.gemspec`
|
|
66
|
+
will be configured and a skeleton test/spec directory will be created based
|
|
67
|
+
on this option. If this option is unspecified, an interactive prompt will be
|
|
68
|
+
displayed and the answer will be saved in Bundler's global config for future
|
|
69
|
+
`bundle gem` use.
|
|
70
|
+
|
|
71
|
+
* `-e`, `--edit[=EDITOR]`:
|
|
72
|
+
Open the resulting GEM_NAME.gemspec in EDITOR, or the default editor if not
|
|
73
|
+
specified. The default is `$BUNDLER_EDITOR`, `$VISUAL`, or `$EDITOR`.
|
|
74
|
+
|
|
75
|
+
## SEE ALSO
|
|
76
|
+
|
|
77
|
+
* bundle-config(1)
|
data/man/bundle-install.ronn
CHANGED
|
@@ -10,6 +10,7 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
|
|
|
10
10
|
[--jobs=NUMBER]
|
|
11
11
|
[--local]
|
|
12
12
|
[--deployment]
|
|
13
|
+
[--force]
|
|
13
14
|
[--no-cache]
|
|
14
15
|
[--no-prune]
|
|
15
16
|
[--path PATH]
|
|
@@ -67,7 +68,8 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
|
67
68
|
to this location.
|
|
68
69
|
|
|
69
70
|
* `--jobs=[<number>]`:
|
|
70
|
-
|
|
71
|
+
The maximum number of parallel download and install jobs. The default
|
|
72
|
+
is `1`.
|
|
71
73
|
|
|
72
74
|
* `--local`:
|
|
73
75
|
Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
|
|
@@ -77,8 +79,12 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
|
77
79
|
|
|
78
80
|
* `--deployment`:
|
|
79
81
|
In [deployment mode][DEPLOYMENT MODE], Bundler will 'roll-out' the bundle for
|
|
80
|
-
|
|
81
|
-
enabled in
|
|
82
|
+
production or CI use. Please check carefully if you want to have this option
|
|
83
|
+
enabled in your development environment.
|
|
84
|
+
|
|
85
|
+
* `--force`:
|
|
86
|
+
Force download every gem, even if the required versions are already available
|
|
87
|
+
locally.
|
|
82
88
|
|
|
83
89
|
* `--system`:
|
|
84
90
|
Installs the gems specified in the bundle to the system's Rubygems location.
|
|
@@ -118,7 +124,8 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
|
118
124
|
runtime. A space separated list of groups to install has to be specified.
|
|
119
125
|
Bundler creates a directory named `bundle` and installs the bundle there. It
|
|
120
126
|
also generates a `bundle/bundler/setup.rb` file to replace Bundler's own setup
|
|
121
|
-
in the manner required.
|
|
127
|
+
in the manner required. Using this option implicitly sets `path`, which is a
|
|
128
|
+
[remembered option][REMEMBERED OPTIONS].
|
|
122
129
|
|
|
123
130
|
* `--trust-policy=[<policy>]`:
|
|
124
131
|
Apply the Rubygems security policy <policy>, where policy is one of
|
|
@@ -142,8 +149,8 @@ update process below under [CONSERVATIVE UPDATING][].
|
|
|
142
149
|
## DEPLOYMENT MODE
|
|
143
150
|
|
|
144
151
|
Bundler's defaults are optimized for development. To switch to
|
|
145
|
-
defaults optimized for deployment, use the `--deployment`
|
|
146
|
-
Do not activate deployment mode on development machines, as it
|
|
152
|
+
defaults optimized for deployment and for CI, use the `--deployment`
|
|
153
|
+
flag. Do not activate deployment mode on development machines, as it
|
|
147
154
|
will cause an error when the Gemfile(5) is modified.
|
|
148
155
|
|
|
149
156
|
1. A `Gemfile.lock` is required.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
bundle-lock(1) -- Creates / Updates a lockfile without installing
|
|
2
|
+
=================================================================
|
|
3
|
+
|
|
4
|
+
## SYNOPSIS
|
|
5
|
+
|
|
6
|
+
`bundle lock` [--update]
|
|
7
|
+
[--local]
|
|
8
|
+
[--print]
|
|
9
|
+
[--lockfile=PATH]
|
|
10
|
+
|
|
11
|
+
## DESCRIPTION
|
|
12
|
+
|
|
13
|
+
Lock the gems specified in Gemfile.
|
|
14
|
+
|
|
15
|
+
## OPTIONS
|
|
16
|
+
|
|
17
|
+
* `--update=<*gems>`:
|
|
18
|
+
Ignores the existing lockfile. Resolve then updates lockfile. Taking a list
|
|
19
|
+
of gems or updating all gems if no list is given.
|
|
20
|
+
|
|
21
|
+
* `--local`:
|
|
22
|
+
Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
|
|
23
|
+
gems already present in Rubygems' cache or in `vendor/cache`. Note that if a
|
|
24
|
+
appropriate platform-specific gem exists on `rubygems.org` it will not be
|
|
25
|
+
found.
|
|
26
|
+
|
|
27
|
+
* `--print`:
|
|
28
|
+
Prints the lockfile to STDOUT instead of writing to the file system.
|
|
29
|
+
|
|
30
|
+
* `--lockfile=<path>`:
|
|
31
|
+
The path where the lockfile should be written to.
|
|
32
|
+
|
|
33
|
+
## UPDATING ALL GEMS
|
|
34
|
+
|
|
35
|
+
If you run `bundle lock` with `--update` option without list of gems, bundler will
|
|
36
|
+
ignore any previously installed gems and resolve all dependencies again based
|
|
37
|
+
on the latest versions of all gems available in the sources.
|
|
38
|
+
|
|
39
|
+
## UPDATING A LIST OF GEMS
|
|
40
|
+
|
|
41
|
+
Sometimes, you want to update a single gem in the Gemfile(5), and leave the rest of
|
|
42
|
+
the gems that you specified locked to the versions in the `Gemfile.lock`.
|
|
43
|
+
|
|
44
|
+
For instance, you only want to update `nokogiri`, run `bundle lock --update nokogiri`.
|
|
45
|
+
|
|
46
|
+
Bundler will update `nokogiri` and any of its dependencies, but leave the rest of the
|
|
47
|
+
gems that you specified locked to the versions in the `Gemfile.lock`.
|
data/man/bundle.ronn
CHANGED
|
@@ -76,7 +76,7 @@ We divide `bundle` subcommands into primary commands and utilities.
|
|
|
76
76
|
* `bundle init(1)`:
|
|
77
77
|
Generate a simple `Gemfile`, placed in the current directory
|
|
78
78
|
|
|
79
|
-
*
|
|
79
|
+
* [bundle gem(1)][bundle-gem]:
|
|
80
80
|
Create a simple gem, suitable for development with bundler
|
|
81
81
|
|
|
82
82
|
* [bundle platform(1)][bundle-platform]:
|
data/man/gemfile.5.ronn
CHANGED
|
@@ -183,6 +183,8 @@ There are a number of `Gemfile` platforms:
|
|
|
183
183
|
_ruby_ `AND` version 2.1
|
|
184
184
|
* `ruby_22`:
|
|
185
185
|
_ruby_ `AND` version 2.2
|
|
186
|
+
* `ruby_23`:
|
|
187
|
+
_ruby_ `AND` version 2.3
|
|
186
188
|
* `mri`:
|
|
187
189
|
Same as _ruby_, but not Rubinius
|
|
188
190
|
* `mri_18`:
|
|
@@ -195,6 +197,8 @@ There are a number of `Gemfile` platforms:
|
|
|
195
197
|
_mri_ `AND` version 2.1
|
|
196
198
|
* `mri_22`:
|
|
197
199
|
_mri_ `AND` version 2.2
|
|
200
|
+
* `mri_23`:
|
|
201
|
+
_mri_ `AND` version 2.3
|
|
198
202
|
* `rbx`:
|
|
199
203
|
Same as _ruby_, but only Rubinius (not MRI)
|
|
200
204
|
* `jruby`:
|
|
@@ -213,6 +217,8 @@ There are a number of `Gemfile` platforms:
|
|
|
213
217
|
_mingw_ `AND` version 2.1
|
|
214
218
|
* `mingw_22`:
|
|
215
219
|
_mingw_ `AND` version 2.2
|
|
220
|
+
* `mingw_23`:
|
|
221
|
+
_mingw_ `AND` version 2.3
|
|
216
222
|
* `x64_mingw`:
|
|
217
223
|
Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
|
|
218
224
|
* `x64_mingw_20`:
|
|
@@ -221,6 +227,8 @@ There are a number of `Gemfile` platforms:
|
|
|
221
227
|
_x64_mingw_ `AND` version 2.1
|
|
222
228
|
* `x64_mingw_22`:
|
|
223
229
|
_x64_mingw_ `AND` version 2.2
|
|
230
|
+
* `x64_mingw_23`:
|
|
231
|
+
_x64_mingw_ `AND` version 2.3
|
|
224
232
|
|
|
225
233
|
As with groups, you can specify one or more platforms:
|
|
226
234
|
|
data/man/index.txt
CHANGED