Created
November 28, 2012 11:54
-
-
Save foeken/4160705 to your computer and use it in GitHub Desktop.
RubyMotion Bug in Module ordering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take the following setup, this works if everything is inside a single file. | |
# app/foo/monkey.rb | |
module Foo | |
module Monkey | |
puts "Monkey" | |
end | |
end | |
# app/foo/nut.rb | |
module Foo | |
class Nut | |
puts "Nut" | |
end | |
end | |
# app/foo.rb | |
module Foo | |
puts "Foo" | |
end | |
# app/bar.rb | |
class Bar | |
include Foo | |
include Foo::Monkey | |
def initialize | |
Foo::Nut.new | |
end | |
end | |
# Now when we split up each part into different files, it no longer works. Unless you force the Bar file to be last (by changing the filename to z_bar.rb or something) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment