Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
allow gemfile contents to be evaled from a string
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Aug 26, 2012
1 parent cb4926e commit 92a9d2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/bundler/dsl.rb
Expand Up @@ -23,8 +23,9 @@ def initialize
@ruby_version = nil
end

def eval_gemfile(gemfile)
instance_eval(Bundler.read_file(gemfile.to_s), gemfile.to_s, 1)
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")
Expand Down

0 comments on commit 92a9d2c

Please sign in to comment.