Include not finding module RubyMotion

混江龙づ霸主 提交于 2019-12-22 08:56:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!