gmaps4rails 2.0.0.pre → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -4
- data/Gemfile +5 -1
- data/Gemfile.lock +31 -113
- data/README.rdoc +53 -70
- data/Rakefile +21 -1
- data/gmaps4rails.gemspec +4 -19
- data/js_compilation/gmaps_google.js +961 -0
- data/lib/generators/gmaps4rails/copy_coffee_generator.rb +14 -0
- data/lib/generators/gmaps4rails/copy_js_generator.rb +15 -0
- data/lib/gmaps4rails.rb +12 -22
- data/lib/gmaps4rails/markers_builder.rb +74 -0
- data/lib/gmaps4rails/rails/engine.rb +6 -0
- data/lib/gmaps4rails/rails/railtie.rb +6 -0
- data/lib/gmaps4rails/version.rb +2 -2
- data/script/compile_coffee_files.rb +19 -0
- data/script/gmaps4rails.rake +7 -0
- data/spec/javascripts/google/builders/marker_spec.js +96 -0
- data/spec/javascripts/helpers/SpecHelper.js +101 -0
- data/spec/javascripts/helpers/matchers.js +12 -0
- data/spec/javascripts/helpers/underscore.js +6 -0
- data/spec/javascripts/objects/handler_spec.js +320 -0
- data/spec/javascripts/support/jasmine.yml +86 -0
- data/spec/javascripts/support/jasmine_helper.rb +11 -0
- data/spec/lib/base_spec.rb +10 -52
- data/spec/lib/markers_builder_spec.rb +49 -0
- data/spec/spec_helper.rb +1 -25
- data/vendor/assets/javascripts/gmaps/base.coffee +16 -0
- data/vendor/assets/javascripts/gmaps/base/base.coffee +17 -0
- data/vendor/assets/javascripts/gmaps/google.coffee +3 -0
- data/vendor/assets/javascripts/gmaps/google/builders/bound.coffee +6 -0
- data/vendor/assets/javascripts/gmaps/google/builders/circle.coffee +21 -0
- data/vendor/assets/javascripts/gmaps/google/builders/clusterer.coffee +6 -0
- data/vendor/assets/javascripts/gmaps/google/builders/kml.coffee +17 -0
- data/vendor/assets/javascripts/gmaps/google/builders/map.coffee +27 -0
- data/vendor/assets/javascripts/gmaps/google/builders/marker.coffee +100 -0
- data/vendor/assets/javascripts/gmaps/google/builders/polygon.coffee +24 -0
- data/vendor/assets/javascripts/gmaps/google/builders/polyline.coffee +24 -0
- data/vendor/assets/javascripts/gmaps/google/objects/bound.coffee +13 -0
- data/vendor/assets/javascripts/gmaps/google/objects/circle.coffee +9 -0
- data/vendor/assets/javascripts/gmaps/google/objects/clusterer.coffee +13 -0
- data/vendor/assets/javascripts/gmaps/google/objects/common.coffee +23 -0
- data/vendor/assets/javascripts/gmaps/google/objects/kml.coffee +15 -0
- data/vendor/assets/javascripts/gmaps/google/objects/map.coffee +19 -0
- data/vendor/assets/javascripts/gmaps/google/objects/marker.coffee +11 -0
- data/vendor/assets/javascripts/gmaps/google/objects/polygon.coffee +8 -0
- data/vendor/assets/javascripts/gmaps/google/objects/polyline.coffee +8 -0
- data/vendor/assets/javascripts/gmaps/google/primitives.coffee +43 -0
- data/vendor/assets/javascripts/gmaps/objects/base_builder.coffee +20 -0
- data/vendor/assets/javascripts/gmaps/objects/builder.coffee +12 -0
- data/vendor/assets/javascripts/gmaps/objects/handler.coffee +153 -0
- data/vendor/assets/javascripts/gmaps/objects/null_clusterer.coffee +4 -0
- metadata +66 -299
- data/Guardfile.old +0 -24
- data/app/views/gmaps4rails/_gmaps4rails.html.erb +0 -20
- data/lib/generators/gmaps4rails/install_generator.rb +0 -43
- data/lib/generators/templates/README +0 -2
- data/lib/gmaps4rails/acts_as_gmappable.rb +0 -54
- data/lib/gmaps4rails/api_wrappers/base_net_methods.rb +0 -40
- data/lib/gmaps4rails/api_wrappers/direction.rb +0 -87
- data/lib/gmaps4rails/api_wrappers/geocoder.rb +0 -54
- data/lib/gmaps4rails/api_wrappers/places.rb +0 -74
- data/lib/gmaps4rails/base.rb +0 -126
- data/lib/gmaps4rails/extensions/enumerable.rb +0 -14
- data/lib/gmaps4rails/extensions/hash.rb +0 -9
- data/lib/gmaps4rails/helper/gmaps4rails_helper.rb +0 -33
- data/lib/gmaps4rails/js_builder.rb +0 -154
- data/lib/gmaps4rails/json_builder.rb +0 -140
- data/lib/gmaps4rails/model_handler.rb +0 -101
- data/lib/gmaps4rails/view_helper.rb +0 -172
- data/lib/tasks/jasmine.rake +0 -8
- data/public/javascripts/gmaps4rails/all.js +0 -2144
- data/public/javascripts/gmaps4rails/base.js +0 -792
- data/public/javascripts/gmaps4rails/google.js +0 -556
- data/public/javascripts/gmaps4rails/openlayers.js +0 -377
- data/public/stylesheets/gmaps4rails.css +0 -24
- data/spec/dummy/.gitignore +0 -3
- data/spec/dummy/.rspec +0 -1
- data/spec/dummy/README.rdoc +0 -261
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -18
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/assets/stylesheets/gmaps4rails.css +0 -24
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/controllers/users_controller.rb +0 -105
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/place.rb +0 -16
- data/spec/dummy/app/models/user.rb +0 -12
- data/spec/dummy/app/views/layouts/application.html.erb +0 -17
- data/spec/dummy/app/views/users/_form.html.erb +0 -37
- data/spec/dummy/app/views/users/edit.html.erb +0 -6
- data/spec/dummy/app/views/users/index.html.erb +0 -268
- data/spec/dummy/app/views/users/new.html.erb +0 -5
- data/spec/dummy/app/views/users/show.html.erb +0 -30
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -62
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -37
- data/spec/dummy/config/environments/production.rb +0 -67
- data/spec/dummy/config/environments/test.rb +0 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/gmaps4rails.rb +0 -1
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -60
- data/spec/dummy/db/migrate/20120408170155_create_users.rb +0 -16
- data/spec/dummy/db/schema.rb +0 -29
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/Player.js +0 -22
- data/spec/dummy/public/javascripts/Song.js +0 -7
- data/spec/dummy/public/logo.png +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/factories/place_factory.rb +0 -16
- data/spec/factories/user_factory.rb +0 -23
- data/spec/fixtures/google_direction_valid.json +0 -65
- data/spec/fixtures/google_geocoding_toulon_france.json +0 -58
- data/spec/fixtures/google_places_valid.json +0 -45
- data/spec/fixtures/google_wrong_geocoding.json +0 -4
- data/spec/launchers/all_but_requests.rb +0 -0
- data/spec/launchers/all_specs.rb +0 -0
- data/spec/launchers/requests.rb +0 -0
- data/spec/lib/direction_spec.rb +0 -53
- data/spec/lib/geocoder_spec.rb +0 -46
- data/spec/lib/js_builder_spec.rb +0 -134
- data/spec/lib/json_builder_spec.rb +0 -232
- data/spec/lib/places_spec.rb +0 -25
- data/spec/models/place_spec.rb +0 -39
- data/spec/models/user_spec.rb +0 -187
- data/spec/support/geocoding.rb +0 -40
- data/spec/support/matchers.rb +0 -73
- data/todo +0 -0
- data/vendor/assets/javascripts/gmaps4rails/all.js +0 -1
- data/vendor/assets/javascripts/gmaps4rails/base.coffee +0 -1
- data/vendor/assets/javascripts/gmaps4rails/base/common.coffee +0 -43
- data/vendor/assets/javascripts/gmaps4rails/base/configuration.coffee +0 -7
- data/vendor/assets/javascripts/gmaps4rails/base/gmaps.coffee +0 -13
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/basic_interface.coffee +0 -15
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/controller_interface.coffee +0 -15
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/map_interface.coffee +0 -27
- data/vendor/assets/javascripts/gmaps4rails/base/interfaces/marker_interface.coffee +0 -15
- data/vendor/assets/javascripts/gmaps4rails/base/main.coffee +0 -124
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/circle_controller.coffee +0 -29
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/kml_controller.coffee +0 -5
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/marker_controller.coffee +0 -76
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polygon_controller.coffee +0 -29
- data/vendor/assets/javascripts/gmaps4rails/base/main_controller_extensions/polyline_controller.coffee +0 -29
- data/vendor/assets/javascripts/gmaps4rails/base/objects/circle.coffee +0 -12
- data/vendor/assets/javascripts/gmaps4rails/base/objects/kml.coffee +0 -8
- data/vendor/assets/javascripts/gmaps4rails/base/objects/map.coffee +0 -62
- data/vendor/assets/javascripts/gmaps4rails/base/objects/marker.coffee +0 -24
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polygon.coffee +0 -11
- data/vendor/assets/javascripts/gmaps4rails/base/objects/polyline.coffee +0 -11
- data/vendor/assets/javascripts/gmaps4rails/bing.coffee +0 -1
- data/vendor/assets/javascripts/gmaps4rails/bing/main.coffee +0 -29
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/map.coffee +0 -63
- data/vendor/assets/javascripts/gmaps4rails/bing/objects/marker.coffee +0 -78
- data/vendor/assets/javascripts/gmaps4rails/bing/shared.coffee +0 -20
- data/vendor/assets/javascripts/gmaps4rails/google.coffee +0 -1
- data/vendor/assets/javascripts/gmaps4rails/google/main.coffee +0 -47
- data/vendor/assets/javascripts/gmaps4rails/google/objects/circle.coffee +0 -38
- data/vendor/assets/javascripts/gmaps4rails/google/objects/kml.coffee +0 -16
- data/vendor/assets/javascripts/gmaps4rails/google/objects/map.coffee +0 -71
- data/vendor/assets/javascripts/gmaps4rails/google/objects/marker.coffee +0 -114
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polygon.coffee +0 -38
- data/vendor/assets/javascripts/gmaps4rails/google/objects/polyline.coffee +0 -49
- data/vendor/assets/javascripts/gmaps4rails/google/shared.coffee +0 -27
- data/vendor/assets/javascripts/gmaps4rails/openlayers.coffee +0 -1
- data/vendor/assets/javascripts/gmaps4rails/openlayers/main.coffee +0 -138
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/map.coffee +0 -49
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/marker.coffee +0 -68
- data/vendor/assets/javascripts/gmaps4rails/openlayers/objects/polyline.coffee +0 -39
- data/vendor/assets/javascripts/gmaps4rails/openlayers/shared.coffee +0 -19
data/spec/dummy/db/schema.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
-
#
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
7
|
-
# database schema. If you need to create the application database on another
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
-
#
|
12
|
-
# It's strongly recommended to check this file into your version control system.
|
13
|
-
|
14
|
-
ActiveRecord::Schema.define(:version => 20120408170155) do
|
15
|
-
|
16
|
-
create_table "users", :force => true do |t|
|
17
|
-
t.string "name"
|
18
|
-
t.string "address"
|
19
|
-
t.string "norm_address"
|
20
|
-
t.string "sec_address"
|
21
|
-
t.string "picture"
|
22
|
-
t.float "latitude"
|
23
|
-
t.float "longitude"
|
24
|
-
t.boolean "gmaps"
|
25
|
-
t.datetime "created_at", :null => false
|
26
|
-
t.datetime "updated_at", :null => false
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
File without changes
|
data/spec/dummy/log/.gitkeep
DELETED
File without changes
|
data/spec/dummy/public/404.html
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/404.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
data/spec/dummy/public/422.html
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/422.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The change you wanted was rejected.</h1>
|
23
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
data/spec/dummy/public/500.html
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/500.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>We're sorry, but something went wrong.</h1>
|
23
|
-
</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
File without changes
|
@@ -1,22 +0,0 @@
|
|
1
|
-
function Player() {
|
2
|
-
}
|
3
|
-
Player.prototype.play = function(song) {
|
4
|
-
this.currentlyPlayingSong = song;
|
5
|
-
this.isPlaying = true;
|
6
|
-
};
|
7
|
-
|
8
|
-
Player.prototype.pause = function() {
|
9
|
-
this.isPlaying = false;
|
10
|
-
};
|
11
|
-
|
12
|
-
Player.prototype.resume = function() {
|
13
|
-
if (this.isPlaying) {
|
14
|
-
throw new Error("song is already playing");
|
15
|
-
}
|
16
|
-
|
17
|
-
this.isPlaying = true;
|
18
|
-
};
|
19
|
-
|
20
|
-
Player.prototype.makeFavorite = function() {
|
21
|
-
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
22
|
-
};
|
data/spec/dummy/public/logo.png
DELETED
Binary file
|
data/spec/dummy/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
@@ -1,23 +0,0 @@
|
|
1
|
-
FactoryGirl.define do
|
2
|
-
factory :user do
|
3
|
-
|
4
|
-
trait :paris do
|
5
|
-
address "Paris, France"
|
6
|
-
end
|
7
|
-
|
8
|
-
trait :with_pic do
|
9
|
-
picture "http://www.blankdots.com/img/github-32x32.png"
|
10
|
-
end
|
11
|
-
|
12
|
-
trait :invalid do
|
13
|
-
address "home"
|
14
|
-
end
|
15
|
-
|
16
|
-
name "Guinea Pig"
|
17
|
-
address "Toulon, France"
|
18
|
-
|
19
|
-
factory :user_paris, :traits => [:paris]
|
20
|
-
factory :user_with_pic, :traits => [:with_pic]
|
21
|
-
factory :invalid_user, :traits => [:invalid]
|
22
|
-
end
|
23
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"status": "OK",
|
3
|
-
"routes": [ {
|
4
|
-
"summary": "I-40 W",
|
5
|
-
"legs": [ {
|
6
|
-
"steps": [ {
|
7
|
-
"travel_mode": "DRIVING",
|
8
|
-
"start_location": {
|
9
|
-
"lat": 41.8507300,
|
10
|
-
"lng": -87.6512600
|
11
|
-
},
|
12
|
-
"end_location": {
|
13
|
-
"lat": 41.8525800,
|
14
|
-
"lng": -87.6514100
|
15
|
-
},
|
16
|
-
"polyline": {
|
17
|
-
"points": "a~l~Fjk~uOwHJy@P"
|
18
|
-
},
|
19
|
-
"duration": {
|
20
|
-
"value": 19,
|
21
|
-
"text": "1 min"
|
22
|
-
},
|
23
|
-
"html_instructions": "Head \u003cb\u003enorth\u003c/b\u003e on \u003cb\u003eS Morgan St\u003c/b\u003e toward \u003cb\u003eW Cermak Rd\u003c/b\u003e",
|
24
|
-
"distance": {
|
25
|
-
"value": 207,
|
26
|
-
"text": "0.1 mi"
|
27
|
-
}
|
28
|
-
}],
|
29
|
-
"duration": {
|
30
|
-
"value": 74384,
|
31
|
-
"text": "20 hours 40 mins"
|
32
|
-
},
|
33
|
-
"distance": {
|
34
|
-
"value": 2137146,
|
35
|
-
"text": "1,328 mi"
|
36
|
-
},
|
37
|
-
"start_location": {
|
38
|
-
"lat": 35.4675602,
|
39
|
-
"lng": -97.5164276
|
40
|
-
},
|
41
|
-
"end_location": {
|
42
|
-
"lat": 34.0522342,
|
43
|
-
"lng": -118.2436849
|
44
|
-
},
|
45
|
-
"start_address": "Oklahoma City, OK, USA",
|
46
|
-
"end_address": "Los Angeles, CA, USA"
|
47
|
-
} ],
|
48
|
-
"copyrights": "Map data ©2010 Google, Sanborn",
|
49
|
-
"overview_polyline": {
|
50
|
-
"points": "a~l~Fjk~uOnzh@vlbBtc~@tsE`vnApw{A`dw@~w\\|tNtqf@l{Yd_Fblh@rxo@b}@xxSfytAblk@xxaBeJxlcBb~t@zbh@jc|Bx}C`rv@rw|@rlhA~dVzeo@vrSnc}Axf]fjz@xfFbw~@dz{A~d{A|zOxbrBbdUvpo@`cFp~xBc`Hk@nurDznmFfwMbwz@bbl@lq~@loPpxq@bw_@v|{CbtY~jGqeMb{iF|n\\~mbDzeVh_Wr|Efc\\x`Ij{kE}mAb~uF{cNd}xBjp]fulBiwJpgg@|kHntyArpb@bijCk_Kv~eGyqTj_|@`uV`k|DcsNdwxAott@r}q@_gc@nu`CnvHx`k@dse@j|p@zpiAp|gEicy@`omFvaErfo@igQxnlApqGze~AsyRzrjAb__@ftyB}pIlo_BflmA~yQftNboWzoAlzp@mz`@|}_@fda@jakEitAn{fB_a]lexClshBtmqAdmY_hLxiZd~XtaBndgC"
|
51
|
-
},
|
52
|
-
"warnings": [ ],
|
53
|
-
"waypoint_order": [ 0, 1 ],
|
54
|
-
"bounds": {
|
55
|
-
"southwest": {
|
56
|
-
"lat": 34.0523600,
|
57
|
-
"lng": -118.2435600
|
58
|
-
},
|
59
|
-
"northeast": {
|
60
|
-
"lat": 41.8781100,
|
61
|
-
"lng": -87.6297900
|
62
|
-
}
|
63
|
-
}
|
64
|
-
} ]
|
65
|
-
}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"results" : [
|
3
|
-
{
|
4
|
-
"address_components" : [
|
5
|
-
{
|
6
|
-
"long_name" : "Toulon",
|
7
|
-
"short_name" : "Toulon",
|
8
|
-
"types" : [ "locality", "political" ]
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"long_name" : "Département Var",
|
12
|
-
"short_name" : "83",
|
13
|
-
"types" : [ "administrative_area_level_2", "political" ]
|
14
|
-
},
|
15
|
-
{
|
16
|
-
"long_name" : "Provence-Alpes-Côte d'Azur",
|
17
|
-
"short_name" : "PACA",
|
18
|
-
"types" : [ "administrative_area_level_1", "political" ]
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"long_name" : "France",
|
22
|
-
"short_name" : "FR",
|
23
|
-
"types" : [ "country", "political" ]
|
24
|
-
}
|
25
|
-
],
|
26
|
-
"formatted_address" : "Toulon, France",
|
27
|
-
"geometry" : {
|
28
|
-
"bounds" : {
|
29
|
-
"northeast" : {
|
30
|
-
"lat" : 43.1716730,
|
31
|
-
"lng" : 5.987382999999999
|
32
|
-
},
|
33
|
-
"southwest" : {
|
34
|
-
"lat" : 43.1010490,
|
35
|
-
"lng" : 5.8794790
|
36
|
-
}
|
37
|
-
},
|
38
|
-
"location" : {
|
39
|
-
"lat" : 43.1242280,
|
40
|
-
"lng" : 5.9280
|
41
|
-
},
|
42
|
-
"location_type" : "APPROXIMATE",
|
43
|
-
"viewport" : {
|
44
|
-
"northeast" : {
|
45
|
-
"lat" : 43.1567950,
|
46
|
-
"lng" : 5.99202970
|
47
|
-
},
|
48
|
-
"southwest" : {
|
49
|
-
"lat" : 43.09164370,
|
50
|
-
"lng" : 5.86397030
|
51
|
-
}
|
52
|
-
}
|
53
|
-
},
|
54
|
-
"types" : [ "locality", "political" ]
|
55
|
-
}
|
56
|
-
],
|
57
|
-
"status" : "OK"
|
58
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"html_attributions" : [
|
3
|
-
"Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e"
|
4
|
-
],
|
5
|
-
"results" : [
|
6
|
-
{
|
7
|
-
"geometry" : {
|
8
|
-
"location" : {
|
9
|
-
"lat" : -33.8719830,
|
10
|
-
"lng" : 151.1990860
|
11
|
-
}
|
12
|
-
},
|
13
|
-
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
|
14
|
-
"id" : "677679492a58049a7eae079e0890897eb953d79b",
|
15
|
-
"name" : "Zaaffran Restaurant - BBQ and GRILL, Darling Harbour",
|
16
|
-
"rating" : 3.90,
|
17
|
-
"reference" : "CpQBjAAAAHDHuimUQATR6gfoWNmZlk5dKUKq_n46BpSzPQCjk1m9glTKkiAHH_Gs4xGttdOSj35WJJDAV90dAPnNnZK2OaxMgogdeHKQhIedh6UduFrW53wtwXigUfpAzsCgIzYNI0UQtCj38cr_DE56RH4Wi9d2bWbbIuRyDX6tx2Fmk2EQzO_lVJ-oq4ZY5uI6I75RnxIQJ6smWUVVIHup9Jvc517DKhoUidfNPyQZZIgGiXS_SwGQ1wg0gtc",
|
18
|
-
"types" : [ "restaurant", "food", "establishment" ],
|
19
|
-
"vicinity" : "Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney"
|
20
|
-
},
|
21
|
-
{
|
22
|
-
"geometry" : {
|
23
|
-
"location" : {
|
24
|
-
"lat" : -33.8722580,
|
25
|
-
"lng" : 151.1986550
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
|
29
|
-
"id" : "27ea39c8fed1c0437069066b8dccf958a2d06f19",
|
30
|
-
"name" : "Criniti's Darling Harbour",
|
31
|
-
"rating" : 3.60,
|
32
|
-
"reference" : "CnRwAAAA-5kh5WZ3m1CMTO3LslvhRtAYsrOcQP7wB9AE1bV5R6Bd46NN5wB16MtImXWQ9eS1nWVbV_j-8iXYXRpU13Efp1t_d-Dp4WfEsFcYj-_g6db1SC1vAukyeCyotjS5xrwhzqWWAhgmA4qIliWeev2u1BIQprWzxl_hkj_w3QdTiUBYKxoUDVTjF4RugJdaJWkC4n6w6pSajKw",
|
33
|
-
"types" : [ "restaurant", "food", "establishment" ],
|
34
|
-
"vicinity" : "Shop 461, 2-10 Darling Drive, Harbourside Shopping Centre, DARLING HARBOUR",
|
35
|
-
"events" : [
|
36
|
-
{
|
37
|
-
"event_id" : "7lH_gK1GphU",
|
38
|
-
"summary" : "Google Maps Developer Meetup: Rockin' out with the Places API",
|
39
|
-
"url" : "https://developers.google.com/maps/documentation/places"
|
40
|
-
}
|
41
|
-
]
|
42
|
-
}
|
43
|
-
],
|
44
|
-
"status" : "OK"
|
45
|
-
}
|
File without changes
|
data/spec/launchers/all_specs.rb
DELETED
File without changes
|
data/spec/launchers/requests.rb
DELETED
File without changes
|
data/spec/lib/direction_spec.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Direction" do
|
4
|
-
|
5
|
-
let(:geocoding) { File.read "spec/fixtures/google_direction_valid.json" }
|
6
|
-
|
7
|
-
context "valid request" do
|
8
|
-
before(:each) do
|
9
|
-
stub_request(:get, "http://maps.googleapis.com/maps/api/directions/json?destination=stubbed&language=en&origin=stubbed&sensor=false").
|
10
|
-
to_return(:status => 200, :body => geocoding, :headers => {})
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should render info from only start_end args" do
|
14
|
-
result = Gmaps4rails.destination( {:from => "stubbed", :to => "stubbed"})
|
15
|
-
result.should eq([
|
16
|
-
{
|
17
|
-
"duration" => { "text" => "20 hours 40 mins", "value" => 74384.0 },
|
18
|
-
"distance" => { "text" => "1,328 mi", "value" => 2137146.0 },
|
19
|
-
"steps" => [
|
20
|
-
{ "travel_mode" => "DRIVING",
|
21
|
-
"start_location" => { "lat" => 41.85073, "lng" => -87.65126 },
|
22
|
-
"end_location" => { "lat" => 41.85258, "lng" => -87.65141 },
|
23
|
-
"duration" => { "value" => 19, "text" => "1 min" },
|
24
|
-
"html_instructions" => "Head <b>north</b> on <b>S Morgan St</b> toward <b>W Cermak Rd</b>",
|
25
|
-
"distance" => { "value" => 207, "text" => "0.1 mi" }
|
26
|
-
}
|
27
|
-
],
|
28
|
-
"polylines" =>"[{\"coded_array\":\"a~l~Fjk~uOwHJy@P\"}]"
|
29
|
-
}
|
30
|
-
])
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should clean output" do
|
34
|
-
result = Gmaps4rails.destination( {:from => "stubbed", :to => "stubbed"}, {}, "clean")
|
35
|
-
result.should eq([
|
36
|
-
{
|
37
|
-
"duration" => { "text" => "20 hours 40 mins", "value" => 74384.0 },
|
38
|
-
"distance" => { "text" => "1,328 mi", "value" => 2137146.0 },
|
39
|
-
"steps" => [
|
40
|
-
{ "travel_mode" => "DRIVING",
|
41
|
-
"start_location" => { "lat" => 41.85073, "lng" => -87.65126 },
|
42
|
-
"end_location" => { "lat" => 41.85258, "lng" => -87.65141 },
|
43
|
-
"duration" => { "value" => 19, "text" => "1 min" },
|
44
|
-
"html_instructions" => "Head <b>north</b> on <b>S Morgan St</b> toward <b>W Cermak Rd</b>",
|
45
|
-
"distance" => { "value" => 207, "text" => "0.1 mi" }
|
46
|
-
}
|
47
|
-
]
|
48
|
-
}
|
49
|
-
])
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|