diff options
author | Carl Lerche <carllerche@mac.com> | 2010-04-23 15:11:21 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-04-23 15:11:21 -0700 |
commit | 99063561890130c32f049d7e99da555cfeedde22 (patch) | |
tree | 2fa1adc21bf3efb7d10151c7e621df418cb2029a /lib | |
parent | c5cd2cac3ee0598ffc0e7a080569745ae2c1c2b6 (diff) | |
download | bundler-99063561890130c32f049d7e99da555cfeedde22.tar.gz |
The environment.rb template is not needed anymore.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/templates/environment.erb | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/lib/bundler/templates/environment.erb b/lib/bundler/templates/environment.erb deleted file mode 100644 index 68dffd86..00000000 --- a/lib/bundler/templates/environment.erb +++ /dev/null @@ -1,89 +0,0 @@ -# DO NOT MODIFY THIS FILE -# Generated by Bundler <%= Bundler::VERSION %> - -require 'digest/sha1' -require 'yaml' -<%= shared_helpers %> - -module Bundler - LOCKED_BY = '<%= Bundler::VERSION %>' - FINGERPRINT = <%= gemfile_fingerprint.inspect %> - HOME = '<%= Bundler.home %>' - AUTOREQUIRES = <%= autorequires_for_groups.inspect %> - SPECS = [ - <% specs_for_lock_file.each do |spec| -%> - <%= spec.inspect %>, - <% end -%> - ].map do |hash| - if hash[:virtual_spec] - spec = eval(hash[:virtual_spec], TOPLEVEL_BINDING, "<virtual spec for '#{hash[:name]}'>") - else - dir = File.dirname(hash[:loaded_from]) - spec = Dir.chdir(dir){ eval(File.read(hash[:loaded_from]), TOPLEVEL_BINDING, hash[:loaded_from]) } - end - spec.loaded_from = hash[:loaded_from] - spec.require_paths = hash[:load_paths] - if spec.loaded_from.include?(HOME) - Bundler::Specification.from_gemspec(spec) - else - spec - end - end - - extend SharedHelpers - - def self.configure_gem_path_and_home(specs) - # Fix paths, so that Gem.source_index and such will work - paths = specs.map{|s| s.installation_path } - paths.flatten!; paths.compact!; paths.uniq!; paths.reject!{|p| p.empty? } - ENV['GEM_PATH'] = paths.join(File::PATH_SEPARATOR) - ENV['GEM_HOME'] = paths.first - Gem.clear_paths - end - - def self.match_fingerprint - lockfile = File.expand_path('../../Gemfile.lock', __FILE__) - lock_print = YAML.load(File.read(lockfile))["hash"] if File.exist?(lockfile) - gem_print = Digest::SHA1.hexdigest(File.read(File.expand_path('../../Gemfile', __FILE__))) - - unless gem_print == lock_print - abort 'Gemfile changed since you last locked. Please run `bundle lock` to relock.' - end - - unless gem_print == FINGERPRINT - abort 'Your bundled environment is out of date. Run `bundle install` to regenerate it.' - end - end - - def self.setup(*groups) - clean_load_path - cripple_rubygems(SPECS) - configure_gem_path_and_home(SPECS) - SPECS.each do |spec| - Gem.loaded_specs[spec.name] = spec - spec.require_paths.each do |path| - $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path) - end - end - self - end - - def self.require(*groups) - groups = [:default] if groups.empty? - groups.each do |group| - (AUTOREQUIRES[group.to_sym] || []).each do |file, explicit| - if explicit - Kernel.require file - else - begin - Kernel.require file - rescue LoadError - end - end - end - end - end - - # Set up load paths unless this file is being loaded after the Bundler gem - setup unless @gem_loaded -end |