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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +105 -0
  3. data/.rubocop_todo.yml +120 -0
  4. data/.travis.yml +8 -23
  5. data/CHANGELOG.md +95 -0
  6. data/CODE_OF_CONDUCT.md +6 -4
  7. data/DEVELOPMENT.md +4 -5
  8. data/README.md +2 -2
  9. data/Rakefile +71 -88
  10. data/bin/rake +14 -0
  11. data/bin/rspec +10 -0
  12. data/bin/rubocop +11 -0
  13. data/bundler.gemspec +17 -15
  14. data/exe/bundle +20 -0
  15. data/{bin → exe}/bundle_ruby +6 -4
  16. data/exe/bundler +20 -0
  17. data/lib/bundler/capistrano.rb +2 -2
  18. data/lib/bundler/cli/binstubs.rb +1 -2
  19. data/lib/bundler/cli/cache.rb +0 -1
  20. data/lib/bundler/cli/check.rb +7 -5
  21. data/lib/bundler/cli/clean.rb +0 -1
  22. data/lib/bundler/cli/common.rb +6 -7
  23. data/lib/bundler/cli/config.rb +69 -56
  24. data/lib/bundler/cli/console.rb +8 -8
  25. data/lib/bundler/cli/exec.rb +5 -4
  26. data/lib/bundler/cli/gem.rb +52 -40
  27. data/lib/bundler/cli/init.rb +5 -6
  28. data/lib/bundler/cli/inject.rb +1 -2
  29. data/lib/bundler/cli/install.rb +18 -21
  30. data/lib/bundler/cli/lock.rb +8 -3
  31. data/lib/bundler/cli/open.rb +4 -5
  32. data/lib/bundler/cli/outdated.rb +7 -8
  33. data/lib/bundler/cli/package.rb +1 -1
  34. data/lib/bundler/cli/platform.rb +2 -3
  35. data/lib/bundler/cli/show.rb +9 -9
  36. data/lib/bundler/cli/update.rb +2 -3
  37. data/lib/bundler/cli/viz.rb +1 -2
  38. data/lib/bundler/cli.rb +85 -74
  39. data/lib/bundler/constants.rb +1 -1
  40. data/lib/bundler/current_ruby.rb +38 -3
  41. data/lib/bundler/definition.rb +83 -88
  42. data/lib/bundler/dep_proxy.rb +11 -9
  43. data/lib/bundler/dependency.rb +17 -11
  44. data/lib/bundler/deployment.rb +2 -2
  45. data/lib/bundler/deprecate.rb +3 -3
  46. data/lib/bundler/dsl.rb +62 -43
  47. data/lib/bundler/env.rb +19 -12
  48. data/lib/bundler/environment.rb +1 -2
  49. data/lib/bundler/errors.rb +82 -0
  50. data/lib/bundler/fetcher/base.rb +20 -7
  51. data/lib/bundler/fetcher/dependency.rb +5 -5
  52. data/lib/bundler/fetcher/downloader.rb +1 -2
  53. data/lib/bundler/fetcher/index.rb +4 -7
  54. data/lib/bundler/fetcher.rb +49 -40
  55. data/lib/bundler/friendly_errors.rb +15 -8
  56. data/lib/bundler/gem_helper.rb +44 -35
  57. data/lib/bundler/gem_helpers.rb +7 -8
  58. data/lib/bundler/gem_remote_fetcher.rb +41 -0
  59. data/lib/bundler/gem_tasks.rb +4 -1
  60. data/lib/bundler/graph.rb +25 -24
  61. data/lib/bundler/index.rb +21 -18
  62. data/lib/bundler/injector.rb +2 -4
  63. data/lib/bundler/inline.rb +3 -3
  64. data/lib/bundler/installer/gem_installer.rb +76 -0
  65. data/lib/bundler/installer/parallel_installer.rb +22 -13
  66. data/lib/bundler/installer/standalone.rb +48 -0
  67. data/lib/bundler/installer.rb +57 -144
  68. data/lib/bundler/lazy_specification.rb +4 -5
  69. data/lib/bundler/lockfile_parser.rb +21 -19
  70. data/lib/bundler/man/bundle +2 -2
  71. data/lib/bundler/man/bundle-config +2 -2
  72. data/lib/bundler/man/bundle-config.txt +6 -4
  73. data/lib/bundler/man/bundle-exec +1 -1
  74. data/lib/bundler/man/bundle-exec.txt +1 -1
  75. data/lib/bundler/man/bundle-gem +80 -0
  76. data/lib/bundler/man/bundle-gem.txt +90 -0
  77. data/lib/bundler/man/bundle-install +37 -6
  78. data/lib/bundler/man/bundle-install.txt +68 -44
  79. data/lib/bundler/man/bundle-lock +55 -0
  80. data/lib/bundler/man/bundle-lock.txt +60 -0
  81. data/lib/bundler/man/bundle-package +1 -1
  82. data/lib/bundler/man/bundle-package.txt +1 -1
  83. data/lib/bundler/man/bundle-platform +1 -1
  84. data/lib/bundler/man/bundle-platform.txt +1 -1
  85. data/lib/bundler/man/bundle-update +1 -1
  86. data/lib/bundler/man/bundle-update.txt +1 -1
  87. data/lib/bundler/man/bundle.txt +2 -2
  88. data/lib/bundler/man/gemfile.5 +17 -1
  89. data/lib/bundler/man/gemfile.5.txt +12 -1
  90. data/lib/bundler/match_platform.rb +4 -4
  91. data/lib/bundler/psyched_yaml.rb +5 -5
  92. data/lib/bundler/remote_specification.rb +1 -1
  93. data/lib/bundler/resolver.rb +93 -88
  94. data/lib/bundler/retry.rb +9 -10
  95. data/lib/bundler/ruby_dsl.rb +1 -1
  96. data/lib/bundler/ruby_version.rb +7 -10
  97. data/lib/bundler/rubygems_ext.rb +32 -27
  98. data/lib/bundler/{gem_installer.rb → rubygems_gem_installer.rb} +2 -2
  99. data/lib/bundler/rubygems_integration.rb +85 -70
  100. data/lib/bundler/runtime.rb +65 -61
  101. data/lib/bundler/settings.rb +27 -26
  102. data/lib/bundler/setup.rb +3 -3
  103. data/lib/bundler/shared_helpers.rb +45 -20
  104. data/lib/bundler/similarity_detector.rb +19 -21
  105. data/lib/bundler/source/git/git_proxy.rb +52 -26
  106. data/lib/bundler/source/git.rb +29 -31
  107. data/lib/bundler/source/path/installer.rb +4 -4
  108. data/lib/bundler/source/path.rb +25 -28
  109. data/lib/bundler/source/rubygems/remote.rb +3 -3
  110. data/lib/bundler/source/rubygems.rb +62 -48
  111. data/lib/bundler/source.rb +4 -5
  112. data/lib/bundler/source_list.rb +4 -4
  113. data/lib/bundler/spec_set.rb +17 -15
  114. data/lib/bundler/ssl_certs/certificate_manager.rb +5 -6
  115. data/lib/bundler/stub_specification.rb +2 -2
  116. data/lib/bundler/templates/Executable +5 -5
  117. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +42 -6
  118. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  119. data/lib/bundler/templates/newgem/Rakefile.tt +4 -2
  120. data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
  121. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  122. data/lib/bundler/ui/rg_proxy.rb +2 -2
  123. data/lib/bundler/ui/shell.rb +10 -6
  124. data/lib/bundler/ui.rb +3 -3
  125. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +82 -71
  126. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  127. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +9 -0
  128. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +40 -21
  129. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -0
  130. data/lib/bundler/vendored_molinillo.rb +1 -1
  131. data/lib/bundler/vendored_persistent.rb +3 -3
  132. data/lib/bundler/vendored_thor.rb +2 -2
  133. data/lib/bundler/version.rb +1 -1
  134. data/lib/bundler/vlad.rb +1 -1
  135. data/lib/bundler/worker.rb +4 -5
  136. data/lib/bundler.rb +99 -120
  137. data/man/bundle-config.ronn +4 -2
  138. data/man/bundle-gem.ronn +77 -0
  139. data/man/bundle-install.ronn +13 -6
  140. data/man/bundle-lock.ronn +47 -0
  141. data/man/bundle.ronn +1 -1
  142. data/man/gemfile.5.ronn +8 -0
  143. data/man/index.txt +1 -0
  144. metadata +36 -8
  145. data/bin/bundle +0 -21
  146. data/bin/bundler +0 -21
