问题
Are mixins allowed in RubyMotion? I have a directory with two files. One is a class, the other a module. When I include the module (mixin) in my class, I get a not found error. Everything under app is automatically required in RM right?
Thanks for any help.
回答1:
Found it! http://dylanmarkow.com/blog/2012/05/06/load-order-with-rubymotion/
回答2:
I'm using Bundler, so I ended up putting something like this in the Motion::Project::App.setup do |app|
block:
app_files = app.files.reverse.pop
app.files << Dir.glob(File.join(app.project_dir, 'lib/**/*.rb')) << app_files
There is definitely a better way to do this.
来源:https://stackoverflow.com/questions/12060309/include-not-finding-module-rubymotion