rubygems-update 3.2.21 → 3.2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/bundler/CHANGELOG.md +16 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/doctor.rb +11 -1
- data/bundler/lib/bundler/cli/install.rb +1 -1
- data/bundler/lib/bundler/cli/lock.rb +5 -1
- data/bundler/lib/bundler/cli/update.rb +8 -3
- data/bundler/lib/bundler/current_ruby.rb +4 -4
- data/bundler/lib/bundler/definition.rb +13 -49
- data/bundler/lib/bundler/dsl.rb +3 -11
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +1 -2
- data/bundler/lib/bundler/installer.rb +4 -4
- data/bundler/lib/bundler/lockfile_parser.rb +2 -20
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -4
- data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -3
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +4 -4
- data/bundler/lib/bundler/man/bundle-update.1.ronn +3 -3
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +1 -1
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/source/rubygems.rb +1 -14
- data/bundler/lib/bundler/source_list.rb +36 -19
- data/bundler/lib/bundler/spec_set.rb +2 -6
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/commands/cert_command.rb +42 -38
- data/lib/rubygems/gemcutter_utilities.rb +10 -3
- data/lib/rubygems/specification.rb +6 -2
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/test_gem_ext_rake_builder.rb +2 -0
- data/test/rubygems/test_gem_gemcutter_utilities.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52d933727e75e688a2283b38dfbecc0997bd5ad8ae07735153c8c93fb868d1c2
|
4
|
+
data.tar.gz: 932932f5c5ef970bbd45d918985cccab896094ab07b20e75665270a92a8f72fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c362d63f528942ce0ef7fbc2f70bd48c640eff9a2237a223cd6e1fc1144760b0727dd45bf71655e2d67791dc4f4220dfae3a7ff936079cd6ebd12e800ef43312
|
7
|
+
data.tar.gz: 5ceeb69663855c94864fad8a2ff609d1bd9307c946dcac81227eb6d537986faf326925118ab4c8692b435b15f8b05e63d3d859beb485a150e8069bb4e232f2c2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 3.2.22 / 2021-07-06
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
* Allow setting `--otp` via `GEM_HOST_OTP_CODE`. Pull request #4697 by
|
6
|
+
CGA1123
|
7
|
+
* Fixes for the edge case when openssl library is missing. Pull request
|
8
|
+
#4695 by rhenium
|
9
|
+
|
1
10
|
# 3.2.21 / 2021-06-23
|
2
11
|
|
3
12
|
## Enhancements:
|
data/bundler/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# 2.2.22 (July 6, 2021)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Never downgrade indirect dependencies when running `bundle update` [#4713](https://github.com/rubygems/rubygems/pull/4713)
|
6
|
+
- Fix `getaddrinfo` errors not treated as fatal on non darwin platforms [#4703](https://github.com/rubygems/rubygems/pull/4703)
|
7
|
+
|
8
|
+
## Bug fixes:
|
9
|
+
|
10
|
+
- Fix `bundle update <gem>` sometimes hanging and `bundle lock --update` not being able to update an insecure lockfile to the new format if it requires downgrades [#4652](https://github.com/rubygems/rubygems/pull/4652)
|
11
|
+
- Fix edge case combination of DSL methods and duplicated sources causing gems to not be found [#4711](https://github.com/rubygems/rubygems/pull/4711)
|
12
|
+
- Fix `bundle doctor` crashing when finding a broken symlink [#4707](https://github.com/rubygems/rubygems/pull/4707)
|
13
|
+
- Fix incorrect re-resolve edge case [#4700](https://github.com/rubygems/rubygems/pull/4700)
|
14
|
+
- Fix some gems being unintentionally locked under multiple lockfile sections [#4701](https://github.com/rubygems/rubygems/pull/4701)
|
15
|
+
- Fix `--conservative` flag unexpectedly updating indirect dependencies [#4692](https://github.com/rubygems/rubygems/pull/4692)
|
16
|
+
|
1
17
|
# 2.2.21 (June 23, 2021)
|
2
18
|
|
3
19
|
## Security fixes:
|
@@ -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 = "2021-06
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2021-07-06".freeze
|
8
|
+
@git_commit_sha = "0bdd3e8e71".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
@@ -100,8 +100,11 @@ module Bundler
|
|
100
100
|
files_not_readable_or_writable = []
|
101
101
|
files_not_rw_and_owned_by_different_user = []
|
102
102
|
files_not_owned_by_current_user_but_still_rw = []
|
103
|
+
broken_symlinks = []
|
103
104
|
Find.find(Bundler.bundle_path.to_s).each do |f|
|
104
|
-
if !File.
|
105
|
+
if !File.exist?(f)
|
106
|
+
broken_symlinks << f
|
107
|
+
elsif !File.writable?(f) || !File.readable?(f)
|
105
108
|
if File.stat(f).uid != Process.uid
|
106
109
|
files_not_rw_and_owned_by_different_user << f
|
107
110
|
else
|
@@ -113,6 +116,13 @@ module Bundler
|
|
113
116
|
end
|
114
117
|
|
115
118
|
ok = true
|
119
|
+
|
120
|
+
if broken_symlinks.any?
|
121
|
+
Bundler.ui.warn "Broken links exist in the Bundler home. Please report them to the offending gem's upstream repo. These files are:\n - #{broken_symlinks.join("\n - ")}"
|
122
|
+
|
123
|
+
ok = false
|
124
|
+
end
|
125
|
+
|
116
126
|
if files_not_owned_by_current_user_but_still_rw.any?
|
117
127
|
Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
|
118
128
|
"user, but are still readable/writable. These files are:\n - #{files_not_owned_by_current_user_but_still_rw.join("\n - ")}"
|
@@ -104,7 +104,7 @@ module Bundler
|
|
104
104
|
private
|
105
105
|
|
106
106
|
def warn_if_root
|
107
|
-
return if Bundler.settings[:silence_root_warning] ||
|
107
|
+
return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
|
108
108
|
Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
|
109
109
|
"if it is needed, and installing your bundle as root will break this " \
|
110
110
|
"application for all non-root users on this machine.", :wrap => true
|
@@ -21,9 +21,13 @@ module Bundler
|
|
21
21
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
22
22
|
|
23
23
|
update = options[:update]
|
24
|
+
conservative = options[:conservative]
|
25
|
+
|
24
26
|
if update.is_a?(Array) # unlocking specific gems
|
25
27
|
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
|
26
|
-
update = { :gems => update, :
|
28
|
+
update = { :gems => update, :conservative => conservative }
|
29
|
+
elsif update
|
30
|
+
update = { :conservative => conservative } if conservative
|
27
31
|
end
|
28
32
|
definition = Bundler.definition(update)
|
29
33
|
|
@@ -27,9 +27,14 @@ module Bundler
|
|
27
27
|
raise InvalidOption, "Cannot specify --all along with specific options."
|
28
28
|
end
|
29
29
|
|
30
|
+
conservative = options[:conservative]
|
31
|
+
|
30
32
|
if full_update
|
31
|
-
|
32
|
-
|
33
|
+
if conservative
|
34
|
+
Bundler.definition(:conservative => conservative)
|
35
|
+
else
|
36
|
+
Bundler.definition(true)
|
37
|
+
end
|
33
38
|
else
|
34
39
|
unless Bundler.default_lockfile.exist?
|
35
40
|
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
@@ -43,7 +48,7 @@ module Bundler
|
|
43
48
|
end
|
44
49
|
|
45
50
|
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
|
46
|
-
:
|
51
|
+
:conservative => conservative,
|
47
52
|
:bundler => options[:bundler])
|
48
53
|
end
|
49
54
|
|
@@ -65,19 +65,19 @@ module Bundler
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def mswin?
|
68
|
-
|
68
|
+
Gem.win_platform?
|
69
69
|
end
|
70
70
|
|
71
71
|
def mswin64?
|
72
|
-
|
72
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
|
73
73
|
end
|
74
74
|
|
75
75
|
def mingw?
|
76
|
-
|
76
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
|
77
77
|
end
|
78
78
|
|
79
79
|
def x64_mingw?
|
80
|
-
|
80
|
+
Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
|
81
81
|
end
|
82
82
|
|
83
83
|
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
|
@@ -56,10 +56,8 @@ module Bundler
|
|
56
56
|
@unlocking_bundler = false
|
57
57
|
@unlocking = unlock
|
58
58
|
else
|
59
|
-
unlock = unlock.dup
|
60
59
|
@unlocking_bundler = unlock.delete(:bundler)
|
61
|
-
unlock.
|
62
|
-
@unlocking = !unlock.empty?
|
60
|
+
@unlocking = unlock.any? {|_k, v| !Array(v).empty? }
|
63
61
|
end
|
64
62
|
|
65
63
|
@dependencies = dependencies
|
@@ -106,8 +104,8 @@ module Bundler
|
|
106
104
|
@locked_platforms = []
|
107
105
|
end
|
108
106
|
|
109
|
-
|
110
|
-
@multisource_allowed =
|
107
|
+
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
|
108
|
+
@multisource_allowed = locked_gem_sources.size == 1 && locked_gem_sources.first.multiple_remotes? && Bundler.frozen_bundle?
|
111
109
|
|
112
110
|
if @multisource_allowed
|
113
111
|
unless sources.aggregate_global_source?
|
@@ -116,10 +114,9 @@ module Bundler
|
|
116
114
|
Bundler::SharedHelpers.major_deprecation 2, msg
|
117
115
|
end
|
118
116
|
|
119
|
-
@sources.merged_gem_lockfile_sections!
|
117
|
+
@sources.merged_gem_lockfile_sections!(locked_gem_sources.first)
|
120
118
|
end
|
121
119
|
|
122
|
-
@unlock[:gems] ||= []
|
123
120
|
@unlock[:sources] ||= []
|
124
121
|
@unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
|
125
122
|
@ruby_version.diff(locked_ruby_version_object)
|
@@ -132,8 +129,10 @@ module Bundler
|
|
132
129
|
@path_changes = converge_paths
|
133
130
|
@source_changes = converge_sources
|
134
131
|
|
135
|
-
|
136
|
-
|
132
|
+
if @unlock[:conservative]
|
133
|
+
@unlock[:gems] ||= @dependencies.map(&:name)
|
134
|
+
else
|
135
|
+
eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
|
137
136
|
@unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
|
138
137
|
end
|
139
138
|
|
@@ -257,7 +256,7 @@ module Bundler
|
|
257
256
|
|
258
257
|
def specs_for(groups)
|
259
258
|
deps = dependencies_for(groups)
|
260
|
-
specs.for(expand_dependencies(deps))
|
259
|
+
SpecSet.new(specs.for(expand_dependencies(deps)))
|
261
260
|
end
|
262
261
|
|
263
262
|
def dependencies_for(groups)
|
@@ -498,9 +497,6 @@ module Bundler
|
|
498
497
|
attr_reader :sources
|
499
498
|
private :sources
|
500
499
|
|
501
|
-
attr_reader :locked_gem_sources
|
502
|
-
private :locked_gem_sources
|
503
|
-
|
504
500
|
def nothing_changed?
|
505
501
|
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
|
506
502
|
end
|
@@ -628,35 +624,11 @@ module Bundler
|
|
628
624
|
end
|
629
625
|
end
|
630
626
|
|
631
|
-
def converge_rubygems_sources
|
632
|
-
return false unless multisource_allowed?
|
633
|
-
|
634
|
-
return false if locked_gem_sources.empty?
|
635
|
-
|
636
|
-
# Get the RubyGems remotes from the Gemfile
|
637
|
-
actual_remotes = sources.rubygems_remotes
|
638
|
-
return false if actual_remotes.empty?
|
639
|
-
|
640
|
-
changes = false
|
641
|
-
|
642
|
-
# If there is a RubyGems source in both
|
643
|
-
locked_gem_sources.each do |locked_gem_source|
|
644
|
-
# Merge the remotes from the Gemfile into the Gemfile.lock
|
645
|
-
changes |= locked_gem_source.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
|
646
|
-
end
|
647
|
-
|
648
|
-
changes
|
649
|
-
end
|
650
|
-
|
651
627
|
def converge_sources
|
652
|
-
changes = false
|
653
|
-
|
654
|
-
changes |= converge_rubygems_sources
|
655
|
-
|
656
628
|
# Replace the sources from the Gemfile with the sources from the Gemfile.lock,
|
657
629
|
# if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
|
658
630
|
# source in the Gemfile.lock, use the one from the Gemfile.
|
659
|
-
changes
|
631
|
+
changes = sources.replace_sources!(@locked_sources)
|
660
632
|
|
661
633
|
sources.all_sources.each do |source|
|
662
634
|
# If the source is unlockable and the current command allows an unlock of
|
@@ -741,8 +713,6 @@ module Bundler
|
|
741
713
|
end
|
742
714
|
end
|
743
715
|
|
744
|
-
unlock_source_unlocks_spec = Bundler.feature_flag.unlock_source_unlocks_spec?
|
745
|
-
|
746
716
|
converged = []
|
747
717
|
@locked_specs.each do |s|
|
748
718
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
@@ -754,11 +724,6 @@ module Bundler
|
|
754
724
|
next if s.source.nil?
|
755
725
|
next if @unlock[:sources].include?(s.source.name)
|
756
726
|
|
757
|
-
# XXX This is a backwards-compatibility fix to preserve the ability to
|
758
|
-
# unlock a single gem by passing its name via `--source`. See issue #3759
|
759
|
-
# TODO: delete in Bundler 2
|
760
|
-
next if unlock_source_unlocks_spec && @unlock[:sources].include?(s.name)
|
761
|
-
|
762
727
|
# If the spec is from a path source and it doesn't exist anymore
|
763
728
|
# then we unlock it.
|
764
729
|
|
@@ -790,7 +755,7 @@ module Bundler
|
|
790
755
|
|
791
756
|
resolve = SpecSet.new(converged)
|
792
757
|
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), @unlock[:gems], true, true)
|
793
|
-
resolve = resolve.for(expand_dependencies(deps, true),
|
758
|
+
resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), [], false, false, false).reject{|s| @unlock[:gems].include?(s.name) })
|
794
759
|
diff = nil
|
795
760
|
|
796
761
|
# Now, we unlock any sources that do not have anymore gems pinned to it
|
@@ -912,14 +877,13 @@ module Bundler
|
|
912
877
|
end
|
913
878
|
|
914
879
|
def additional_base_requirements_for_resolve
|
915
|
-
return [] unless @locked_gems
|
880
|
+
return [] unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
|
916
881
|
dependencies_by_name = dependencies.inject({}) {|memo, dep| memo.update(dep.name => dep) }
|
917
882
|
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
|
918
883
|
name = locked_spec.name
|
919
884
|
dependency = dependencies_by_name[name]
|
920
|
-
next requirements unless dependency
|
921
885
|
next requirements if @locked_gems.dependencies[name] != dependency
|
922
|
-
next requirements if dependency.source.is_a?(Source::Path)
|
886
|
+
next requirements if dependency && dependency.source.is_a?(Source::Path)
|
923
887
|
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
924
888
|
requirements[name] = DepProxy.get_proxy(dep, locked_spec.platform)
|
925
889
|
requirements
|
data/bundler/lib/bundler/dsl.rb
CHANGED
@@ -24,9 +24,6 @@ module Bundler
|
|
24
24
|
def initialize
|
25
25
|
@source = nil
|
26
26
|
@sources = SourceList.new
|
27
|
-
|
28
|
-
@global_rubygems_sources = []
|
29
|
-
|
30
27
|
@git_sources = {}
|
31
28
|
@dependencies = []
|
32
29
|
@groups = []
|
@@ -48,7 +45,6 @@ module Bundler
|
|
48
45
|
@gemfiles << expanded_gemfile_path
|
49
46
|
contents ||= Bundler.read_file(@gemfile.to_s)
|
50
47
|
instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
|
51
|
-
check_primary_source_safety
|
52
48
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
53
49
|
message = "There was an error " \
|
54
50
|
"#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \
|
@@ -168,7 +164,7 @@ module Bundler
|
|
168
164
|
elsif block_given?
|
169
165
|
with_source(@sources.add_rubygems_source("remotes" => source), &blk)
|
170
166
|
else
|
171
|
-
@
|
167
|
+
@sources.add_global_rubygems_remote(source)
|
172
168
|
end
|
173
169
|
end
|
174
170
|
|
@@ -222,6 +218,7 @@ module Bundler
|
|
222
218
|
end
|
223
219
|
|
224
220
|
def to_definition(lockfile, unlock)
|
221
|
+
check_primary_source_safety
|
225
222
|
Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
|
226
223
|
end
|
227
224
|
|
@@ -453,12 +450,7 @@ repo_name ||= user_name
|
|
453
450
|
end
|
454
451
|
|
455
452
|
def check_rubygems_source_safety
|
456
|
-
|
457
|
-
return if @global_rubygems_sources.empty?
|
458
|
-
|
459
|
-
@global_rubygems_sources.each do |source|
|
460
|
-
@sources.add_rubygems_remote(source)
|
461
|
-
end
|
453
|
+
return unless @sources.aggregate_global_source?
|
462
454
|
|
463
455
|
if Bundler.feature_flag.bundler_3_mode?
|
464
456
|
msg = "This Gemfile contains multiple primary sources. " \
|
@@ -38,7 +38,6 @@ module Bundler
|
|
38
38
|
settings_flag(:print_only_version_number) { bundler_3_mode? }
|
39
39
|
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
|
40
40
|
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
|
41
|
-
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
|
42
41
|
settings_flag(:update_requires_all_flag) { bundler_4_mode? }
|
43
42
|
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
|
44
43
|
|
@@ -68,8 +68,7 @@ module Bundler
|
|
68
68
|
raise CertificateFailureError.new(uri)
|
69
69
|
rescue *HTTP_ERRORS => e
|
70
70
|
Bundler.ui.trace e
|
71
|
-
|
72
|
-
when /host down:/, /getaddrinfo: nodename nor servname provided/
|
71
|
+
if e.is_a?(SocketError) || e.message =~ /host down:/
|
73
72
|
raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
|
74
73
|
"connection and try again."
|
75
74
|
else
|
@@ -135,7 +135,7 @@ module Bundler
|
|
135
135
|
next
|
136
136
|
end
|
137
137
|
|
138
|
-
mode =
|
138
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
139
139
|
require "erb"
|
140
140
|
content = if RUBY_VERSION >= "2.6"
|
141
141
|
ERB.new(template, :trim_mode => "-").result(binding)
|
@@ -144,7 +144,7 @@ module Bundler
|
|
144
144
|
end
|
145
145
|
|
146
146
|
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
|
147
|
-
if
|
147
|
+
if Gem.win_platform? || options[:all_platforms]
|
148
148
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
149
149
|
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
|
150
150
|
end
|
@@ -182,7 +182,7 @@ module Bundler
|
|
182
182
|
executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
|
183
183
|
executable_path = executable_path
|
184
184
|
|
185
|
-
mode =
|
185
|
+
mode = Gem.win_platform? ? "wb:UTF-8" : "w"
|
186
186
|
require "erb"
|
187
187
|
content = if RUBY_VERSION >= "2.6"
|
188
188
|
ERB.new(template, :trim_mode => "-").result(binding)
|
@@ -191,7 +191,7 @@ module Bundler
|
|
191
191
|
end
|
192
192
|
|
193
193
|
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
|
194
|
-
if
|
194
|
+
if Gem.win_platform? || options[:all_platforms]
|
195
195
|
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
|
196
196
|
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
|
197
197
|
end
|
@@ -1,16 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#--
|
4
|
-
# Some versions of the Bundler 1.1 RC series introduced corrupted
|
5
|
-
# lockfiles. There were two major problems:
|
6
|
-
#
|
7
|
-
# * multiple copies of the same GIT section appeared in the lockfile
|
8
|
-
# * when this happened, those sections got multiple copies of gems
|
9
|
-
# in those sections.
|
10
|
-
#
|
11
|
-
# As a result, Bundler 1.1 contains code that fixes the earlier
|
12
|
-
# corruption. We will remove this fix-up code in Bundler 1.2.
|
13
|
-
|
14
3
|
module Bundler
|
15
4
|
class LockfileParser
|
16
5
|
attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
|
@@ -124,12 +113,7 @@ module Bundler
|
|
124
113
|
@sources << @current_source
|
125
114
|
when GIT
|
126
115
|
@current_source = TYPES[@type].from_lock(@opts)
|
127
|
-
|
128
|
-
if @sources.include?(@current_source)
|
129
|
-
@current_source = @sources.find {|s| s == @current_source }
|
130
|
-
else
|
131
|
-
@sources << @current_source
|
132
|
-
end
|
116
|
+
@sources << @current_source
|
133
117
|
when GEM
|
134
118
|
@opts["remotes"] = Array(@opts.delete("remote")).reverse
|
135
119
|
@current_source = TYPES[@type].from_lock(@opts)
|
@@ -212,9 +196,7 @@ module Bundler
|
|
212
196
|
@current_spec = LazySpecification.new(name, version, platform)
|
213
197
|
@current_spec.source = @current_source
|
214
198
|
|
215
|
-
|
216
|
-
# duplicate GIT sections)
|
217
|
-
@specs[@current_spec.identifier] ||= @current_spec
|
199
|
+
@specs[@current_spec.identifier] = @current_spec
|
218
200
|
elsif spaces.size == 6
|
219
201
|
version = version.split(",").map(&:strip) if version
|
220
202
|
dep = Gem::Dependency.new(name, version)
|