method
eval_gemfile
v2_6_3 -
Show latest stable
-
0 notes -
Class: Dsl
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
eval_gemfile(gemfile, contents = nil)
public
Hide source
# File lib/bundler/dsl.rb, line 41 def eval_gemfile(gemfile, contents = nil) expanded_gemfile_path = Pathname.new(gemfile).expand_path(@gemfile && @gemfile.parent) original_gemfile = @gemfile @gemfile = expanded_gemfile_path @gemfiles << expanded_gemfile_path contents ||= Bundler.read_file(@gemfile.to_s) instance_eval(contents.dup.untaint, gemfile.to_s, 1) rescue Exception => e message = "There was an error " "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " "`#{File.basename gemfile.to_s}`: #{e.message}" raise DSLError.new(message, gemfile, e.backtrace, contents) ensure @gemfile = original_gemfile end