Permalink
Browse files

Use Bundler::GEM_LOADED for symmetry with Bundler::ENV_LOADED

  • Loading branch information...
1 parent a797a19 commit b45e010dac5366c02b454436c56df8886f9776e9 @indirect indirect committed Apr 22, 2010
Showing with 5 additions and 4 deletions.
  1. +3 −3 lib/bundler.rb
  2. +1 −0 lib/bundler/setup.rb
  3. +1 −1 lib/bundler/templates/environment.erb
View
@@ -5,8 +5,6 @@
require 'bundler/version'
module Bundler
- ORIGINAL_ENV = ENV.to_hash
-
autoload :Definition, 'bundler/definition'
autoload :Dependency, 'bundler/dependency'
autoload :Dsl, 'bundler/dsl'
@@ -23,6 +21,9 @@ module Bundler
autoload :Specification, 'bundler/shared_helpers'
autoload :UI, 'bundler/ui'
+ GEM_LOADED = true
+ ORIGINAL_ENV = ENV.to_hash
+
class BundlerError < StandardError
def self.status_code(code = nil)
return @code unless code
@@ -92,7 +93,6 @@ def gem_require(*groups)
def load
@load ||= begin
if !update_env_file?
- @gem_loaded = true
Kernel.require env_file
Bundler
else
View
@@ -6,6 +6,7 @@
env_file = Bundler::SharedHelpers.env_file
if env_file.exist?
require env_file
+ Bundler.setup if Bundler::GEM_LOADED
else
require 'bundler'
begin
@@ -87,5 +87,5 @@ module Bundler
end
# Set up load paths unless this file is being loaded after the Bundler gem
- setup unless @gem_loaded
+ setup unless defined?(Bundler::GEM_LOADED)
end

0 comments on commit b45e010

Please sign in to comment.