Closed katsuyoshi closed 6 years ago
Awesome, that's simple enough - I think we could even just remove the lines alias_method :plus_without_duration...
and alias_method :minus_without_duration...
Ah nevermind we do need that line.
I'm pretty sure that this nullifies the purpose of those lines.
alias_method :plus_without_duration, :+
alias_method :+, :plus_with_duration
copies out the original +
method (without duration), then adds the new one in
alias_method :+, :plus_with_duration
alias_method :plus_without_duration, :+
aliases the new method (with duration) then immediately aliases that (still with duration) to the (misleading) name of plus_without_duration
I did not think deeply. I just made it possible to compile.
I think this problem depends on loading file order. Probably calculations.rb is first and date.rb is later loaded. If it's able to control loading order, I think that the source before I changed is compilable.
This is the same issue as https://github.com/rubymotion/motion-support/issues/38
The problem is motion-require and circular dependencies, exacerbated by new way High Sierra sorts files. We had a long discussion about this in the RubyMotion meetup the other night. It seems like motion-require is fighting with RubyMotion's own ability to detect circular dependencies by turning app.detect_dependencies = false
. We had a sort of general consensus that motion-require should be deprecated, and RubyMotion (which already checks for circular dependencies) will start identifying these, so we can fix them.
Since my app is currently broken pending a fix for https://github.com/rubymotion/motion-support/issues/38, I'll take a crack at removing motion-require, and then fixing the load order issues.
In my environment I could build by swapping lines.