bundler 0.9.17 → 0.9.18

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.

@@ -1,3 +1,15 @@
1
+ ## 0.9.18 (April 8, 2010)
2
+
3
+ Features:
4
+
5
+ - console command that runs irb with bundle (and optional group) already loaded
6
+
7
+ Bugfixes:
8
+
9
+ - Bundler.setup now fully disables system gems, even when unlocked (#266, #246)
10
+ - fixes Yard, which found plugins in Gem.source_index that it could not load
11
+ - makes behaviour of `Bundler.require` consistent between locked and unlocked loads
12
+
1
13
  ## 0.9.17 (April 7, 2010)
2
14
 
3
15
  Features:
@@ -66,7 +66,17 @@ module Bundler
66
66
  end
67
67
 
68
68
  def setup(*groups)
69
- load.setup(*groups)
69
+ if groups.empty? || @all_groups_loaded
70
+ # Load all groups, but only once
71
+ @all_groups_loaded ||= load.setup
72
+ else
73
+ # Figure out which groups haven't been loaded yet
74
+ unloaded = groups - (@completed_groups || [])
75
+ # Record groups that are now loaded
76
+ @completed_groups = groups | (@completed_groups || [])
77
+ # Load any groups that are not yet loaded
78
+ unloaded.any? ? load.setup(*unloaded) : load
79
+ end
70
80
  end
71
81
 
72
82
  def require(*groups)
@@ -74,17 +84,19 @@ module Bundler
74
84
  end
75
85
 
76
86
  def load
77
- if current_env_file?
78
- SharedHelpers.gem_loaded = true
79
- Kernel.require env_file
80
- Bundler
81
- else
82
- runtime
87
+ @load ||= begin
88
+ if current_env_file?
89
+ SharedHelpers.gem_loaded = true
90
+ Kernel.require env_file
91
+ Bundler
92
+ else
93
+ runtime
94
+ end
83
95
  end
84
96
  end
85
97
 
86
98
  def runtime
87
- Runtime.new(root, definition)
99
+ @runtime ||= Runtime.new(root, definition)
88
100
  end
89
101
 
90
102
  def definition
@@ -133,16 +145,16 @@ module Bundler
133
145
  ENV.replace(bundled_env.to_hash)
134
146
  end
135
147
 
136
- private
137
-
138
148
  def default_gemfile
139
149
  SharedHelpers.default_gemfile
140
150
  end
141
151
 
152
+ private
153
+
142
154
  def configure_gem_home_and_path
143
155
  if settings[:disable_shared_gems]
144
- ENV['GEM_HOME'] = File.expand_path(bundle_path, root)
145
156
  ENV['GEM_PATH'] = ''
157
+ ENV['GEM_HOME'] = File.expand_path(bundle_path, root)
146
158
  else
147
159
  paths = [Gem.dir, Gem.path].flatten.compact.uniq.reject{|p| p.empty? }
148
160
  ENV["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
@@ -190,6 +190,16 @@ module Bundler
190
190
  end
191
191
  end
192
192
 
193
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
194
+ def console(group = nil)
195
+ require 'bundler/setup'
196
+ group ? Bundler.require(:default, group) : Bundler.require
197
+ ARGV.clear
198
+
199
+ require 'irb'
200
+ IRB.start
201
+ end
202
+
193
203
  desc "version", "Prints the bundler's version information"
194
204
  def version
195
205
  Bundler.ui.info "Bundler version #{Bundler::VERSION}"
@@ -15,11 +15,10 @@ module Bundler
15
15
  # Has to happen first
16
16
  clean_load_path
17
17
 
18
- unloaded = groups - (@loaded_groups || [])
19
- @loaded_groups = groups | (@loaded_groups || [])
20
- specs = unloaded.any? ? specs_for(unloaded) : requested_specs
18
+ specs = groups.any? ? specs_for(groups) : requested_specs
21
19
 
22
20
  cripple_rubygems(specs)
21
+ replace_rubygems_paths
23
22
 
24
23
  # Activate the specs
25
24
  specs.each do |spec|
@@ -128,5 +127,18 @@ module Bundler
128
127
  end
129
128
  details
130
129
  end
130
+
131
+ def replace_rubygems_paths
132
+ Gem.instance_eval do
133
+ def path
134
+ [Bundler.bundle_path.to_s]
135
+ end
136
+
137
+ def source_index
138
+ @source_index ||= Gem::SourceIndex.from_installed_gems
139
+ end
140
+ end
141
+ end
142
+
131
143
  end
132
144
  end
@@ -72,12 +72,12 @@ module Bundler
72
72
  reverse_rubygems_kernel_mixin
73
73
 
74
74
  executables = specs.map { |s| s.executables }.flatten
75
+ Gem.source_index # ensure RubyGems is fully loaded
75
76
 
76
- :: Kernel.class_eval do
77
+ ::Kernel.class_eval do
77
78
  private
78
79
  def gem(*) ; end
79
80
  end
80
- Gem.source_index # ensure RubyGems is fully loaded
81
81
 
82
82
  ::Kernel.send(:define_method, :gem) do |dep, *reqs|
83
83
  if executables.include? File.basename(caller.first.split(':').first)
@@ -1,3 +1,3 @@
1
1
  module Bundler
2
- VERSION = "0.9.17"
2
+ VERSION = "0.9.18"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 17
9
- version: 0.9.17
8
+ - 18
9
+ version: 0.9.18
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-07 00:00:00 -07:00
19
+ date: 2010-04-08 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency