bundler 0.9.23 → 0.9.24
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.
- data/CHANGELOG.md +19 -0
- data/lib/bundler.rb +25 -22
- data/lib/bundler/dependency.rb +1 -0
- data/lib/bundler/resolver.rb +9 -2
- data/lib/bundler/rubygems_ext.rb +7 -1
- data/lib/bundler/runtime.rb +3 -5
- data/lib/bundler/setup.rb +1 -0
- data/lib/bundler/source.rb +18 -1
- data/lib/bundler/templates/environment.erb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
## 0.9.24 (April 22, 2010)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- fetch submodules for git sources
|
6
|
+
- limit the bundled version of bundler to the same as the one installing
|
7
|
+
- force relative paths in git gemspecs to avoid raising Gem::NameTooLong
|
8
|
+
- serialize GemCache sources correctly, so locking works
|
9
|
+
- raise Bundler::GemNotFound instead of calling exit! inside library code
|
10
|
+
- Rubygems 1.3.5 compatibility for the adventurous, not supported by me :)
|
11
|
+
|
12
|
+
Bugfixes:
|
13
|
+
|
14
|
+
- don't try to regenerate environment.rb if it is read-only
|
15
|
+
- prune outdated gems with the platform "ruby"
|
16
|
+
- prune cache without errors when there are directories or non-gem files
|
17
|
+
- don't re-write environment.rb if running after it has been loaded
|
18
|
+
- do not monkeypatch Specification#load_paths twice when inside a bundle
|
19
|
+
|
1
20
|
## 0.9.23 (April 20, 2010)
|
2
21
|
|
3
22
|
Bugfixes:
|
data/lib/bundler.rb
CHANGED
@@ -5,8 +5,6 @@ require 'bundler/rubygems_ext'
|
|
5
5
|
require 'bundler/version'
|
6
6
|
|
7
7
|
module Bundler
|
8
|
-
ORIGINAL_ENV = ENV.to_hash
|
9
|
-
|
10
8
|
autoload :Definition, 'bundler/definition'
|
11
9
|
autoload :Dependency, 'bundler/dependency'
|
12
10
|
autoload :Dsl, 'bundler/dsl'
|
@@ -23,6 +21,9 @@ module Bundler
|
|
23
21
|
autoload :Specification, 'bundler/shared_helpers'
|
24
22
|
autoload :UI, 'bundler/ui'
|
25
23
|
|
24
|
+
GEM_LOADED = true
|
25
|
+
ORIGINAL_ENV = ENV.to_hash
|
26
|
+
|
26
27
|
class BundlerError < StandardError
|
27
28
|
def self.status_code(code = nil)
|
28
29
|
return @code unless code
|
@@ -70,22 +71,16 @@ module Bundler
|
|
70
71
|
def gem_setup(*groups)
|
71
72
|
return @setup if @setup
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
unloaded.any? ? load.setup(*unloaded) : load
|
84
|
-
end
|
85
|
-
rescue Bundler::GemNotFound => e
|
86
|
-
STDERR.puts e.message
|
87
|
-
STDERR.puts "Try running `bundle install`."
|
88
|
-
exit!
|
74
|
+
if groups.empty?
|
75
|
+
# Load all groups, but only once
|
76
|
+
@setup = load.setup
|
77
|
+
else
|
78
|
+
# Figure out which groups haven't been loaded yet
|
79
|
+
unloaded = groups - (@completed_groups || [])
|
80
|
+
# Record groups that are now loaded
|
81
|
+
@completed_groups = groups | (@completed_groups || [])
|
82
|
+
# Load any groups that are not yet loaded
|
83
|
+
unloaded.any? ? load.setup(*unloaded) : load
|
89
84
|
end
|
90
85
|
end
|
91
86
|
alias setup gem_setup unless defined?(Bundler::ENV_LOADED)
|
@@ -97,8 +92,7 @@ module Bundler
|
|
97
92
|
|
98
93
|
def load
|
99
94
|
@load ||= begin
|
100
|
-
if
|
101
|
-
@gem_loaded = true
|
95
|
+
if !update_env_file?
|
102
96
|
Kernel.require env_file
|
103
97
|
Bundler
|
104
98
|
else
|
@@ -176,8 +170,17 @@ module Bundler
|
|
176
170
|
Gem.clear_paths
|
177
171
|
end
|
178
172
|
|
179
|
-
def
|
180
|
-
env_file.exist?
|
173
|
+
def update_env_file?
|
174
|
+
if env_file.exist?
|
175
|
+
outdated = (env_file.read(100) !~ /Bundler #{Bundler::VERSION}/)
|
176
|
+
writable = env_file.writable?
|
177
|
+
if outdated && !writable
|
178
|
+
STDERR.puts "Cannot write to outdated .bundle/environment.rb to update it"
|
179
|
+
end
|
180
|
+
outdated && writable
|
181
|
+
else
|
182
|
+
true
|
183
|
+
end
|
181
184
|
end
|
182
185
|
end
|
183
186
|
end
|
data/lib/bundler/dependency.rb
CHANGED
data/lib/bundler/resolver.rb
CHANGED
@@ -98,8 +98,15 @@ module Bundler
|
|
98
98
|
debug { "Requirements:\n" + reqs.map { |r| " #{r.name} (#{r.requirement})"}.join("\n") }
|
99
99
|
|
100
100
|
activated = activated.dup
|
101
|
-
|
102
|
-
|
101
|
+
|
102
|
+
if reqs.first.name == "bundler" && !activated["bundler"]
|
103
|
+
# activate the current version of bundler before other versions
|
104
|
+
bundler_version = ENV["BUNDLER_VERSION"] || Bundler::VERSION
|
105
|
+
current = Gem::Dependency.new("bundler", bundler_version, reqs.first.type)
|
106
|
+
else
|
107
|
+
# Pull off the first requirement so that we can resolve it
|
108
|
+
current = reqs.shift
|
109
|
+
end
|
103
110
|
|
104
111
|
debug { "Attempting:\n #{current.name} (#{current.requirement})"}
|
105
112
|
|
data/lib/bundler/rubygems_ext.rb
CHANGED
@@ -10,7 +10,13 @@ module Gem
|
|
10
10
|
attr_accessor :source, :location
|
11
11
|
|
12
12
|
def load_paths
|
13
|
-
require_paths.map
|
13
|
+
require_paths.map do |require_path|
|
14
|
+
if require_path.include?(full_gem_path)
|
15
|
+
require_path
|
16
|
+
else
|
17
|
+
File.join(full_gem_path, require_path)
|
18
|
+
end
|
19
|
+
end
|
14
20
|
end
|
15
21
|
|
16
22
|
def groups
|
data/lib/bundler/runtime.rb
CHANGED
@@ -6,9 +6,7 @@ module Bundler
|
|
6
6
|
|
7
7
|
def initialize(*)
|
8
8
|
super
|
9
|
-
if locked?
|
10
|
-
write_rb_lock
|
11
|
-
end
|
9
|
+
write_rb_lock if locked? && !defined?(Bundler::ENV_LOADED)
|
12
10
|
end
|
13
11
|
|
14
12
|
def setup(*groups)
|
@@ -97,9 +95,9 @@ module Bundler
|
|
97
95
|
FileUtils.mkdir_p(cache_path)
|
98
96
|
|
99
97
|
Bundler.ui.info "Removing outdated .gem files from vendor/cache"
|
100
|
-
cache_path.
|
98
|
+
Pathname.glob(cache_path.join("*.gem")).each do |gem_path|
|
101
99
|
cached_spec = Gem::Format.from_file_by_path(gem_path).spec
|
102
|
-
next unless
|
100
|
+
next unless Gem::Platform.match(cached_spec.platform)
|
103
101
|
unless specs.any?{|s| s.full_name == cached_spec.full_name }
|
104
102
|
Bundler.ui.info " * #{File.basename(gem_path)}"
|
105
103
|
gem_path.rmtree
|
data/lib/bundler/setup.rb
CHANGED
data/lib/bundler/source.rb
CHANGED
@@ -130,7 +130,10 @@ module Bundler
|
|
130
130
|
end
|
131
131
|
|
132
132
|
class GemCache
|
133
|
+
attr_reader :options
|
134
|
+
|
133
135
|
def initialize(options)
|
136
|
+
@options = options
|
134
137
|
@path = options["path"]
|
135
138
|
end
|
136
139
|
|
@@ -251,7 +254,19 @@ module Bundler
|
|
251
254
|
private
|
252
255
|
|
253
256
|
def generate_bin(spec)
|
254
|
-
gem_dir = spec.full_gem_path
|
257
|
+
gem_dir = Pathname.new(spec.full_gem_path)
|
258
|
+
|
259
|
+
# Some gem authors put absolute paths in their gemspec
|
260
|
+
# and we have to save them from themselves
|
261
|
+
spec.files = spec.files.map do |p|
|
262
|
+
next if File.directory?(p)
|
263
|
+
begin
|
264
|
+
Pathname.new(p).relative_path_from(gem_dir).to_s
|
265
|
+
rescue ArgumentError
|
266
|
+
p
|
267
|
+
end
|
268
|
+
end.compact
|
269
|
+
|
255
270
|
gem_file = Dir.chdir(gem_dir){ Gem::Builder.new(spec).build }
|
256
271
|
|
257
272
|
installer = Gem::Installer.new File.join(gem_dir, gem_file),
|
@@ -380,6 +395,8 @@ module Bundler
|
|
380
395
|
Dir.chdir(path) do
|
381
396
|
git "fetch --force --quiet"
|
382
397
|
git "reset --hard #{revision}"
|
398
|
+
git "submodule init"
|
399
|
+
git "submodule update"
|
383
400
|
end
|
384
401
|
end
|
385
402
|
|
data/lib/bundler/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 24
|
9
|
+
version: 0.9.24
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Carl Lerche
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-04-
|
19
|
+
date: 2010-04-22 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|