bundler 1.6.2 → 1.6.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/bundler/cli/install.rb +1 -1
- data/lib/bundler/cli/open.rb +5 -7
- data/lib/bundler/definition.rb +4 -5
- data/lib/bundler/resolver.rb +14 -9
- data/lib/bundler/source/rubygems.rb +16 -4
- data/lib/bundler/version.rb +1 -1
- data/spec/cache/gems_spec.rb +14 -0
- data/spec/spec_helper.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47d03cb52cb9c56cfb0a8e3ac50050a2dfe2e73e
|
4
|
+
data.tar.gz: 4a1e485a82e9703c83f4eec7fd8b11d36c0aaeef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ff3dd741753285f4f95d1bc62830025f861176f922308b0fdaad31c13bc7661c34a4d3e225045ecafe7725ceaf6d666b16cf68af884b763eb0f70b374826e4
|
7
|
+
data.tar.gz: 7f4850dfe4fabc581ca1a5be0fad0caf357f48c8397a92f5aadcf5537e48ee322248d7c4021cc5cb92c1a124c2c84e1bb3c0f676834c73100ffde153a7c36745
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 1.6.3 (2014-06-16)
|
2
|
+
|
3
|
+
Bugfixes:
|
4
|
+
|
5
|
+
- fix regression when resolving many conflicts (#2994, @Who828)
|
6
|
+
- use local gemspec for builtin gems during install --local (#3041, @Who828)
|
7
|
+
- don't warn about sudo when installing on Windows (#2984, @indirect)
|
8
|
+
- shell escape `bundle open` arguments (@indirect)
|
9
|
+
|
1
10
|
## 1.6.2 (2014-04-13)
|
2
11
|
|
3
12
|
Bugfixes:
|
data/lib/bundler/cli/install.rb
CHANGED
@@ -116,7 +116,7 @@ module Bundler
|
|
116
116
|
private
|
117
117
|
|
118
118
|
def warn_if_root
|
119
|
-
return
|
119
|
+
return if Bundler::WINDOWS || !Process.uid.zero?
|
120
120
|
Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
|
121
121
|
"if it is needed, and installing your bundle as root will break this " \
|
122
122
|
"application for all non-root users on this machine.", :wrap => true
|
data/lib/bundler/cli/open.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'bundler/cli/common'
|
2
|
+
require 'shellwords'
|
2
3
|
|
3
4
|
module Bundler
|
4
5
|
class CLI::Open
|
@@ -11,13 +12,10 @@ module Bundler
|
|
11
12
|
def run
|
12
13
|
editor = [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? }
|
13
14
|
return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
command = "#{editor} #{full_gem_path}"
|
19
|
-
success = system(command)
|
20
|
-
Bundler.ui.info "Could not run '#{command}'" unless success
|
15
|
+
path = Bundler::CLI::Common.select_spec(name, :regex_match).full_gem_path
|
16
|
+
Dir.chdir(path) do
|
17
|
+
command = Shellwords.split(editor) + [path]
|
18
|
+
system(*command) || Bundler.ui.info("Could not run '#{command.join(' ')}'")
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
data/lib/bundler/definition.rb
CHANGED
@@ -412,10 +412,8 @@ module Bundler
|
|
412
412
|
locked = @locked_sources.find(&block)
|
413
413
|
|
414
414
|
if locked
|
415
|
-
unlocking =
|
416
|
-
|
417
|
-
locked_spec.source != locked
|
418
|
-
end
|
415
|
+
unlocking = @locked_specs.any? do |locked_spec|
|
416
|
+
locked_spec.source != locked
|
419
417
|
end
|
420
418
|
end
|
421
419
|
|
@@ -508,8 +506,9 @@ module Bundler
|
|
508
506
|
# and Gemfile.lock. If the Gemfile modified a dependency, but
|
509
507
|
# the gem in the Gemfile.lock still satisfies it, this is fine
|
510
508
|
# too.
|
509
|
+
locked_deps_hash = @locked_deps.inject({}) { |hsh, dep| hsh[dep] = dep; hsh }
|
511
510
|
@dependencies.each do |dep|
|
512
|
-
locked_dep =
|
511
|
+
locked_dep = locked_deps_hash[dep]
|
513
512
|
|
514
513
|
if in_locked_deps?(dep, locked_dep) || satisfies_locked_spec?(dep)
|
515
514
|
deps << dep
|
data/lib/bundler/resolver.rb
CHANGED
@@ -136,7 +136,6 @@ module Bundler
|
|
136
136
|
|
137
137
|
def initialize(index, source_requirements, base)
|
138
138
|
@errors = {}
|
139
|
-
@stack = []
|
140
139
|
@base = base
|
141
140
|
@index = index
|
142
141
|
@deps_for = {}
|
@@ -165,7 +164,7 @@ module Bundler
|
|
165
164
|
resolve(reqs, activated)
|
166
165
|
end
|
167
166
|
|
168
|
-
class State < Struct.new(:reqs, :activated, :requirement, :possibles, :depth)
|
167
|
+
class State < Struct.new(:reqs, :activated, :requirement, :possibles, :depth, :conflicts)
|
169
168
|
def name
|
170
169
|
requirement.name
|
171
170
|
end
|
@@ -226,13 +225,13 @@ module Bundler
|
|
226
225
|
|
227
226
|
def resolve_for_conflict(state)
|
228
227
|
raise version_conflict if state.nil? || state.possibles.empty?
|
229
|
-
reqs, activated, depth = state.reqs.dup, state.activated.dup, state.depth
|
228
|
+
reqs, activated, depth, conflicts = state.reqs.dup, state.activated.dup, state.depth, state.conflicts.dup
|
230
229
|
requirement = state.requirement
|
231
230
|
possible = state.possibles.pop
|
232
231
|
|
233
232
|
activate_gem(reqs, activated, possible, requirement)
|
234
233
|
|
235
|
-
return reqs, activated, depth
|
234
|
+
return reqs, activated, depth, conflicts
|
236
235
|
end
|
237
236
|
|
238
237
|
def resolve_conflict(current, states)
|
@@ -243,18 +242,19 @@ module Bundler
|
|
243
242
|
|
244
243
|
# Resolve the conflicts by rewinding the state
|
245
244
|
# when the conflicted gem was activated
|
246
|
-
reqs, activated, depth = resolve_for_conflict(state)
|
245
|
+
reqs, activated, depth, conflicts = resolve_for_conflict(state)
|
247
246
|
|
248
247
|
# Keep the state around if it still has other possibilities
|
249
248
|
states << state unless state.possibles.empty?
|
250
249
|
clear_search_cache
|
251
250
|
|
252
|
-
return reqs, activated, depth
|
251
|
+
return reqs, activated, depth, conflicts
|
253
252
|
end
|
254
253
|
|
255
254
|
def resolve(reqs, activated)
|
256
255
|
states = []
|
257
256
|
depth = 0
|
257
|
+
conflicts = Set.new
|
258
258
|
|
259
259
|
until reqs.empty?
|
260
260
|
|
@@ -307,6 +307,8 @@ module Bundler
|
|
307
307
|
debug { " * [FAIL] Already activated" }
|
308
308
|
@errors[existing.name] = [existing, current]
|
309
309
|
|
310
|
+
conflicts << current.name
|
311
|
+
|
310
312
|
parent = current.required_by.last
|
311
313
|
if existing.respond_to?(:required_by)
|
312
314
|
parent = handle_conflict(current, states, existing.required_by[-2]) unless other_possible?(parent, states)
|
@@ -314,10 +316,13 @@ module Bundler
|
|
314
316
|
parent = handle_conflict(current, states) unless other_possible?(parent, states)
|
315
317
|
end
|
316
318
|
|
317
|
-
|
319
|
+
if parent.nil? && !conflicts.empty?
|
320
|
+
parent = states.reverse.detect { |i| conflicts.include?(i.name) && state_any?(i)}
|
321
|
+
end
|
318
322
|
|
323
|
+
raise version_conflict if parent.nil? || parent.name == 'bundler'
|
319
324
|
|
320
|
-
reqs, activated, depth = resolve_conflict(parent, states)
|
325
|
+
reqs, activated, depth, conflicts = resolve_conflict(parent, states)
|
321
326
|
end
|
322
327
|
else
|
323
328
|
matching_versions = search(current)
|
@@ -359,7 +364,7 @@ module Bundler
|
|
359
364
|
end
|
360
365
|
end
|
361
366
|
|
362
|
-
state = State.new(reqs.dup, activated.dup, current, matching_versions, depth)
|
367
|
+
state = State.new(reqs.dup, activated.dup, current, matching_versions, depth, conflicts)
|
363
368
|
states << state
|
364
369
|
requirement = state.possibles.pop
|
365
370
|
activate_gem(reqs, activated, requirement, current)
|
@@ -126,8 +126,7 @@ module Bundler
|
|
126
126
|
|
127
127
|
def cache(spec, custom_path = nil)
|
128
128
|
if builtin_gem?(spec)
|
129
|
-
|
130
|
-
cached_path = fetch_gem(remote_spec)
|
129
|
+
cached_path = cached_built_in_gem(spec)
|
131
130
|
else
|
132
131
|
cached_path = cached_gem(spec)
|
133
132
|
end
|
@@ -137,6 +136,15 @@ module Bundler
|
|
137
136
|
FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
|
138
137
|
end
|
139
138
|
|
139
|
+
def cached_built_in_gem(spec)
|
140
|
+
cached_path = cached_path(spec)
|
141
|
+
if cached_path.nil?
|
142
|
+
remote_spec = remote_specs.search(spec).first
|
143
|
+
cached_path = fetch_gem(remote_spec)
|
144
|
+
end
|
145
|
+
cached_path
|
146
|
+
end
|
147
|
+
|
140
148
|
def add_remote(source)
|
141
149
|
@remotes << normalize_uri(source)
|
142
150
|
end
|
@@ -155,14 +163,18 @@ module Bundler
|
|
155
163
|
private
|
156
164
|
|
157
165
|
def cached_gem(spec)
|
158
|
-
|
159
|
-
cached_gem = possibilities.find { |p| File.exist?(p) }
|
166
|
+
cached_gem = cached_path(spec)
|
160
167
|
unless cached_gem
|
161
168
|
raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation"
|
162
169
|
end
|
163
170
|
cached_gem
|
164
171
|
end
|
165
172
|
|
173
|
+
def cached_path(spec)
|
174
|
+
possibilities = @caches.map { |p| "#{p}/#{spec.file_name}" }
|
175
|
+
possibilities.find { |p| File.exist?(p) }
|
176
|
+
end
|
177
|
+
|
166
178
|
def normalize_uri(uri)
|
167
179
|
uri = uri.to_s
|
168
180
|
uri = "#{uri}/" unless uri =~ %r'/$'
|
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.6.
|
5
|
+
VERSION = "1.6.3" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/spec/cache/gems_spec.rb
CHANGED
@@ -103,6 +103,20 @@ describe "bundle cache" do
|
|
103
103
|
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
|
104
104
|
expect(bundled_app("vendor/cache/builtin_gem-1.0.2.gem")).to exist
|
105
105
|
end
|
106
|
+
|
107
|
+
it "doesn't make remote request after caching the gem" do
|
108
|
+
build_gem "builtin_gem_2", "1.0.2", :path => bundled_app('vendor/cache') do |s|
|
109
|
+
s.summary = "This builtin_gem is bundled with Ruby"
|
110
|
+
end
|
111
|
+
|
112
|
+
install_gemfile <<-G
|
113
|
+
source "file://#{gem_repo2}"
|
114
|
+
gem 'builtin_gem_2', '1.0.2'
|
115
|
+
G
|
116
|
+
|
117
|
+
bundle "install --local"
|
118
|
+
should_be_installed("builtin_gem_2 1.0.2")
|
119
|
+
end
|
106
120
|
end
|
107
121
|
|
108
122
|
describe "when there are also git sources" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
$:.unshift File.expand_path('..', __FILE__)
|
2
2
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
-
|
4
|
-
require '
|
3
|
+
# stdlib first
|
4
|
+
require 'uri'
|
5
|
+
require 'digest/sha1'
|
5
6
|
require 'fileutils'
|
7
|
+
require 'bundler/psyched_yaml'
|
6
8
|
require 'rubygems'
|
9
|
+
require 'rspec'
|
7
10
|
require 'bundler'
|
8
|
-
require 'uri'
|
9
|
-
require 'digest/sha1'
|
10
11
|
|
11
12
|
# Require the correct version of popen for the current platform
|
12
13
|
if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: ronn
|