geo_locator 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/geo_locator.rb +1 -0
- data/lib/geo_locator/version.rb +1 -1
- data/spec/geo_locator_spec.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6964af6982d53c2e42020945baad868c8a5e2808
|
4
|
+
data.tar.gz: 6f6fce62138237298cb32ead652da2bb6a062d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f07ebd402b310593e5b51ee93cc05e2a0fa6019e2a03bbf1a40c88898828293948b0373fab0f0d9a97ec32767e2b13bff81a90a5e6eb42f160cb2d9d97529fc1
|
7
|
+
data.tar.gz: c5fdc7b0e3d3781163e896f7a318365e2da8be09981680abcd6d4bb8c0f08517b935167c66008775467d6f95bbdbf3ec287c10b009603ea9f93d7dd46c75cb03
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GeoLocator
|
2
2
|
|
3
|
-
|
3
|
+
A gem which packages a offline database to geocode zip codes and locations without the need for an external web service.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,13 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
```ruby
|
22
|
+
$ irb
|
23
|
+
2.1.0 :001 > require "geo_locator"
|
24
|
+
=> true
|
25
|
+
2.1.0 :002 > GeoLocator.locate(zip_code: 12681)
|
26
|
+
=> [{:lat=>52.5392572203694, :lon=>13.5398499484887}]
|
27
|
+
```
|
22
28
|
|
23
29
|
## Contributing
|
24
30
|
|
data/lib/geo_locator.rb
CHANGED
data/lib/geo_locator/version.rb
CHANGED
data/spec/geo_locator_spec.rb
CHANGED
@@ -11,6 +11,10 @@ describe GeoLocator do
|
|
11
11
|
it "is a class level proxy for the class method _locate without the need for instantiation" do
|
12
12
|
expect(GeoLocator).to respond_to(:locate)
|
13
13
|
end
|
14
|
+
|
15
|
+
it "returns a array of geo locations if a zip_code is given" do
|
16
|
+
expect(GeoLocator.locate(zip_code: 33100)).to eq([{:lat=>51.7240488542403, :lon=>8.82975311690181}])
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
describe ".new" do
|
@@ -24,6 +28,10 @@ describe GeoLocator do
|
|
24
28
|
it "is an instance level proxy for the class method _locate" do
|
25
29
|
expect(geo_locator).to respond_to(:locate)
|
26
30
|
end
|
31
|
+
|
32
|
+
it "returns a array of geo locations if a zip_code is given" do
|
33
|
+
expect(GeoLocator.locate(zip_code: 33100)).to eq([{:lat=>51.7240488542403, :lon=>8.82975311690181}])
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
|
@@ -39,7 +47,6 @@ describe GeoLocator do
|
|
39
47
|
end
|
40
48
|
|
41
49
|
it "expects a sqlite3 database named geo_locator.sqlite3 in the gems root dir" do
|
42
|
-
#true # expect(File.exist?(File.expand_path("../geo_locator.sqlite3", File.dirname(__FILE__)))).to eq(true)
|
43
50
|
end
|
44
51
|
|
45
52
|
it "needs to be called with a database connection" do
|