map-kit-wrapper 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in map_kit_wrapper.gemspec
3
+ # Specify your gem's dependencies in map-kit-wrapper.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -15,6 +15,7 @@ gem install map-kit-wrapper
15
15
  Edit the `Rakefile` of your RubyMotion project and add the following require line.
16
16
 
17
17
  ```ruby
18
+
18
19
  require 'map-kit-wrapper'
19
20
  ```
20
21
 
data/Rakefile CHANGED
@@ -1,14 +1,12 @@
1
1
  $:.unshift("/Library/RubyMotion/lib")
2
2
  require 'motion/project'
3
- require 'bundler/gem_tasks'
4
- Bundler.setup
3
+ require 'lib/map-kit-wrapper'
4
+
5
+ require "bundler/gem_tasks"
5
6
  Bundler.require
6
- require 'bubble-wrap/test'
7
7
 
8
8
  Motion::Project::App.setup do |app|
9
- # Use `rake config' to see complete project settings.
10
- app.name = 'MapKitWrapper'
11
- app.files = Dir.glob(File.join(app.project_dir, 'motion/**/*.rb'))
12
- app.files_dependencies 'motion/map_view.rb' => 'motion/zoom_level.rb'
13
- app.frameworks += ['CoreLocation', 'MapKit']
14
- end
9
+ app.name = 'testSuite'
10
+ app.identifier = 'com.rubymotion.testSuite'
11
+ app.delegate_class = 'TestSuiteDelegate'
12
+ end
@@ -0,0 +1,17 @@
1
+ require 'codependency'
2
+ unless defined?(Motion::Project::Config)
3
+ raise "This file must be required within a RubyMotion project Rakefile."
4
+ end
5
+
6
+ Motion::Project::App.setup do |app|
7
+ base_path = "#{File.dirname(__FILE__)}/map-kit-wrapper"
8
+ graph = Codependency::Graph.new("#{base_path}/map_view.rb")
9
+
10
+ files = (graph.files + Dir.glob(File.join(File.dirname(__FILE__), 'map-kit-wrapper/*.rb')).map { |file| file }).uniq
11
+ files.reverse.each do |file|
12
+ app.files.unshift(file)
13
+ end
14
+
15
+ app.frameworks += ['CoreLocation', 'MapKit']
16
+ end
17
+
@@ -0,0 +1,51 @@
1
+ module CoreLocation
2
+ # Wrappers for the Core Location Data Types
3
+ # http://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CoreLocationDataTypesRef/Reference/reference.html
4
+ module DataTypes
5
+
6
+ # Ruby wrapper for CLLocationCoordinate2D
7
+ class LocationCoordinate
8
+ attr_reader :sdk
9
+
10
+ # LocationCoordinate.new(1,2)
11
+ # LocationCoordinate.new([1,2])
12
+ # LocationCoordinate.new(LocationCoordinate)
13
+ # LocationCoordinate.new(CLLocationCoordinate2D)
14
+ def initialize(*args)
15
+ latitude, longitude = nil, nil
16
+ args.flatten!
17
+ if args.size == 1
18
+ arg = args.first
19
+ if arg.is_a?(CLLocationCoordinate2D)
20
+ latitude, longitude = arg.latitude, arg.longitude
21
+ elsif arg.is_a?(LocationCoordinate)
22
+ latitude, longitude = arg.sdk.latitude, arg.sdk.longitude
23
+ end
24
+ elsif args.size == 2
25
+ latitude, longitude = args[0], args[1]
26
+ end
27
+ @sdk = CLLocationCoordinate2DMake(latitude, longitude)
28
+ end
29
+
30
+ def latitude
31
+ @sdk.latitude
32
+ end
33
+
34
+ def latitude=(latitude)
35
+ @sdk.latitude = latitude
36
+ end
37
+
38
+ def longitude
39
+ @sdk.longitude
40
+ end
41
+
42
+ def longitude=(longitude)
43
+ @sdk.longitude = longitude
44
+ end
45
+
46
+ def to_array
47
+ [latitude, longitude]
48
+ end
49
+ end
50
+ end
51
+ end
@@ -1,3 +1,5 @@
1
+ # require core_location_data_types
2
+
1
3
  module MapKit
