Mastodon

Using 3rd party ruby library in RubyMotion

Update: Check the post Create gems for RubyMotion on example to create a gem for rubymotion.

These few days I have been playing with RubyMotion.

They have documents on using Objective-C libraries. So using familiar library such as TouchJSON is not an issue.

How about using Ruby library such as BubbleWrap? There are no documents on how to include and write gems in your project yet. Before it is ready, you can do this:

Add the library as git submodule:

git submodule add https://github.com/mattetti/BubbleWrap.git vendor/BubbleWrap

Add the path to the library sources to your project 'Rakefile'

Motion::Project::App.setup do |app|
  app.name = 'myapp'
  app.files += Dir.glob(File.join(app.project_dir, 'vendor/BubbleWrap/lib/**/*.rb'))
end

Thats it!