Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Started using codedependency

  • Loading branch information...
commit 365e47858bc6e30e852b66bcba26d5c4fd170771 1 parent d2d6849
@weibel authored
View
9 Rakefile
@@ -1,9 +1,12 @@
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
-require 'rubygems'
require 'lib/map-kit-wrapper'
+require "bundler/gem_tasks"
+Bundler.require
+
Motion::Project::App.setup do |app|
- app.name = 'MapKitWrapper'
+ app.name = 'testSuite'
+ app.identifier = 'com.rubymotion.testSuite'
app.delegate_class = 'TestSuiteDelegate'
-end
+end
View
32 lib/map-kit-wrapper.rb
@@ -1,16 +1,30 @@
+require 'codependency'
unless defined?(Motion::Project::Config)
raise "This file must be required within a RubyMotion project Rakefile."
end
Motion::Project::App.setup do |app|
- Dir.glob(File.join(File.dirname(__FILE__), 'map-kit-wrapper/*.rb')).each do |file|
- app.files.unshift(file)
+ @load_count ||= 0
+ if @load_count == 0
+ Dir.glob(File.join(File.dirname(__FILE__), 'map-kit-wrapper/*.rb')).each do |file|
+ app.files.unshift(file)
+ end
+
+ base_path = "#{File.dirname(__FILE__)}/map-kit-wrapper"
+ graph = Codependency::Graph.new("#{base_path}/map_view.rb")
+
+ files = {}
+ # path hack from http://www.rdoc.info/github/mattetti/BubbleWrap/Motion/Project/Config#files_dependencies-instance_method
+ graph_files = graph.files.reverse.map do |x|
+ /^\.?\//.match(x) ? x : File.join('.', x)
+ end
+ (0 .. graph_files.count - 2).each do |i|
+ files[graph_files[i]] = graph_files[i+1]
+ end
+ app.files_dependencies files
+
+ app.frameworks += ['CoreLocation', 'MapKit']
end
- base_path = "#{File.dirname(__FILE__)}/map-kit-wrapper"
- app.files_dependencies({
- "#{base_path}/map_view.rb" => "#{base_path}/map_kit_data_types.rb",
- "#{base_path}/map_kit_data_types.rb" => "#{base_path}/core_location_data_types.rb",
- "#{base_path}/core_location_data_types.rb" => "#{base_path}/zoom_level.rb"
- })
- app.frameworks += ['CoreLocation', 'MapKit']
+ @load_count += 1
end
+
View
2  lib/map-kit-wrapper/map_kit_data_types.rb
@@ -1,3 +1,5 @@
+# require core_location_data_types
+
module MapKit
# Wrappers for the Map Kit Data Types
# http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MapKitDataTypesReference/Reference/reference.html
View
4 lib/map-kit-wrapper/map_view.rb
@@ -1,3 +1,7 @@
+# require core_location_data_types
+# require map_kit_data_types
+# require zoom_level
+
module MapKit
include CoreLocation::DataTypes
include MapKit::DataTypes
View
1  lib/map-kit-wrapper/test_suite_delegate.rb
@@ -4,7 +4,6 @@ class TestSuiteDelegate
def application(application, didFinishLaunchingWithOptions: launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = UIViewController.alloc.init
- @window.makeKeyAndVisible
true
end
end
View
5 map_kit_wrapper.gemspec
@@ -14,7 +14,6 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = MapKit::VERSION
- #gem.add_dependency 'motion_require'
-
- gem.add_development_dependency 'rake'
+ gem.add_dependency 'codependency', '0.2.0'
+ gem.add_dependency 'rake'
end
View
0  spec/core_location_data_types_spec.rb → spec/lib/core_location_data_types_spec.rb
File renamed without changes
View
0  spec/map_kit_data_types_spec.rb → spec/lib/map_kit_data_types_spec.rb
File renamed without changes
View
0  spec/map_view_spec.rb → spec/lib/map_view_spec.rb
File renamed without changes
View
0  spec/zoom_level_spec.rb → spec/lib/zoom_level_spec.rb
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.