bundler 1.16.1 → 1.16.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (93) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +4 -0
  4. data/lib/bundler.rb +2 -2
  5. data/lib/bundler/build_metadata.rb +2 -2
  6. data/lib/bundler/cli.rb +2 -0
  7. data/lib/bundler/cli/check.rb +1 -1
  8. data/lib/bundler/cli/exec.rb +3 -4
  9. data/lib/bundler/cli/gem.rb +5 -2
  10. data/lib/bundler/cli/init.rb +5 -0
  11. data/lib/bundler/cli/install.rb +2 -2
  12. data/lib/bundler/cli/outdated.rb +1 -1
  13. data/lib/bundler/compact_index_client/updater.rb +10 -1
  14. data/lib/bundler/definition.rb +16 -11
  15. data/lib/bundler/fetcher.rb +2 -2
  16. data/lib/bundler/fetcher/index.rb +2 -2
  17. data/lib/bundler/friendly_errors.rb +2 -0
  18. data/lib/bundler/injector.rb +4 -4
  19. data/lib/bundler/installer.rb +12 -4
  20. data/lib/bundler/installer/gem_installer.rb +6 -1
  21. data/lib/bundler/plugin/index.rb +6 -1
  22. data/lib/bundler/resolver/spec_group.rb +0 -1
  23. data/lib/bundler/rubygems_integration.rb +9 -3
  24. data/lib/bundler/runtime.rb +1 -1
  25. data/lib/bundler/source/git.rb +2 -1
  26. data/lib/bundler/source/git/git_proxy.rb +6 -1
  27. data/lib/bundler/source/rubygems.rb +6 -1
  28. data/lib/bundler/spec_set.rb +4 -1
  29. data/lib/bundler/templates/Executable +1 -1
  30. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -2
  31. data/lib/bundler/ui/shell.rb +3 -1
  32. data/lib/bundler/version.rb +1 -1
  33. data/man/bundle-add.1 +1 -1
  34. data/man/bundle-add.1.txt +1 -1
  35. data/man/bundle-binstubs.1 +4 -4
  36. data/man/bundle-binstubs.1.txt +4 -4
  37. data/man/bundle-binstubs.ronn +3 -3
  38. data/man/bundle-check.1 +4 -4
  39. data/man/bundle-check.1.txt +6 -5
  40. data/man/bundle-check.ronn +3 -3
  41. data/man/bundle-config.1 +23 -6
  42. data/man/bundle-config.1.txt +25 -15
  43. data/man/bundle-config.ronn +13 -9
  44. data/man/bundle-doctor.1 +44 -0
  45. data/man/bundle-doctor.1.txt +44 -0
  46. data/man/bundle-doctor.ronn +33 -0
  47. data/man/bundle-exec.1 +4 -4
  48. data/man/bundle-exec.1.txt +9 -9
  49. data/man/bundle-exec.ronn +3 -3
  50. data/man/bundle-gem.1 +2 -2
  51. data/man/bundle-gem.1.txt +2 -2
  52. data/man/bundle-gem.ronn +1 -1
  53. data/man/bundle-info.1 +1 -1
  54. data/man/bundle-info.1.txt +1 -1
  55. data/man/bundle-init.1 +9 -4
  56. data/man/bundle-init.1.txt +16 -6
  57. data/man/bundle-init.ronn +15 -4
  58. data/man/bundle-inject.1 +4 -4
  59. data/man/bundle-inject.1.txt +5 -5
  60. data/man/bundle-inject.ronn +3 -3
  61. data/man/bundle-install.1 +2 -2
  62. data/man/bundle-install.1.txt +2 -2
  63. data/man/bundle-install.ronn +1 -1
  64. data/man/bundle-list.1 +1 -1
  65. data/man/bundle-list.1.txt +1 -1
  66. data/man/bundle-lock.1 +2 -2
  67. data/man/bundle-lock.1.txt +2 -2
  68. data/man/bundle-lock.ronn +1 -1
  69. data/man/bundle-outdated.1 +2 -2
  70. data/man/bundle-outdated.1.txt +2 -2
  71. data/man/bundle-outdated.ronn +1 -1
  72. data/man/bundle-package.1 +3 -3
  73. data/man/bundle-package.1.txt +6 -6
  74. data/man/bundle-package.ronn +3 -3
  75. data/man/bundle-pristine.1 +1 -1
  76. data/man/bundle-pristine.1.txt +1 -1
  77. data/man/bundle-show.1 +3 -3
  78. data/man/bundle-show.1.txt +4 -3
  79. data/man/bundle-show.ronn +2 -2
  80. data/man/bundle-update.1 +8 -8
  81. data/man/bundle-update.1.txt +42 -41
  82. data/man/bundle-update.ronn +8 -8
  83. data/man/bundle-viz.1 +2 -2
  84. data/man/bundle-viz.1.txt +3 -2
  85. data/man/bundle-viz.ronn +1 -1
  86. data/man/bundle.1 +26 -26
  87. data/man/bundle.1.txt +26 -26
  88. data/man/bundle.ronn +25 -25
  89. data/man/gemfile.5 +4 -4
  90. data/man/gemfile.5.ronn +3 -3
  91. data/man/gemfile.5.txt +6 -6
  92. data/man/index.txt +1 -0
  93. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1740d2e5ead04fc448d7676f9e57b2621dfdc16c
