implement Kernel#require_relative #56

wants to merge 1 commit into from

5 participants

MacRuby member

No description provided.

MacRuby member

However, I think rb_current_realfilepath() is not good.
It use backtrace() to get target script path.
I think usually we should not use backtrace().
But, I don't know another way to get target script path :<

MacRuby member

I think the idea here is to do something so that scripts which expect require_relative in Ruby 1.9 don't fail under most cases. That said, I also don't like using backtrace, especially since the current implementation has bugs. The only other thing I can think of is to update the rb_current_realfilepath each time we enter a new file...but I don't have a good idea of how to do that at the moment.


+1 on merge this, if it don't break other specs.

MacRuby member

Walking the C backtrace in rb_current_realfilepath() is a bit fragile. Perhaps there is a better (more robust) way of doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment