# DO NOT MODIFY THIS FILE module Bundler file = File.expand_path(__FILE__) dir = File.dirname(file) ENV["GEM_HOME"] = dir ENV["GEM_PATH"] = dir ENV["PATH"] = "#{dir}/../../bin:#{ENV["PATH"]}" ENV["RUBYOPT"] = "-r#{file} #{ENV["RUBYOPT"]}" $LOAD_PATH.unshift File.expand_path("#{dir}/gems/ruby-debug-0.10.3/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/ruby-debug-0.10.3/cli") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/term-ansicolor-1.0.4/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/term-ansicolor-1.0.4/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/columnize-0.3.1/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/columnize-0.3.1/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/diff-lcs-1.1.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/diff-lcs-1.1.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/polyglot-0.2.9/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/polyglot-0.2.9/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rackjour-0.1.5/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rackjour-0.1.5/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/treetop-1.4.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/treetop-1.4.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rspec-1.2.9/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rspec-1.2.9/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-1.0.1/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-1.0.1/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/dnssd-1.3.1/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/dnssd-1.3.1/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/dnssd-1.3.1/ext") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/linecache-0.43/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/linecache-0.43/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/cucumber-0.4.4/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/cucumber-0.4.4/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/builder-2.1.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/builder-2.1.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/ruby-debug-base-0.10.3/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/ruby-debug-base-0.10.3/lib") @gemfile = "#{dir}/../../Gemfile" require "rubygems" @bundled_specs = {} @bundled_specs["term-ansicolor"] = eval(File.read("#{dir}/specifications/term-ansicolor-1.0.4.gemspec")) @bundled_specs["term-ansicolor"].loaded_from = "#{dir}/specifications/term-ansicolor-1.0.4.gemspec" @bundled_specs["ruby-debug"] = eval(File.read("#{dir}/specifications/ruby-debug-0.10.3.gemspec")) @bundled_specs["ruby-debug"].loaded_from = "#{dir}/specifications/ruby-debug-0.10.3.gemspec" @bundled_specs["columnize"] = eval(File.read("#{dir}/specifications/columnize-0.3.1.gemspec")) @bundled_specs["columnize"].loaded_from = "#{dir}/specifications/columnize-0.3.1.gemspec" @bundled_specs["polyglot"] = eval(File.read("#{dir}/specifications/polyglot-0.2.9.gemspec")) @bundled_specs["polyglot"].loaded_from = "#{dir}/specifications/polyglot-0.2.9.gemspec" @bundled_specs["diff-lcs"] = eval(File.read("#{dir}/specifications/diff-lcs-1.1.2.gemspec")) @bundled_specs["diff-lcs"].loaded_from = "#{dir}/specifications/diff-lcs-1.1.2.gemspec" @bundled_specs["treetop"] = eval(File.read("#{dir}/specifications/treetop-1.4.2.gemspec")) @bundled_specs["treetop"].loaded_from = "#{dir}/specifications/treetop-1.4.2.gemspec" @bundled_specs["rackjour"] = eval(File.read("#{dir}/specifications/rackjour-0.1.5.gemspec")) @bundled_specs["rackjour"].loaded_from = "#{dir}/specifications/rackjour-0.1.5.gemspec" @bundled_specs["rspec"] = eval(File.read("#{dir}/specifications/rspec-1.2.9.gemspec")) @bundled_specs["rspec"].loaded_from = "#{dir}/specifications/rspec-1.2.9.gemspec" @bundled_specs["rack"] = eval(File.read("#{dir}/specifications/rack-1.0.1.gemspec")) @bundled_specs["rack"].loaded_from = "#{dir}/specifications/rack-1.0.1.gemspec" @bundled_specs["dnssd"] = eval(File.read("#{dir}/specifications/dnssd-1.3.1.gemspec")) @bundled_specs["dnssd"].loaded_from = "#{dir}/specifications/dnssd-1.3.1.gemspec" @bundled_specs["linecache"] = eval(File.read("#{dir}/specifications/linecache-0.43.gemspec")) @bundled_specs["linecache"].loaded_from = "#{dir}/specifications/linecache-0.43.gemspec" @bundled_specs["cucumber"] = eval(File.read("#{dir}/specifications/cucumber-0.4.4.gemspec")) @bundled_specs["cucumber"].loaded_from = "#{dir}/specifications/cucumber-0.4.4.gemspec" @bundled_specs["builder"] = eval(File.read("#{dir}/specifications/builder-2.1.2.gemspec")) @bundled_specs["builder"].loaded_from = "#{dir}/specifications/builder-2.1.2.gemspec" @bundled_specs["ruby-debug-base"] = eval(File.read("#{dir}/specifications/ruby-debug-base-0.10.3.gemspec")) @bundled_specs["ruby-debug-base"].loaded_from = "#{dir}/specifications/ruby-debug-base-0.10.3.gemspec" def self.add_specs_to_loaded_specs Gem.loaded_specs.merge! @bundled_specs end def self.add_specs_to_index @bundled_specs.each do |name, spec| Gem.source_index.add_spec spec end end add_specs_to_loaded_specs add_specs_to_index def self.require_env(env = nil) context = Class.new do def initialize(env) @env = env && env.to_s ; end def method_missing(*) ; end def only(env) old, @only = @only, _combine_onlys(env) yield @only = old end def except(env) old, @except = @except, _combine_excepts(env) yield @except = old end def gem(name, *args) opt = args.last || {} only = _combine_onlys(opt[:only] || opt["only"]) except = _combine_excepts(opt[:except] || opt["except"]) files = opt[:require_as] || opt["require_as"] || name files = [files] unless files.respond_to?(:each) return unless !only || only.any? {|e| e == @env } return if except && except.any? {|e| e == @env } files.each { |f| require f } yield if block_given? true end private def _combine_onlys(only) return @only unless only only = [only].flatten.compact.uniq.map { |o| o.to_s } only &= @only if @only only end def _combine_excepts(except) return @except unless except except = [except].flatten.compact.uniq.map { |o| o.to_s } except |= @except if @except except end end context.new(env && env.to_s).instance_eval(File.read(@gemfile)) end end module Gem def source_index.refresh! super Bundler.add_specs_to_index end end