@@ -1,3 +1,3 @@
1
1
  module Bundler; end
2
- require 'bundler/vendor/thor/lib/thor'
3
- require 'bundler/vendor/thor/lib/thor/actions'
2
+ require "bundler/vendor/thor/lib/thor"
3
+ require "bundler/vendor/thor/lib/thor/actions"
@@ -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.10.6" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.11.2" unless defined?(::Bundler::VERSION)
6
6
  end
data/lib/bundler/vlad.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and
4
4
  # include the vlad:bundle:install task in your vlad:deploy task.
5
- require 'bundler/deployment'
5
+ require "bundler/deployment"
6
6
 
7
7
  include Rake::DSL if defined? Rake::DSL
8
8
 
@@ -1,4 +1,4 @@
1
- require 'thread'
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 { |i| Thread.start { process_queue(i) } }
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 { |thread| thread.join }
64
+ @threads.each(&:join)
65
65
  end
66
66
 
67
67
  def abort_threads
68
- @threads.each {|i| i.exit }
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 'fileutils'
2
- require 'pathname'
3
- require 'rbconfig'
4
- require 'bundler/gem_path_manipulation'
5
- require 'bundler/rubygems_ext'
6
- require 'bundler/rubygems_integration'
7
- require 'bundler/version'
8
- require 'bundler/constants'
9
- require 'bundler/current_ruby'
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
- autoload :Definition, 'bundler/definition'
16
- autoload :Dependency, 'bundler/dependency'
17
- autoload :DepProxy, 'bundler/dep_proxy'
18
- autoload :Deprecate, 'bundler/deprecate'
19
- autoload :Dsl, 'bundler/dsl'
20
- autoload :EndpointSpecification, 'bundler/endpoint_specification'
21
- autoload :Environment, 'bundler/environment'
22
- autoload :Env, 'bundler/env'
23
- autoload :Fetcher, 'bundler/fetcher'
24
- autoload :GemHelper, 'bundler/gem_helper'
25
- autoload :GemHelpers, 'bundler/gem_helpers'
26
- autoload :GemInstaller, 'bundler/gem_installer'
27
- autoload :Graph, 'bundler/graph'
28
- autoload :Index, 'bundler/index'
29
- autoload :Installer, 'bundler/installer'
30
- autoload :Injector, 'bundler/injector'
31
- autoload :LazySpecification, 'bundler/lazy_specification'
32
- autoload :LockfileParser, 'bundler/lockfile_parser'
33
- autoload :MatchPlatform, 'bundler/match_platform'
34
- autoload :RemoteSpecification, 'bundler/remote_specification'
35
- autoload :Resolver, 'bundler/resolver'
36
- autoload :Retry, 'bundler/retry'
37
- autoload :RubyVersion, 'bundler/ruby_version'
38
- autoload :RubyDsl, 'bundler/ruby_dsl'
39
- autoload :Runtime, 'bundler/runtime'
40
- autoload :Settings, 'bundler/settings'
41
- autoload :SharedHelpers, 'bundler/shared_helpers'
42
- autoload :SpecSet, 'bundler/spec_set'
43
- autoload :StubSpecification, 'bundler/stub_specification'
44
- autoload :Source, 'bundler/source'
45
- autoload :SourceList, 'bundler/source_list'
46
- autoload :Specification, 'bundler/shared_helpers'
47
- autoload :SystemRubyVersion, 'bundler/ruby_version'
48
- autoload :UI, 'bundler/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(path)
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['BUNDLE_APP_CONFIG'] ?
205
- Pathname.new(ENV['BUNDLE_APP_CONFIG']).expand_path(root) :
206
- root.join('.bundle')
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(self.settings.app_cache_path)
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['MANPATH'] = ENV['BUNDLE_ORIG_MANPATH']
240
- ENV.delete_if { |k,_| k[0,7] == 'BUNDLE_' }
241
- if ENV.has_key? 'RUBYOPT'
242
- ENV['RUBYOPT'] = ENV['RUBYOPT'].sub '-rbundler/setup', ''
243
- ENV['RUBYOPT'] = ENV['RUBYOPT'].sub "-I#{File.expand_path('..', __FILE__)}", ''
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('build_info/*').to_s] | Dir[path.join('*').to_s]
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
- FileUtils.mkdir_p(path)
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['PATH']
316
- path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p|
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
- prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, '').strip + " "
326
- Your user account isn't allowed to install to the system Rubygems.
327
- You can cancel this installation and run:
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
- bundle install --path vendor/bundle
304
+ bundle install --path vendor/bundle
330
305
 
