From 26f8fb8641ee20fbda459755777acff93f3f5416 Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Wed, 20 Nov 2013 22:48:08 +0530 Subject: Add positional information to eval call so that this information will be used in printing correct location where the exception occurred. Closes #12885 - Without this the location of exception is always the line on which 'eval' is called - But if the exception occurs in a gem outside of Rails, then that location is not printed in stacktrace --- railties/lib/rails/commands/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/commands') diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 2b77d5d387..dd2ee5639e 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -50,5 +50,5 @@ elsif File.exist?(code_or_file) $0 = code_or_file Kernel.load code_or_file else - eval(code_or_file) + eval(code_or_file, binding, __FILE__, __LINE__) end -- cgit v1.2.3