Skip to content

Instantly share code, notes, and snippets.

@foeken
Created November 28, 2012 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foeken/4160705 to your computer and use it in GitHub Desktop.
Save foeken/4160705 to your computer and use it in GitHub Desktop.
RubyMotion Bug in Module ordering
# 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