simple_geolocation 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/README +43 -0
- data/lib/simple_geolocation/version.rb +1 -1
- data/simple_geolocation.gemspec +1 -1
- metadata +3 -2
data/README
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
This gem was created with geolocation in mind, meaning that the main goal is to get a latitude and longitude, but it will return additional data if available. With this gem you can pass an IP number or an ZIP number or an ordinary address and it will try to get as many information as possible about the given argument.
|
2
|
+
|
3
|
+
* IMPORTANT: At this moment only brazilian zipcode is supported. Feel free to add suport for zip codes from other countries.
|
4
|
+
|
5
|
+
@usage
|
6
|
+
|
7
|
+
gem install simple_geolocation
|
8
|
+
require 'simple_geolocation'
|
9
|
+
|
10
|
+
# Using with IP.
|
11
|
+
location = SimpleGeolocation.Geocoder.new("74.125.113.104")
|
12
|
+
location.geocode!
|
13
|
+
geo.success? # => true
|
14
|
+
location.city # => "Mountain View"
|
15
|
+
location.state # => "CA"
|
16
|
+
location.lat # => 37.41919999999999
|
17
|
+
location.lng # => -122.0574
|
18
|
+
location.provider # => "geoip"
|
19
|
+
|
20
|
+
# Using with zipcode (Brazilian zipcode only)
|
21
|
+
geo = SimpleGeolocation.Geocoder.new("22640100")
|
22
|
+
geo.geocode!
|
23
|
+
geo.success? # => true
|
24
|
+
geo.street # => "Av. Das Américas"
|
25
|
+
geo.district # => "Barra da Tijuca"
|
26
|
+
geo.state # => "RJ"
|
27
|
+
geo.city # => "Rio De Janeiro"
|
28
|
+
geo.zip # => "22640-100"
|
29
|
+
geo.lat # => -23.0032808
|
30
|
+
geo.lng # => -43.3230295
|
31
|
+
|
32
|
+
|
33
|
+
# Using with standard address
|
34
|
+
geo = SimpleGeolocation::Geocoder.new("Rua do Principe, 199, Joinville, SC")
|
35
|
+
geo.geocode!
|
36
|
+
geo.success? # => true
|
37
|
+
geo.lat # => -26.30101
|
38
|
+
geo.lng # => -48.8452974
|
39
|
+
geo.completeness # => 88
|
40
|
+
|
41
|
+
|
42
|
+
The returned attributes are: lat, lng, city, state, provider, zip, street, district, number
|
43
|
+
|
data/simple_geolocation.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Esdras Mayrink"]
|
10
10
|
s.email = ["falecom@oesdras.com.br"]
|
11
|
-
s.homepage = "
|
11
|
+
s.homepage = "https://github.com/esdras/SimpleGeolocation"
|
12
12
|
s.summary = %q{A gem that fetch locations based on IP, ZIP and ordinary address through several existing geolocation gems.}
|
13
13
|
s.description = %q{
|
14
14
|
This gem is used with geolocation in mind, meaning that the main goal is to get a latitude and longitude, but it will return additional data if
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: simple_geolocation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Esdras Mayrink
|
@@ -80,6 +80,7 @@ extra_rdoc_files: []
|
|
80
80
|
files:
|
81
81
|
- .gitignore
|
82
82
|
- Gemfile
|
83
|
+
- README
|
83
84
|
- Rakefile
|
84
85
|
- lib/simple_geolocation.rb
|
85
86
|
- lib/simple_geolocation/geocoder.rb
|
@@ -95,7 +96,7 @@ files:
|
|
95
96
|
- simple_geolocation.gemspec
|
96
97
|
- spec/simple_geolocation_spec.rb
|
97
98
|
has_rdoc: true
|
98
|
-
homepage:
|
99
|
+
homepage: https://github.com/esdras/SimpleGeolocation
|
99
100
|
licenses: []
|
100
101
|
|
101
102
|
post_install_message:
|