graticule 2.3.0 → 2.4.0
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/.autotest +13 -0
- data/.gitignore +10 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.txt +4 -1
- data/Gemfile +7 -0
- data/LICENSE.txt +1 -1
- data/README.md +122 -0
- data/Rakefile +78 -0
- data/graticule.gemspec +26 -0
- data/lib/graticule/cli.rb +3 -1
- data/lib/graticule/geocoder/google.rb +33 -4
- data/lib/graticule/geocoder/mapquest.rb +52 -59
- data/lib/graticule/precision.rb +3 -1
- data/lib/graticule/version.rb +1 -1
- data/site/index.html +114 -0
- data/site/plugin.html +82 -0
- data/site/stylesheets/style.css +69 -0
- data/test/config.yml.default +33 -0
- data/test/fixtures/responses/freethepostcode/not_found.txt +3 -0
- data/test/fixtures/responses/freethepostcode/success.txt +2 -0
- data/test/fixtures/responses/geocoder_ca/success.xml +12 -0
- data/test/fixtures/responses/geocoder_us/success.xml +8 -0
- data/test/fixtures/responses/geocoder_us/unknown.xml +1 -0
- data/test/fixtures/responses/geonames/missing.xml +4 -0
- data/test/fixtures/responses/geonames/success.xml +14 -0
- data/test/fixtures/responses/geonames/unknown.xml +4 -0
- data/test/fixtures/responses/google/address.json +64 -0
- data/test/fixtures/responses/google/badkey.json +4 -0
- data/test/fixtures/responses/google/country.json +43 -0
- data/test/fixtures/responses/google/limit.json +4 -0
- data/test/fixtures/responses/google/locality.json +58 -0
- data/test/fixtures/responses/google/region.json +48 -0
- data/test/fixtures/responses/google/server_error.json +4 -0
- data/test/fixtures/responses/google/street.json +58 -0
- data/test/fixtures/responses/google/success.json +64 -0
- data/test/fixtures/responses/google/success_multiple_results.json +68 -0
- data/test/fixtures/responses/google/zero_results.json +4 -0
- data/test/fixtures/responses/host_ip/private.txt +4 -0
- data/test/fixtures/responses/host_ip/success.txt +4 -0
- data/test/fixtures/responses/host_ip/unknown.txt +4 -0
- data/test/fixtures/responses/local_search_maps/empty.txt +1 -0
- data/test/fixtures/responses/local_search_maps/not_found.txt +1 -0
- data/test/fixtures/responses/local_search_maps/success.txt +1 -0
- data/test/fixtures/responses/mapquest/multi_result.xml +317 -0
- data/test/fixtures/responses/mapquest/success.xml +54 -0
- data/test/fixtures/responses/multimap/missing_params.xml +4 -0
- data/test/fixtures/responses/multimap/no_matches.xml +4 -0
- data/test/fixtures/responses/multimap/success.xml +19 -0
- data/test/fixtures/responses/simple_geo/error.json +4 -0
- data/test/fixtures/responses/simple_geo/success.json +255 -0
- data/test/fixtures/responses/yahoo/success.xml +3 -0
- data/test/fixtures/responses/yahoo/unknown_address.xml +6 -0
- data/test/fixtures/responses/yandex/badkey.xml +5 -0
- data/test/fixtures/responses/yandex/success.xml +204 -0
- data/test/graticule/distance_test.rb +59 -0
- data/test/graticule/geocoder/freethepostcode_test.rb +37 -0
- data/test/graticule/geocoder/geocoder_ca_test.rb +42 -0
- data/test/graticule/geocoder/geocoder_us_test.rb +44 -0
- data/test/graticule/geocoder/geocoders.rb +56 -0
- data/test/graticule/geocoder/geonames_test.rb +56 -0
- data/test/graticule/geocoder/google_signed_test.rb +19 -0
- data/test/graticule/geocoder/google_test.rb +138 -0
- data/test/graticule/geocoder/host_ip_test.rb +41 -0
- data/test/graticule/geocoder/local_search_maps_test.rb +31 -0
- data/test/graticule/geocoder/mapquest_test.rb +56 -0
- data/test/graticule/geocoder/multi_test.rb +52 -0
- data/test/graticule/geocoder/multimap_test.rb +53 -0
- data/test/graticule/geocoder/simple_geo_test.rb +45 -0
- data/test/graticule/geocoder/yahoo_test.rb +50 -0
- data/test/graticule/geocoder/yandex_test.rb +42 -0
- data/test/graticule/geocoder_test.rb +24 -0
- data/test/graticule/location_test.rb +79 -0
- data/test/graticule/precision_test.rb +38 -0
- data/test/mocks/uri.rb +53 -0
- data/test/test_helper.rb +32 -0
- metadata +147 -75
- data/README.textile +0 -64
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
module Graticule
|
5
|
+
class PrecisionTest < Test::Unit::TestCase
|
6
|
+
def test_constants_exist
|
7
|
+
%w(
|
8
|
+
Unknown
|
9
|
+
Country
|
10
|
+
Region
|
11
|
+
Locality
|
12
|
+
PostalCode
|
13
|
+
Street
|
14
|
+
Address
|
15
|
+
Premise
|
16
|
+
).each do |const|
|
17
|
+
assert Precision.const_defined?(const), "Can't find #{const}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_can_compare_precisions
|
22
|
+
assert Precision::Country < Precision::Region
|
23
|
+
assert Precision::Country > Precision::Unknown
|
24
|
+
assert Precision::Country == Precision::Country
|
25
|
+
assert Precision::Country == Precision.new(:country)
|
26
|
+
assert Precision::Country != Precision::Premise
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_can_compare_against_symbols
|
30
|
+
assert Precision::Country < :region
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_can_compare_against_symbols
|
34
|
+
assert_raise(ArgumentError) { Precision::Unknown > :foo }
|
35
|
+
assert_raise(ArgumentError) { Precision::Unknown == :bar }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/test/mocks/uri.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'uri/http'
|
3
|
+
require 'open-uri'
|
4
|
+
|
5
|
+
##
|
6
|
+
# This stub overrides OpenURI's open method to allow programs that use OpenURI
|
7
|
+
# to be easily tested.
|
8
|
+
#
|
9
|
+
# == Usage
|
10
|
+
#
|
11
|
+
# require 'rc_rest/uri_stub'
|
12
|
+
#
|
13
|
+
# class TestMyClass < Test::Unit::TestCase
|
14
|
+
#
|
15
|
+
# def setup
|
16
|
+
# URI::HTTP.responses = []
|
17
|
+
# URI::HTTP.uris = []
|
18
|
+
#
|
19
|
+
# @obj = MyClass.new
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# def test_my_method
|
23
|
+
# URI::HTTP.responses << 'some text open would ordinarily return'
|
24
|
+
#
|
25
|
+
# result = @obj.my_method
|
26
|
+
#
|
27
|
+
# assert_equal :something_meaninfgul, result
|
28
|
+
#
|
29
|
+
# assert_equal true, URI::HTTP.responses.empty?
|
30
|
+
# assert_equal 1, URI::HTTP.uris.length
|
31
|
+
# assert_equal 'http://example.com/path', URI::HTTP.uris.first
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# end
|
35
|
+
|
36
|
+
class URI::HTTP # :nodoc:
|
37
|
+
|
38
|
+
class << self
|
39
|
+
attr_accessor :responses, :uris
|
40
|
+
end
|
41
|
+
|
42
|
+
alias original_open open
|
43
|
+
|
44
|
+
def open(*args)
|
45
|
+
self.class.uris << self.to_s
|
46
|
+
io = StringIO.new(self.class.responses.shift)
|
47
|
+
OpenURI::Meta.init(io)
|
48
|
+
yield io if block_given?
|
49
|
+
io
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'test/unit'
|
7
|
+
require 'graticule'
|
8
|
+
require 'mocha/setup'
|
9
|
+
require 'mocks/uri'
|
10
|
+
|
11
|
+
TEST_RESPONSE_PATH = File.dirname(__FILE__) + '/fixtures/responses'
|
12
|
+
|
13
|
+
module Test
|
14
|
+
module Unit
|
15
|
+
module Assertions
|
16
|
+
|
17
|
+
private
|
18
|
+
def response(geocoder, response, extension = 'xml')
|
19
|
+
clean_backtrace do
|
20
|
+
File.read(File.dirname(__FILE__) + "/fixtures/responses/#{geocoder}/#{response}.#{extension}")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def clean_backtrace(&block)
|
25
|
+
yield
|
26
|
+
rescue AssertionFailedError => e
|
27
|
+
path = File.expand_path(__FILE__)
|
28
|
+
raise AssertionFailedError, e.message, e.backtrace.reject { |line| File.expand_path(line) =~ /#{path}/ }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graticule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brandon Keepers
|
9
9
|
- Daniel Morrison
|
10
|
+
- Collective Idea
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2013-
|
14
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: activesupport
|
@@ -44,22 +45,6 @@ dependencies:
|
|
44
45
|
- - ! '>='
|
45
46
|
- !ruby/object:Gem::Version
|
46
47
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: htmlentities
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
type: :runtime
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ! '>='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
48
|
- !ruby/object:Gem::Dependency
|
64
49
|
name: happymapper
|
65
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,54 +77,35 @@ dependencies:
|
|
92
77
|
- - ! '>='
|
93
78
|
- !ruby/object:Gem::Version
|
94
79
|
version: '0'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: mocha
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
|
-
requirements:
|
100
|
-
- - ! '>='
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
|
-
requirements:
|
108
|
-
- - ! '>='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rcov
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
|
-
requirements:
|
116
|
-
- - ! '>='
|
117
|
-
- !ruby/object:Gem::Version
|
118
|
-
version: '0'
|
119
|
-
type: :development
|
120
|
-
prerelease: false
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
|
-
requirements:
|
124
|
-
- - ! '>='
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: '0'
|
127
80
|
description: Graticule is a geocoding API that provides a common interface to all
|
128
81
|
the popular services, including Google, Yahoo, Geocoder.us, and MetaCarta.
|
129
|
-
email:
|
82
|
+
email:
|
83
|
+
- brandon@opensoul.org
|
84
|
+
- daniel@collectiveidea.com
|
85
|
+
- code@collectiveidea.com
|
130
86
|
executables:
|
131
87
|
- geocode
|
132
88
|
extensions: []
|
133
|
-
extra_rdoc_files:
|
134
|
-
- README.textile
|
89
|
+
extra_rdoc_files: []
|
135
90
|
files:
|
91
|
+
- .autotest
|
92
|
+
- .gitignore
|
93
|
+
- .travis.yml
|
94
|
+
- CHANGELOG.txt
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
136
99
|
- bin/geocode
|
100
|
+
- graticule.gemspec
|
101
|
+
- lib/graticule.rb
|
137
102
|
- lib/graticule/cli.rb
|
138
103
|
- lib/graticule/core_ext.rb
|
104
|
+
- lib/graticule/distance.rb
|
139
105
|
- lib/graticule/distance/haversine.rb
|
140
106
|
- lib/graticule/distance/spherical.rb
|
141
107
|
- lib/graticule/distance/vincenty.rb
|
142
|
-
- lib/graticule/
|
108
|
+
- lib/graticule/geocoder.rb
|
143
109
|
- lib/graticule/geocoder/base.rb
|
144
110
|
- lib/graticule/geocoder/bogus.rb
|
145
111
|
- lib/graticule/geocoder/freethepostcode.rb
|
@@ -155,22 +121,75 @@ files:
|
|
155
121
|
- lib/graticule/geocoder/simple_geo.rb
|
156
122
|
- lib/graticule/geocoder/yahoo.rb
|
157
123
|
- lib/graticule/geocoder/yandex.rb
|
158
|
-
- lib/graticule/geocoder.rb
|
159
124
|
- lib/graticule/location.rb
|
160
125
|
- lib/graticule/precision.rb
|
161
126
|
- lib/graticule/version.rb
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
166
|
-
|
167
|
-
|
127
|
+
- site/index.html
|
128
|
+
- site/plugin.html
|
129
|
+
- site/stylesheets/style.css
|
130
|
+
- test/config.yml.default
|
131
|
+
- test/fixtures/responses/freethepostcode/not_found.txt
|
132
|
+
- test/fixtures/responses/freethepostcode/success.txt
|
133
|
+
- test/fixtures/responses/geocoder_ca/success.xml
|
134
|
+
- test/fixtures/responses/geocoder_us/success.xml
|
135
|
+
- test/fixtures/responses/geocoder_us/unknown.xml
|
136
|
+
- test/fixtures/responses/geonames/missing.xml
|
137
|
+
- test/fixtures/responses/geonames/success.xml
|
138
|
+
- test/fixtures/responses/geonames/unknown.xml
|
139
|
+
- test/fixtures/responses/google/address.json
|
140
|
+
- test/fixtures/responses/google/badkey.json
|
141
|
+
- test/fixtures/responses/google/country.json
|
142
|
+
- test/fixtures/responses/google/limit.json
|
143
|
+
- test/fixtures/responses/google/locality.json
|
144
|
+
- test/fixtures/responses/google/region.json
|
145
|
+
- test/fixtures/responses/google/server_error.json
|
146
|
+
- test/fixtures/responses/google/street.json
|
147
|
+
- test/fixtures/responses/google/success.json
|
148
|
+
- test/fixtures/responses/google/success_multiple_results.json
|
149
|
+
- test/fixtures/responses/google/zero_results.json
|
150
|
+
- test/fixtures/responses/host_ip/private.txt
|
151
|
+
- test/fixtures/responses/host_ip/success.txt
|
152
|
+
- test/fixtures/responses/host_ip/unknown.txt
|
153
|
+
- test/fixtures/responses/local_search_maps/empty.txt
|
154
|
+
- test/fixtures/responses/local_search_maps/not_found.txt
|
155
|
+
- test/fixtures/responses/local_search_maps/success.txt
|
156
|
+
- test/fixtures/responses/mapquest/multi_result.xml
|
157
|
+
- test/fixtures/responses/mapquest/success.xml
|
158
|
+
- test/fixtures/responses/multimap/missing_params.xml
|
159
|
+
- test/fixtures/responses/multimap/no_matches.xml
|
160
|
+
- test/fixtures/responses/multimap/success.xml
|
161
|
+
- test/fixtures/responses/simple_geo/error.json
|
162
|
+
- test/fixtures/responses/simple_geo/success.json
|
163
|
+
- test/fixtures/responses/yahoo/success.xml
|
164
|
+
- test/fixtures/responses/yahoo/unknown_address.xml
|
165
|
+
- test/fixtures/responses/yandex/badkey.xml
|
166
|
+
- test/fixtures/responses/yandex/success.xml
|
167
|
+
- test/graticule/distance_test.rb
|
168
|
+
- test/graticule/geocoder/freethepostcode_test.rb
|
169
|
+
- test/graticule/geocoder/geocoder_ca_test.rb
|
170
|
+
- test/graticule/geocoder/geocoder_us_test.rb
|
171
|
+
- test/graticule/geocoder/geocoders.rb
|
172
|
+
- test/graticule/geocoder/geonames_test.rb
|
173
|
+
- test/graticule/geocoder/google_signed_test.rb
|
174
|
+
- test/graticule/geocoder/google_test.rb
|
175
|
+
- test/graticule/geocoder/host_ip_test.rb
|
176
|
+
- test/graticule/geocoder/local_search_maps_test.rb
|
177
|
+
- test/graticule/geocoder/mapquest_test.rb
|
178
|
+
- test/graticule/geocoder/multi_test.rb
|
179
|
+
- test/graticule/geocoder/multimap_test.rb
|
180
|
+
- test/graticule/geocoder/simple_geo_test.rb
|
181
|
+
- test/graticule/geocoder/yahoo_test.rb
|
182
|
+
- test/graticule/geocoder/yandex_test.rb
|
183
|
+
- test/graticule/geocoder_test.rb
|
184
|
+
- test/graticule/location_test.rb
|
185
|
+
- test/graticule/precision_test.rb
|
186
|
+
- test/mocks/uri.rb
|
187
|
+
- test/test_helper.rb
|
188
|
+
homepage: https://github.com/collectiveidea/graticule
|
189
|
+
licenses:
|
190
|
+
- MIT
|
168
191
|
post_install_message:
|
169
|
-
rdoc_options:
|
170
|
-
- --main
|
171
|
-
- README.rdoc
|
172
|
-
- --inline-source
|
173
|
-
- --line-numbers
|
192
|
+
rdoc_options: []
|
174
193
|
require_paths:
|
175
194
|
- lib
|
176
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -179,22 +198,75 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
198
|
- - ! '>='
|
180
199
|
- !ruby/object:Gem::Version
|
181
200
|
version: '0'
|
182
|
-
segments:
|
183
|
-
- 0
|
184
|
-
hash: 3804880588215325222
|
185
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
202
|
none: false
|
187
203
|
requirements:
|
188
204
|
- - ! '>='
|
189
205
|
- !ruby/object:Gem::Version
|
190
206
|
version: '0'
|
191
|
-
segments:
|
192
|
-
- 0
|
193
|
-
hash: 3804880588215325222
|
194
207
|
requirements: []
|
195
|
-
rubyforge_project:
|
208
|
+
rubyforge_project:
|
196
209
|
rubygems_version: 1.8.25
|
197
210
|
signing_key:
|
198
211
|
specification_version: 3
|
199
|
-
summary: API for using all the popular geocoding services
|
200
|
-
test_files:
|
212
|
+
summary: API for using all the popular geocoding services
|
213
|
+
test_files:
|
214
|
+
- test/config.yml.default
|
215
|
+
- test/fixtures/responses/freethepostcode/not_found.txt
|
216
|
+
- test/fixtures/responses/freethepostcode/success.txt
|
217
|
+
- test/fixtures/responses/geocoder_ca/success.xml
|
218
|
+
- test/fixtures/responses/geocoder_us/success.xml
|
219
|
+
- test/fixtures/responses/geocoder_us/unknown.xml
|
220
|
+
- test/fixtures/responses/geonames/missing.xml
|
221
|
+
- test/fixtures/responses/geonames/success.xml
|
222
|
+
- test/fixtures/responses/geonames/unknown.xml
|
223
|
+
- test/fixtures/responses/google/address.json
|
224
|
+
- test/fixtures/responses/google/badkey.json
|
225
|
+
- test/fixtures/responses/google/country.json
|
226
|
+
- test/fixtures/responses/google/limit.json
|
227
|
+
- test/fixtures/responses/google/locality.json
|
228
|
+
- test/fixtures/responses/google/region.json
|
229
|
+
- test/fixtures/responses/google/server_error.json
|
230
|
+
- test/fixtures/responses/google/street.json
|
231
|
+
- test/fixtures/responses/google/success.json
|
232
|
+
- test/fixtures/responses/google/success_multiple_results.json
|
233
|
+
- test/fixtures/responses/google/zero_results.json
|
234
|
+
- test/fixtures/responses/host_ip/private.txt
|
235
|
+
- test/fixtures/responses/host_ip/success.txt
|
236
|
+
- test/fixtures/responses/host_ip/unknown.txt
|
237
|
+
- test/fixtures/responses/local_search_maps/empty.txt
|
238
|
+
- test/fixtures/responses/local_search_maps/not_found.txt
|
239
|
+
- test/fixtures/responses/local_search_maps/success.txt
|
240
|
+
- test/fixtures/responses/mapquest/multi_result.xml
|
241
|
+
- test/fixtures/responses/mapquest/success.xml
|
242
|
+
- test/fixtures/responses/multimap/missing_params.xml
|
243
|
+
- test/fixtures/responses/multimap/no_matches.xml
|
244
|
+
- test/fixtures/responses/multimap/success.xml
|
245
|
+
- test/fixtures/responses/simple_geo/error.json
|
246
|
+
- test/fixtures/responses/simple_geo/success.json
|
247
|
+
- test/fixtures/responses/yahoo/success.xml
|
248
|
+
- test/fixtures/responses/yahoo/unknown_address.xml
|
249
|
+
- test/fixtures/responses/yandex/badkey.xml
|
250
|
+
- test/fixtures/responses/yandex/success.xml
|
251
|
+
- test/graticule/distance_test.rb
|
252
|
+
- test/graticule/geocoder/freethepostcode_test.rb
|
253
|
+
- test/graticule/geocoder/geocoder_ca_test.rb
|
254
|
+
- test/graticule/geocoder/geocoder_us_test.rb
|
255
|
+
- test/graticule/geocoder/geocoders.rb
|
256
|
+
- test/graticule/geocoder/geonames_test.rb
|
257
|
+
- test/graticule/geocoder/google_signed_test.rb
|
258
|
+
- test/graticule/geocoder/google_test.rb
|
259
|
+
- test/graticule/geocoder/host_ip_test.rb
|
260
|
+
- test/graticule/geocoder/local_search_maps_test.rb
|
261
|
+
- test/graticule/geocoder/mapquest_test.rb
|
262
|
+
- test/graticule/geocoder/multi_test.rb
|
263
|
+
- test/graticule/geocoder/multimap_test.rb
|
264
|
+
- test/graticule/geocoder/simple_geo_test.rb
|
265
|
+
- test/graticule/geocoder/yahoo_test.rb
|
266
|
+
- test/graticule/geocoder/yandex_test.rb
|
267
|
+
- test/graticule/geocoder_test.rb
|
268
|
+
- test/graticule/location_test.rb
|
269
|
+
- test/graticule/precision_test.rb
|
270
|
+
- test/mocks/uri.rb
|
271
|
+
- test/test_helper.rb
|
272
|
+
has_rdoc:
|
data/README.textile
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
h1. Graticule
|
2
|
-
|
3
|
-
Graticule is a geocoding API for looking up address coordinates. It supports many popular APIs, including Yahoo, Google, Yandex, Geocoder.ca and Geocoder.us.
|
4
|
-
|
5
|
-
h2. Usage
|
6
|
-
|
7
|
-
<pre><code>require 'rubygems'
|
8
|
-
require 'graticule'
|
9
|
-
geocoder = Graticule.service(:google).new "api_key"
|
10
|
-
location = geocoder.locate "61 East 9th Street, Holland, MI"</code></pre>
|
11
|
-
|
12
|
-
h2. Distance Calculation
|
13
|
-
|
14
|
-
Graticule includes 3 different distance formulas, Spherical (simplest but least accurate), Vincenty (most accurate and most complicated), and Haversine (somewhere inbetween).
|
15
|
-
|
16
|
-
<pre><code>geocoder.locate("Holland, MI").distance_to(geocoder.locate("Chicago, IL"))
|
17
|
-
#=> 101.997458788177</code></pre>
|
18
|
-
|
19
|
-
h2. Command Line
|
20
|
-
|
21
|
-
Graticule includes a command line interface (CLI).
|
22
|
-
|
23
|
-
<pre><code>$ geocode -s yahoo -a yahookey Washington, DC
|
24
|
-
Washington, DC US
|
25
|
-
latitude: 38.895222, longitude: -77.036758</code></pre>
|
26
|
-
|
27
|
-
h2. Mailing List
|
28
|
-
|
29
|
-
Join us on the "mailing list":http://groups.google.com/group/graticule.
|
30
|
-
|
31
|
-
h2. Contributing
|
32
|
-
|
33
|
-
In the spirit of "free software":http://www.fsf.org/licensing/essays/free-sw.html, **everyone** is encouraged to help improve this project.
|
34
|
-
|
35
|
-
Here are some ways *you* can contribute:
|
36
|
-
|
37
|
-
* using alpha, beta, and prerelease versions
|
38
|
-
* reporting bugs
|
39
|
-
* suggesting new features
|
40
|
-
* writing or editing documentation
|
41
|
-
* writing specifications
|
42
|
-
* writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
|
43
|
-
* refactoring code
|
44
|
-
* closing "issues":https://github.com/collectiveidea/graticule/issues
|
45
|
-
* reviewing patches
|
46
|
-
|
47
|
-
h2. Submitting an Issue
|
48
|
-
|
49
|
-
We use the "GitHub issue tracker":https://github.com/collectiveidea/graticule/issues to track bugs
|
50
|
-
and features. Before submitting a bug report or feature request, check to make sure it hasn't already
|
51
|
-
been submitted. You can indicate support for an existing issuse by voting it up. When submitting a
|
52
|
-
bug report, please include a "Gist":https://gist.github.com/ that includes a stack trace and any
|
53
|
-
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
54
|
-
operating system. Ideally, a bug report should include a pull request with failing specs.
|
55
|
-
|
56
|
-
h2. Submitting a Pull Request
|
57
|
-
|
58
|
-
1. Fork the project.
|
59
|
-
2. Create a topic branch.
|
60
|
-
3. Implement your feature or bug fix.
|
61
|
-
4. Add specs for your feature or bug fix.
|
62
|
-
5. Run @bundle exec rake@. If your changes are not 100% covered and passing, go back to step 4.
|
63
|
-
6. Commit and push your changes.
|
64
|
-
7. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
|