4

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.

Cocoa Nub
  • 489
  • 7
  • 20

2 Answers2

3

Found it! http://dylanmarkow.com/blog/2012/05/06/load-order-with-rubymotion/

Cocoa Nub
  • 489
  • 7
  • 20
1

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.

Fudgie
  • 413
  • 3
  • 12