2
4
  # Wrappers for the Map Kit Data Types
3
5
  # http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MapKitDataTypesReference/Reference/reference.html
@@ -1,3 +1,7 @@
1
+ # require core_location_data_types
2
+ # require map_kit_data_types
3
+ # require zoom_level
4
+
1
5
  module MapKit
2
6
  include CoreLocation::DataTypes
3
7
  include MapKit::DataTypes
@@ -0,0 +1,3 @@
1
+ module MapKit
2
+ VERSION = "0.0.2"
3
+ end
@@ -1,11 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/map_kit_wrapper/version', __FILE__)
2
+ require File.expand_path('../lib/map-kit-wrapper/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Kasper Weibel Nielsen-Refs"]
6
6
  gem.email = ["weibel@gmail.com"]
7
- gem.summary = %q{This is a MapKit wrapper for RubyMotion. It's
8
- purpose is to make make dealing with MapKit less painfull}
7
+ gem.summary = %q{This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painful}
9
8
  gem.homepage = "https://github.com/weibel/MapKitWrapper"
10
9
 
11
10
  gem.files = `git ls-files`.split($\)
@@ -15,6 +14,6 @@ purpose is to make make dealing with MapKit less painfull}
15
14
  gem.require_paths = ["lib"]
16
15
  gem.version = MapKit::VERSION
17
16
 
18
- gem.add_dependency 'bubble-wrap'
19
- gem.add_development_dependency 'rake'
17
+ gem.add_dependency 'codependency', '0.2.0'
18
+ gem.add_dependency 'rake'
20
19
  end
@@ -3,7 +3,8 @@ describe 'LocationCoordinate' do
3
3
  lc_1 = CoreLocation::DataTypes::LocationCoordinate.new(5, 8)
4
4
  lc_2 = CoreLocation::DataTypes::LocationCoordinate.new([5, 8])
5
5
  lc_3 = CoreLocation::DataTypes::LocationCoordinate.new(CLLocationCoordinate2DMake(5, 8))
6
- @array = [lc_1, lc_2, lc_3]
6
+ lc_4 = CoreLocation::DataTypes::LocationCoordinate.new(lc_3)
7
+ @array = [lc_1, lc_2, lc_3, lc_4]
7
8
  end
8
9
 
9
10
  it 'should return the latitude' do
@@ -12,12 +13,26 @@ describe 'LocationCoordinate' do
12
13
  end
13
14
  end
14
15
 
16
+ it 'should assign the latitude' do
17
+ @array.each do |lc|
18
+ lc.latitude = 10
19
+ lc.latitude.should.equal 10
20
+ end
21
+ end
22
+
15
23
  it 'should return the longitude' do
16
24
  @array.each do |lc|
17
25
  lc.longitude.should.equal 8
18
26
  end
19
27
  end
20
28
 
29
+ it 'should assign the longitude' do
30
+ @array.each do |lc|
31
+ lc.longitude = 10
32
+ lc.longitude.should.equal 10
33
+ end
34
+ end
35
+
21
36
  it 'should return an array' do
22
37
  @array.each do |lc|
23
38
  lc.to_array.should.equal [5, 8]
@@ -0,0 +1,9 @@
1
+ describe "Application 'MapKitWrapper'" do
2
+ before do
3
+ @app = UIApplication.sharedApplication
4
+ end
5
+
6
+ it "has one window" do
7
+ @app.windows.size.should == 1
8
+ end
9
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: map-kit-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kasper Weibel Nielsen-Refs
@@ -15,20 +15,22 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-06-20 00:00:00 Z
18
+ date: 2012-08-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: bubble-wrap
21
+ name: codependency
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
- - - ">="
26
+ - - "="
27
27
  - !ruby/object:Gem::Version
28
- hash: 3
28
+ hash: 23
29
29
  segments:
30
30
  - 0
31
- version: "0"
31
+ - 2
32
+ - 0
33
+ version: 0.2.0
32
34
  type: :runtime
33
35
  version_requirements: *id001
