Sha256: 22fd57554ce22d998ae27202312fd50a81666cabf0ae2b77fd3ee79398af2f3f

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

unless defined?(Motion::Project::Config)
  raise "The joybox gem must be required within a RubyMotion project Rakefile."
end

# Extracted from Teacup: https://github.com/rubymotion/teacup
# Thanks Colin! (@colinta)
platform = Motion::Project::App.respond_to?(:template) ? Motion::Project::App.template : :ios
platform_setup = File.join(File.dirname(__FILE__), "joybox/joybox-#{platform}.rb") 

unless File.exists? platform_setup
  raise "Sorry, the platform #{platform.inspect} is not supported by joybox"
end

require platform_setup


Motion::Project::App.setup do |app|

  joybox = File.expand_path(File.join(File.dirname(__FILE__), '../motion/joybox'))

  # Scans app.files until it finds app/ (the default)
  # if found, it inserts just before those files, otherwise it will insert to
  # the end of the list
  insert_point = app.files.find_index { |file| file =~ /^(?:\.\/)?app\// } || 0

  Dir.glob(File.join(joybox, '**/*.rb')).reverse.each do |file|
    app.files.insert(insert_point, file)
  end

  app.files_dependencies File.join(joybox, 'physics/aabb.rb') => File.join(joybox, 'physics/world.rb')
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 lib/joybox.rb
joybox-1.1.0 lib/joybox.rb