diff options
author | Andre Arko <andre@arko.net> | 2010-04-22 08:49:00 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-22 08:59:33 -0700 |
commit | b45e010dac5366c02b454436c56df8886f9776e9 (patch) | |
tree | 6e2f399da2690107f01c213e967a93a7f57c0383 | |
parent | a797a19bd0e0b5c39ad45135ba3dc878f210d871 (diff) | |
download | bundler-b45e010dac5366c02b454436c56df8886f9776e9.tar.gz |
Use Bundler::GEM_LOADED for symmetry with Bundler::ENV_LOADED
-rw-r--r-- | lib/bundler.rb | 6 | ||||
-rw-r--r-- | lib/bundler/setup.rb | 1 | ||||
-rw-r--r-- | lib/bundler/templates/environment.erb | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index eca6c6d483..90cc8ad064 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -5,8 +5,6 @@ require 'bundler/rubygems_ext' 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 @@ module Bundler def load @load ||= begin if !update_env_file? - @gem_loaded = true Kernel.require env_file Bundler else diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index ef3b08ad8f..42e53154e6 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -6,6 +6,7 @@ if Bundler::SharedHelpers.in_bundle? env_file = Bundler::SharedHelpers.env_file if env_file.exist? require env_file + Bundler.setup if Bundler::GEM_LOADED else require 'bundler' begin diff --git a/lib/bundler/templates/environment.erb b/lib/bundler/templates/environment.erb index a905af5900..eeecc378de 100644 --- a/lib/bundler/templates/environment.erb +++ b/lib/bundler/templates/environment.erb @@ -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 |