class Bundler::Dsl

def eval_gemfile(gemfile, contents = nil)

def eval_gemfile(gemfile, contents = nil)
  contents ||= Bundler.read_file(gemfile.to_s)
  instance_eval(contents, gemfile.to_s, 1)
rescue SyntaxError => e
  bt = e.message.split("\n")[1..-1]
  raise GemfileError, ["Gemfile syntax error:", *bt].join("\n")
rescue ScriptError, RegexpError, NameError, ArgumentError => e
  e.backtrace[0] = "#{e.backtrace[0]}: #{e.message} (#{e.class})"
  Bundler.ui.warn e.backtrace.join("\n       ")
  raise GemfileError, "There was an error in your Gemfile," \
    " and Bundler cannot continue."
end