origin icon indicating copy to clipboard operation
origin copied to clipboard

Add __FILE__, __LINE__ to the class-, module_eval calls

Open Shamaoke opened this issue 11 years ago • 1 comments

Please, add the __FILE__ and __LINE__ constants as the 2nd and 3rd arguments to the class- and module_eval calls in Origin::Forwardable#__forward__ to impove the debugging process.

require 'mongoid'

class Person
  include Mongoid::Document
end

# without __FILE__, __LINE__
Person.method(:where).source_location #=> ["(eval)", 1]

# with __FILE__, __LINE__
Person.method(:where).source_location
#=> ["/home/user/<...>/origin-2.1.1/lib/origin/forwardable.rb", 47]

Shamaoke avatar Jan 28 '15 04:01 Shamaoke

@Shamaoke fell free to send a PR with those changes.. thanks

arthurnn avatar Jan 28 '15 19:01 arthurnn