34
36
  - !ruby/object:Gem::Dependency
@@ -43,7 +45,7 @@ dependencies:
43
45
  segments:
44
46
  - 0
45
47
  version: "0"
46
- type: :development
48
+ type: :runtime
47
49
  version_requirements: *id002
48
50
  description:
49
51
  email:
@@ -60,19 +62,20 @@ files:
60
62
  - LICENSE
61
63
  - README.md
62
64
  - Rakefile
63
- - lib/map_kit_wrapper.rb
64
- - lib/map_kit_wrapper/version.rb
65
+ - lib/map-kit-wrapper.rb
66
+ - lib/map-kit-wrapper/core_location_data_types.rb
67
+ - lib/map-kit-wrapper/map_kit_data_types.rb
68
+ - lib/map-kit-wrapper/map_type.rb
69
+ - lib/map-kit-wrapper/map_view.rb
70
+ - lib/map-kit-wrapper/test_suite_delegate.rb
71
+ - lib/map-kit-wrapper/version.rb
72
+ - lib/map-kit-wrapper/zoom_level.rb
65
73
  - map_kit_wrapper.gemspec
66
- - motion/core_location_data_types.rb
67
- - motion/map_kit_data_types.rb
68
- - motion/map_type.rb
69
- - motion/map_view.rb
70
- - motion/test_suite_delegate.rb
71
- - motion/zoom_level.rb
72
- - spec/core_location_data_types_spec.rb
73
- - spec/map_kit_data_types_spec.rb
74
- - spec/map_view_spec.rb
75
- - spec/zoom_level_spec.rb
74
+ - spec/lib/core_location_data_types_spec.rb
75
+ - spec/lib/map_kit_data_types_spec.rb
76
+ - spec/lib/map_view_spec.rb
77
+ - spec/lib/zoom_level_spec.rb
78
+ - spec/main_spec.rb
76
79
  homepage: https://github.com/weibel/MapKitWrapper
77
80
  licenses: []
78
81
 
@@ -105,9 +108,10 @@ rubyforge_project:
105
108
  rubygems_version: 1.8.24
106
109
  signing_key:
107
110
  specification_version: 3
108
- summary: This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painfull
111
+ summary: This is a MapKit wrapper for RubyMotion. It's purpose is to make make dealing with MapKit less painful
109
112
  test_files:
110
- - spec/core_location_data_types_spec.rb
111
- - spec/map_kit_data_types_spec.rb
112
- - spec/map_view_spec.rb
113
- - spec/zoom_level_spec.rb
113
+ - spec/lib/core_location_data_types_spec.rb
114
+ - spec/lib/map_kit_data_types_spec.rb
115
+ - spec/lib/map_view_spec.rb
116
+ - spec/lib/zoom_level_spec.rb
117
+ - spec/main_spec.rb
@@ -1 +0,0 @@
1
- require 'map_kit_wrapper/version' unless defined?(MapKit::VERSION)
@@ -1,3 +0,0 @@
1
- module MapKit
2
- VERSION = "0.0.1"
3
- end
@@ -1,35 +0,0 @@
1
- module CoreLocation
2
- # Wrappers for the Core Location Data Types
3
- # http://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CoreLocationDataTypesRef/Reference/reference.html
4
- module DataTypes
5
-
6
- # Ruby wrapper for CLLocationCoordinate2D
7
- class LocationCoordinate
8
- attr_reader :sdk
9
-
10
- # LocationCoordinate.new(1,2)
11
- # LocationCoordinate.new([1,2])
12
- # CoordinateSpan.new(CLLocationCoordinate2D)
13
- def initialize(*args)
14
- args.flatten!
15
- if args.first.is_a?(CLLocationCoordinate2D)
16
- @sdk = args.first
17
- else
18
- @sdk = CLLocationCoordinate2DMake(args[0], args[1])
19
- end
20
- end
21
-
22
- def latitude
23
- @sdk.latitude
24
- end
25
-
26
- def longitude
27
- @sdk.longitude
28
- end
29
-
30
- def to_array
31
- [latitude, longitude]
32
- end
33
- end
34
- end
35
- end