331
- to install the gems into ./vendor/bundle/, or you can enter your password
332
- and install the bundled gems to Rubygems using sudo.
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
- Password:
335
- PROMPT
309
+ Password:
310
+ PROMPT
336
311
 
337
- `sudo -p "#{prompt}" #{str}`
312
+ `sudo -p "#{prompt}" #{str}`
313
+ end
338
314
  end
339
315
 
340
316
  def read_file(file)
341
- File.open(file, "rb") { |f| f.read }
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
- Bundler.ui.warn "The gemspec at #{file} is not valid. " \
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 YamlSyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
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 { |line| line.include?(path.to_s) }
410
- msg = "There was a #{e.class} while loading #{path.basename}: \n#{e.message}"
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['GEM_HOME'].nil? || ENV['GEM_HOME'].empty?
398
+ blank_home = ENV["GEM_HOME"].nil? || ENV["GEM_HOME"].empty?
423
399
  if settings[:disable_shared_gems]
424
- ENV['GEM_PATH'] = ''
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 { |p| p.empty? }
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
- FileUtils.mkdir_p bundle_path.to_s rescue nil
413
+ begin
414
+ FileUtils.mkdir_p bundle_path.to_s
415
+ rescue
416
+ nil
417
+ end
438
418
 
439
- ENV['GEM_HOME'] = File.expand_path(bundle_path, root)
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
@@ -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 to install gems. Defaults to `$GEM_HOME` in development
88
- and `vendor/bundle` when `--deployment` is used
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.
@@ -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)
@@ -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
- Install gems by starting <number> of workers parallely.
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
- `production` use. Please check carefully if you want to have this option
81
- enabled in `development` or `test` environments.
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` flag.
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
- * `bundle gem(1)`:
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
@@ -5,3 +5,4 @@ bundle-package bundle-package.1
5
5
  bundle-exec bundle-exec.1
6
6
  bundle-config bundle-config.1
7
7
  bundle-platform bundle-platform.1
8
+ bundle-gem bundle-gem.1