lib/ProMotion.rb in ProMotion-1.2.1 vs lib/ProMotion.rb in ProMotion-2.0.0.rc1
- old
+ new
@@ -1,3 +1,12 @@
-require 'motion-require'
+unless defined?(Motion::Project::Config)
+ raise "The ProMotion gem must be required within a RubyMotion project Rakefile."
+end
-Motion::Require.all(Dir.glob(File.expand_path('../ProMotion/**/*.rb', __FILE__)))
\ No newline at end of file
+Motion::Project::App.setup do |app|
+ core_lib = File.join(File.dirname(__FILE__), 'ProMotion')
+ insert_point = app.files.find_index { |file| file =~ /^(?:\.\/)?app\// } || 0
+
+ Dir.glob(File.join(core_lib, '**/*.rb')).reverse.each do |file|
+ app.files.insert(insert_point, file)
+ end
+end