diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-04-09 15:56:50 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-09 21:28:49 +0200 |
commit | 13e00ce6064fd1ce143071e3531e65f64047b013 (patch) | |
tree | 926d6d212b926d84432a71cb73814fe437d42655 /activeresource/lib/active_resource | |
parent | 8b2266a8dada979d72ff6eda4349a24be3b630eb (diff) | |
download | rails-13e00ce6064fd1ce143071e3531e65f64047b013.tar.gz rails-13e00ce6064fd1ce143071e3531e65f64047b013.tar.bz2 rails-13e00ce6064fd1ce143071e3531e65f64047b013.zip |
fix stack trace lines on class_eval
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 4 | ||||
-rw-r--r-- | activeresource/lib/active_resource/http_mock.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 1e81fc099c..1dd5af8098 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -588,11 +588,11 @@ module ActiveResource @prefix_parameters = nil # Redefine the new methods. - code = <<-end_code + code, line = <<-end_code, __LINE__ + 1 def prefix_source() "#{value}" end def prefix(options={}) "#{prefix_call}" end end_code - silence_warnings { instance_eval code, __FILE__, __LINE__ } + silence_warnings { instance_eval code, __FILE__, line } rescue logger.error "Couldn't set prefix: #{$!}\n #{code}" if logger raise diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb index e5891300a6..1ed3804017 100644 --- a/activeresource/lib/active_resource/http_mock.rb +++ b/activeresource/lib/active_resource/http_mock.rb @@ -57,7 +57,7 @@ module ActiveResource # def post(path, request_headers = {}, body = nil, status = 200, response_headers = {}) # @responses[Request.new(:post, path, nil, request_headers)] = Response.new(body || "", status, response_headers) # end - module_eval <<-EOE, __FILE__, __LINE__ + module_eval <<-EOE, __FILE__, __LINE__ + 1 def #{method}(path, request_headers = {}, body = nil, status = 200, response_headers = {}) @responses << [Request.new(:#{method}, path, nil, request_headers), Response.new(body || "", status, response_headers)] end @@ -125,7 +125,7 @@ module ActiveResource # self.class.requests << request # self.class.responses.assoc(request).try(:second) || raise(InvalidRequestError.new("No response recorded for #{request}")) # end - module_eval <<-EOE, __FILE__, __LINE__ + module_eval <<-EOE, __FILE__, __LINE__ + 1 def #{method}(path, #{'body, ' if has_body}headers) request = ActiveResource::Request.new(:#{method}, path, #{has_body ? 'body, ' : 'nil, '}headers) self.class.requests << request |