# 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, "") 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 raise "omg wtf" abort 'Gemfile changed since you last locked. Please `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) match_fingerprint 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