4
- data.tar.gz: e36b94d810b1eba94863fcd681157abacbed3516
2
+ SHA256:
3
+ metadata.gz: 535caed2fb3e13277d20fba1f3cdd019c7825af25507286fd6e251081b945687
4
+ data.tar.gz: 0ca51a24349cc26e4bc937ce65884dfd43adc1cb0f154a220b3d4bebd6998a09
5
5
  SHA512:
6
- metadata.gz: 29116c83cab200dc0a8103736f80ba25d238b129f2b650947f67e0aae871f655383ee6933683a5162a0de3c2209303c69aa8aae99136effdaec3fd633939371f
7
- data.tar.gz: 635d4a391d1c24695b9bb0f313b51f16f832462dfb5384fd8201c57c89537a78cc1919cce4ec4134b4518683fd6fd33fcfabd2196c40852f47ac22e255dfcb45
6
+ metadata.gz: 7caecc87de4d123a8f5a514e1a5f1d95f39d55bdc7de8c80e1088b944f1d985a8e369551781fc712a1962bfb6c72994263dc90b579e37557c5b2d841dfcfa3fb
7
+ data.tar.gz: f8997d3df4cbe33dd8eeb99345e21d62050492cea261c143fb3e3097cdc32d3d357f0479cbe0f9aef53642fb9ab20719db0b8a2142d9459077c2312e970a05b0
@@ -1,3 +1,53 @@
1
+ ## 1.16.2 (2018-04-20)
2
+
3
+ Changes:
4
+
5
+ - Include the gem's source in the gem install error message when available (@papanikge)
6
+ - Remove unnecessary executable bit from gem template (@voxik)
7
+ - Dont add the timestamp comment with gems added to the Gemfile via `bundle add` ([#6193](https://github.com/bundler/bundler/issues/6193), @cpgo)
8
+ - Improve yanked gem error message (@alyssais)
9
+ - Use `Bundler.rubygems.inflate` instead of the Gem::Util method directly (@segiddins)
10
+ - Remove unused instance variable (@segiddins)
11
+
12
+ Bugfixes:
13
+
14
+ - Only trap INT signal and have Ruby's signal default handler be invoked (@shayonj)
15
+ - Fix warning about the use of `__FILE__` in RubyGems integration testing (@MSP-Greg)
16
+ - Skip the outdated bundler check when MD5 is not available ([#6032](https://github.com/bundler/bundler/issues/6032), @segiddins)
17
+ - Fallback to the original error if the friendly message raises (@segiddins)
18
+ - Rename Bundler.frozen? to avoid Object method conflict ([#6252](https://github.com/bundler/bundler/issues/6252), @segiddins)
19
+ - Ensure the bindir exists before installing gems (@segiddins)
20
+ - Handle gzip corruption errors in the compact index client ([#6261](https://github.com/bundler/bundler/issues/6261), @colby-swandale)
21
+ - Check if the current directory is writeable when writing files in `bundle gem` ([#6219](https://github.com/bundler/bundler/issues/6219), @nilsding)
22
+ - Fix hang when gemspec has incompatible encoding (@deivid-rodriguez)
23
+ - Gracefully handle when the lockfile is missing spec entries for the current platform ([#6079](https://github.com/bundler/bundler/issues/6079), @segiddins)
24
+ - Use Gem::Util.inflate instead of Gem.inflate (@hsbt)
25
+ - Update binstub generator to use new ERB.new arity in Ruby 2.6 (@koic)
26
+ - Fix `source_location` call in rubygems integration (@MSP-Greg)
27
+ - Use `filesystem_access` when copying files in Compact Index Updater ([#6289](https://github.com/bundler/bundler/issues/6289), @segiddins)
28
+ - Fail gracefully when resetting git gems to the given revision fails ([#6324](https://github.com/bundler/bundler/issues/6324), @segiddins)
29
+ - Handle exceptions that do not have a backtrace ([#6342](https://github.com/bundler/bundler/issues/6342), @nesaulov)
30
+ - Check if stderr was closed before writing to it (@shime)
31
+ - Handle updating a specific gem for a non-local platform ([#6350](https://github.com/bundler/bundler/issues/6350), @greysteil)
32
+ - Bump the `bundle_binstub` check-length to 300 characters (@tduffield)
33
+ - Fix specifying alterntive Lockfile with `bundle lock` when default gemfile is present ([#6460](https://github.com/bundler/bundler/issues/6460), @agrim123)
34
+ - Allow installing dependencies when the path is set to `.` ([#6475](https://github.com/bundler/bundler/issues/6475), @segiddins)
35
+ - Support Bundler installing on a readonly filesystem without a home directory ([#6461](https://github.com/bundler/bundler/issues/6461), @grosser)
36
+ - Filter git uri credentials in source description (@segiddins)
37
+
38
+ Documentation:
39
+
40
+ - Correct typos in `bundle binstubs` man page (@erikj, @samueloph)
41
+ - Update links in `bundle gem` command documentation to use https (@KrauseFx)
42
+ - Fix broken links between bundler man pages (@segiddins)
43
+ - Add man page for the `bundle doctor` command ([#6243](https://github.com/bundler/bundler/issues/6243), @nholden)
44
+ - Document `# frozen_string_literal` in `bundle init` Gemfile (@315tky)
45
+ - Explain the gemspec files attribute in `bundle gem` template and print a link to bundler.io guides when running `bundle gem` ([#6246](https://github.com/bundler/bundler/issues/6246), @nesaulov)
46
+ - Small copy tweaks & removed redundant phrasing in the bundler man page (@rubymorillo)
47
+ - Improve the documentation of the settings load order in Bundler (@rubymorillo)
48
+ - Added license info to main README (@rubymorillo)
49
+ - Document parameters and return value of Injector#inject (@tobias-grasse)
50
+
1
51
  ## 1.16.1 (2017-12-12)
2
52
 
3
53
  Bugfixes:
data/README.md CHANGED
@@ -57,3 +57,7 @@ While some Bundler contributors are compensated by Ruby Together, the project ma
57
57
  ### Code of Conduct
58
58
 
59
59
  Everyone interacting in the Bundler project’s codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [Bundler code of conduct](https://github.com/bundler/bundler/blob/master/CODE_OF_CONDUCT.md).
60
+
61
+ ### License
62
+
63
+ [MIT License](https://github.com/bundler/bundler/blob/master/LICENSE.md)
@@ -136,7 +136,7 @@ module Bundler
136
136
  end
137
137
  end
138
138
 
139
- def frozen?
139
+ def frozen_bundle?
140
140
  frozen = settings[:deployment]
141
141
  frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
142
142
  frozen
@@ -427,7 +427,7 @@ EOF
427
427
 
428
428
  def load_gemspec_uncached(file, validate = false)
429
429
  path = Pathname.new(file)
430
- contents = path.read
430
+ contents = read_file(file)
431
431
  spec = if contents.start_with?("---") # YAML header
432
432
  eval_yaml_gemspec(path, contents)
433
433
  else
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2017-12-21".freeze
8
- @git_commit_sha = "0034ef341".freeze
7
+ @built_at = "2018-05-16".freeze
8
+ @git_commit_sha = "9f7bf0ac3".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -717,6 +717,8 @@ module Bundler
717
717
  command_name = current_command.name
718
718
  return if PARSEABLE_COMMANDS.include?(command_name)
719
719
 
720
+ return unless SharedHelpers.md5_available?
721
+
720
722
  latest = Fetcher::CompactIndex.
721
723
  new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
722
724
  send(:compact_index_client).
@@ -26,7 +26,7 @@ module Bundler
26
26
  not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
27
27
  Bundler.ui.warn "Install missing gems with `bundle install`"
28
28
  exit 1
29
- elsif !Bundler.default_lockfile.file? && Bundler.frozen?
29
+ elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
30
30
  Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
31
31
  exit 1
32
32
  else
@@ -6,7 +6,7 @@ module Bundler
6
6
  class CLI::Exec
7
7
  attr_reader :options, :args, :cmd
8
8
 
9
- RESERVED_SIGNALS = %w[SEGV BUS ILL FPE VTALRM KILL STOP].freeze
9
+ TRAPPED_SIGNALS = %w[INT].freeze
10
10
 
11
11
  def initialize(options, args)
12
12
  @options = options
@@ -70,15 +70,14 @@ module Bundler
70
70
  ui = Bundler.ui
71
71
  Bundler.ui = nil
72
72
  require "bundler/setup"
73
- signals = Signal.list.keys - RESERVED_SIGNALS
74
- signals.each {|s| trap(s, "DEFAULT") }
73
+ TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
75
74
  Kernel.load(file)
76
75
  rescue SystemExit, SignalException
77
76
  raise
78
77
  rescue Exception => e # rubocop:disable Lint/RescueException
79
78
  Bundler.ui = ui
80
79
  Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
81
- backtrace = e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) }
80
+ backtrace = e.backtrace ? e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) } : []
82
81
  abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
83
82
  end
84
83
 
@@ -105,7 +105,7 @@ module Bundler
105
105
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
106
106
  "This means that any other developer or company will be legally allowed to use your code " \
107
107
  "for free as long as they admit you created it. You can read more about the MIT license " \
108
- "at http://choosealicense.com/licenses/mit.")
108
+ "at https://choosealicense.com/licenses/mit.")
109
109
  config[:mit] = true
110
110
  Bundler.ui.info "MIT License enabled in config"
111
111
  templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
@@ -118,7 +118,7 @@ module Bundler
118
118
  "of enforcing it, so be sure that you are prepared to do that. Be sure that your email " \
119
119
  "address is specified as a contact in the generated code of conduct so that people know " \
120
120
  "who to contact in case of a violation. For suggestions about " \
121
- "how to enforce codes of conduct, see http://bit.ly/coc-enforcement.")
121
+ "how to enforce codes of conduct, see https://bit.ly/coc-enforcement.")
122
122
  config[:coc] = true
123
123
  Bundler.ui.info "Code of conduct enabled in config"
124
124
  templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
@@ -158,6 +158,9 @@ module Bundler
158
158
 
159
159
  # Open gemspec in editor
160
160
  open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
161
+
162
+ Bundler.ui.info "Gem '#{name}' was successfully created. " \
163
+ "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
161
164
  rescue Errno::EEXIST => e
162
165
  raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
163
166
  end
@@ -13,6 +13,11 @@ module Bundler
13
13
  exit 1
14
14
  end
15
15
 
16
+ unless File.writable?(Dir.pwd)
17
+ Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
18
+ exit 1
19
+ end
20
+
16
21
  if options[:gemspec]
17
22
  gemspec = File.expand_path(options[:gemspec])
18
23
  unless File.exist?(gemspec)
@@ -23,7 +23,7 @@ module Bundler
23
23
 
24
24
  check_trust_policy
25
25
 
26
- if options[:deployment] || options[:frozen] || Bundler.frozen?
26
+ if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
27
27
  unless Bundler.default_lockfile.exist?
28
28
  flag = "--deployment flag" if options[:deployment]
29
29
  flag ||= "--frozen flag" if options[:frozen]
@@ -63,7 +63,7 @@ module Bundler
63
63
  definition.validate_runtime!
64
64
 
65
65
  installer = Installer.install(Bundler.root, definition, options)
66
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen?
66
+ Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
67
67
 
68
68
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
69
69
  Bundler::CLI::Common.output_without_groups_message
@@ -213,7 +213,7 @@ module Bundler
213
213
  end
214
214
 
215
215
  def check_for_deployment_mode
216
- return unless Bundler.frozen?
216
+ return unless Bundler.frozen_bundle?
217
217
  suggested_command = if Bundler.settings.locations("frozen")[:global]
218
218
  "bundle config --delete frozen"
219
219
  elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
@@ -33,7 +33,9 @@ module Bundler
33
33
 
34
34
  # first try to fetch any new bytes on the existing file
35
35
  if retrying.nil? && local_path.file?
36
- FileUtils.cp local_path, local_temp_path
36
+ SharedHelpers.filesystem_access(local_temp_path) do
37
+ FileUtils.cp local_path, local_temp_path
38
+ end
37
39
  headers["If-None-Match"] = etag_for(local_temp_path)
38
40
  headers["Range"] =
39
41
  if local_temp_path.size.nonzero?
@@ -78,6 +80,13 @@ module Bundler
78
80
 
79
81
  update(local_path, remote_path, :retrying)
80
82
  end
83
+ rescue Errno::EACCES
84
+ raise Bundler::PermissionError,
85
+ "Bundler does not have write access to create a temp directory " \
86
+ "within #{Dir.tmpdir}. Bundler must have write access to your " \
87
+ "systems temp directory to function properly. "
88
+ rescue Zlib::GzipFile::Error
89
+ raise Bundler::HTTPError
81
90
  end
82
91
 
83
92
  def etag_for(path)
@@ -77,6 +77,7 @@ module Bundler
77
77
  @lockfile_contents = String.new
78
78
  @locked_bundler_version = nil
79
79
  @locked_ruby_version = nil
80
+ @locked_specs_incomplete_for_platform = false
80
81
 
81
82
  if lockfile && File.exist?(lockfile)
82
83
  @lockfile_contents = Bundler.read_file(lockfile)
@@ -113,15 +114,15 @@ module Bundler
113
114
  end
114
115
  @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
115
116
 
116
- add_current_platform unless Bundler.frozen?
117
+ add_current_platform unless Bundler.frozen_bundle?
117
118
 
118
119
  converge_path_sources_to_gemspec_sources
119
120
  @path_changes = converge_paths
120
121
  @source_changes = converge_sources
121
122
 
122
123
  unless @unlock[:lock_shared_dependencies]
123
- eager_unlock = expand_dependencies(@unlock[:gems])
124
- @unlock[:gems] = @locked_specs.for(eager_unlock).map(&:name)
124
+ eager_unlock = expand_dependencies(@unlock[:gems], true)
125
+ @unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
125
126
  end
126
127
 
127
128
  @gem_version_promoter = create_gem_version_promoter
@@ -175,7 +176,7 @@ module Bundler
175
176
  raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
176
177
  "be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
177
178
  "that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
178
- "to a different version of #{locked_gem} that hasn't been removed in order to install."
179
+ "to a version other than #{locked_gem} that hasn't been removed in order to install."
179
180
  end
180
181
  unless specs["bundler"].any?
181
182
  bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
@@ -245,7 +246,7 @@ module Bundler
245
246
  def resolve
246
247
  @resolve ||= begin
247
248
  last_resolve = converge_locked_specs
248
- if Bundler.frozen?
249
+ if Bundler.frozen_bundle?
249
250
  Bundler.ui.debug "Frozen, using resolution from the lockfile"
250
251
  last_resolve
251
252
  elsif !unlocking? && nothing_changed?
@@ -336,10 +337,11 @@ module Bundler
336
337
  end
337
338
  end
338
339
 
339
- preserve_unknown_sections ||= !updating_major && (Bundler.frozen? || !(unlocking? || @unlocking_bundler))
340
- return if lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
340
+ preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
341
341
 
342
- if Bundler.frozen?
342
+ return if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
343
+
344
+ if Bundler.frozen_bundle?
343
345
  Bundler.ui.error "Cannot write a changed lockfile while frozen."
344
346
  return
345
347
  end
@@ -530,7 +532,7 @@ module Bundler
530
532
  private :sources
531
533
 
532
534
  def nothing_changed?
533
- !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
535
+ !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
534
536
  end
535
537
 
536
538
  def unlocking?
@@ -557,6 +559,7 @@ module Bundler
557
559
  [@new_platform, "you added a new platform to your gemfile"],
558
560
  [@path_changes, "the gemspecs for path gems changed"],
559
561
  [@local_changes, "the gemspecs for git local gems changed"],
562
+ [@locked_specs_incomplete_for_platform, "the lockfile does not have all gems needed for the current platform"],
560
563
  ].select(&:first).map(&:last).join(", ")
561
564
  end
562
565
 
@@ -682,7 +685,7 @@ module Bundler
682
685
  end
683
686
 
684
687
  def converge_dependencies
685
- frozen = Bundler.frozen?
688
+ frozen = Bundler.frozen_bundle?
686
689
  (@dependencies + @locked_deps.values).each do |dep|
687
690
  locked_source = @locked_deps[dep.name]
688
691
  # This is to make sure that if bundler is installing in deployment mode and
@@ -803,7 +806,9 @@ module Bundler
803
806
  end
804
807
 
805
808
  resolve = SpecSet.new(converged)
806
- resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
809
+ expanded_deps = expand_dependencies(deps, true)
810
+ @locked_specs_incomplete_for_platform = !resolve.for(expanded_deps, @unlock[:gems], true, true)
811
+ resolve = resolve.for(expanded_deps, @unlock[:gems], false, false, false)
807
812
  diff = nil
808
813
 
809
814
  # Now, we unlock any sources that do not have anymore gems pinned to it
@@ -96,11 +96,11 @@ module Bundler
96
96
 
97
97
  uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
98
98
  if uri.scheme == "file"
99
- Bundler.load_marshal Gem.inflate(Gem.read_binary(uri.path))
99
+ Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path))
100
100
  elsif cached_spec_path = gemspec_cached_path(spec_file_name)
101
101
  Bundler.load_gemspec(cached_spec_path)
102
102
  else
103
- Bundler.load_marshal Gem.inflate(downloader.fetch(uri).body)
103
+ Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
104
104
  end
105
105
  rescue MarshalError
106
106
  raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
@@ -29,11 +29,11 @@ module Bundler
29
29
 
30
30
  uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
31
31
  if uri.scheme == "file"
32
- Bundler.load_marshal Gem.inflate(Gem.read_binary(uri.path))
32
+ Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path))
33
33
  elsif cached_spec_path = gemspec_cached_path(spec_file_name)
34
34
  Bundler.load_gemspec(cached_spec_path)
35
35
  else
36
- Bundler.load_marshal Gem.inflate(downloader.fetch(uri).body)
36
+ Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
37
37
  end
38
38
  rescue MarshalError
39
39
  raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
@@ -45,6 +45,8 @@ module Bundler
45
45
  "Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
46
46
  else request_issue_report_for(error)
47
47
  end
48
+ rescue
49
+ raise error
48
50
  end
49
51
 
50
52
  def exit_status(error)
@@ -12,8 +12,11 @@ module Bundler
12
12
  @options = options
13
13
  end
14
14
 
15
+ # @param [Pathname] gemfile_path The Gemfile in which to inject the new dependency.
16
+ # @param [Pathname] lockfile_path The lockfile in which to inject the new dependency.
17
+ # @return [Array]
15
18
  def inject(gemfile_path, lockfile_path)
16
- if Bundler.frozen?
19
+ if Bundler.frozen_bundle?
17
20
  # ensure the lock and Gemfile are synced
18
21
  Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
19
22
  end
@@ -84,9 +87,6 @@ module Bundler
84
87
  def append_to(gemfile_path, new_gem_lines)
85
88
  gemfile_path.open("a") do |f|
86
89
  f.puts
87
- if @options["timestamp"] || @options["timestamp"].nil?
88
- f.puts "# Added at #{Time.now} by #{`whoami`.chomp}:"
89
- end
90
90
  f.puts new_gem_lines
91
91
  end
92
92
  end
@@ -70,7 +70,7 @@ module Bundler
70
70
  create_bundle_path
71
71
 
72
72
  ProcessLock.lock do
73
- if Bundler.frozen?
73
+ if Bundler.frozen_bundle?
74
74
  @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
75
75
  end
76
76
 
@@ -90,7 +90,7 @@ module Bundler
90
90
  end
91
91
  install(options)
92
92
 
93
- lock unless Bundler.frozen?
93
+ lock unless Bundler.frozen_bundle?
94
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
95
95
  end
96
96
  end
@@ -135,7 +135,11 @@ module Bundler
135
135
  end
136
136
 
137
137
  File.open(binstub_path, "w", 0o777 & ~File.umask) do |f|
138
- f.puts ERB.new(template, nil, "-").result(binding)
138
+ if RUBY_VERSION >= "2.6"
139
+ f.puts ERB.new(template, :trim_mode => "-").result(binding)
140
+ else
141
+ f.puts ERB.new(template, nil, "-").result(binding)
142
+ end
139
143
  end
140
144
  end
141
145
 
@@ -171,7 +175,11 @@ module Bundler
171
175
  executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
172
176
  executable_path = executable_path
173
177
  File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
174
- f.puts ERB.new(template, nil, "-").result(binding)
178
+ if RUBY_VERSION >= "2.6"
179
+ f.puts ERB.new(template, :trim_mode => "-").result(binding)
180
+ else
181
+ f.puts ERB.new(template, nil, "-").result(binding)
182
+ end
175
183
  end
176
184
  end
177
185
  end