geoplanet 0.2.5 → 0.2.6
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.rdoc +11 -4
- data/geoplanet.gemspec +2 -2
- data/lib/geoplanet/base.rb +2 -2
- data/lib/geoplanet/place.rb +4 -0
- data/lib/geoplanet/version.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
A Ruby wrapper for the Yahoo! GeoPlanet APIs. It's inspired on Mattt Thompson's yahoo-geoplanet gem,
|
4
4
|
but this version supports better usage of matrix and query parameters, uses JSON for API communication to minimize bandwidth usage, supports both short & long versions of a place, and supports multiple languages.
|
5
5
|
|
6
|
+
|
7
|
+
== INSTALL:
|
8
|
+
|
9
|
+
gem install geoplanet
|
10
|
+
|
11
|
+
|
6
12
|
== Usage
|
7
13
|
|
8
14
|
=== Searching for a Location:
|
@@ -44,6 +50,11 @@ but this version supports better usage of matrix and query parameters, uses JSON
|
|
44
50
|
# Latitude and Longitude are values at Centroid
|
45
51
|
a.bounding_box # [[36.109779, -5.47725], [36.164268, -5.43527]]
|
46
52
|
# Bounding box are SW / NE coordinates in array
|
53
|
+
a.pop_rank # 11
|
54
|
+
# Code representing population size
|
55
|
+
a.area_rank # 4
|
56
|
+
# Code representing the size of the place
|
57
|
+
# See codes at http://developer.yahoo.com/geo/geoplanet/guide/api_docs.html
|
47
58
|
|
48
59
|
# We unlock the true power of GeoPlanet with association collections
|
49
60
|
# Check out this truly amazing stuff:
|
@@ -94,10 +105,6 @@ Additionally, geoplanet has the following gem dependencies:
|
|
94
105
|
* json >= 1.1.3
|
95
106
|
|
96
107
|
|
97
|
-
== INSTALL:
|
98
|
-
|
99
|
-
gem install carlosparamio-geoplanet --source http://gems.github.com
|
100
|
-
|
101
108
|
== LICENSE:
|
102
109
|
|
103
110
|
(The MIT License)
|
data/geoplanet.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "geoplanet"
|
3
|
-
s.version = "0.2.
|
4
|
-
s.date = "2010-06-
|
3
|
+
s.version = "0.2.6"
|
4
|
+
s.date = "2010-06-30"
|
5
5
|
s.summary = "A Ruby wrapper for the Yahoo! GeoPlanet API."
|
6
6
|
s.email = "carlosparamio@gmail.com"
|
7
7
|
s.homepage = "http://github.com/carlosparamio/geoplanet/"
|
data/lib/geoplanet/base.rb
CHANGED
@@ -17,8 +17,8 @@ module GeoPlanet
|
|
17
17
|
|
18
18
|
query_string = q && type ? "$and(#{q},#{type})" : "#{q}#{type}"
|
19
19
|
|
20
|
-
matrix_params = ";#{matrix_params.map{|k,v| "#{k}=#{v}"}.join(';')}"
|
21
|
-
query_params = "?#{query_params.map{|k,v| "#{k}=#{v}"}.join('&')}"
|
20
|
+
matrix_params = matrix_params.any? ? ";#{matrix_params.map{|k,v| "#{k}=#{v}"}.join(';')}" : nil
|
21
|
+
query_params = query_params.any? ? "?#{query_params.map{|k,v| "#{k}=#{v}"}.join('&')}" : nil
|
22
22
|
|
23
23
|
query_string += "#{matrix_params}#{query_params}"
|
24
24
|
|
data/lib/geoplanet/place.rb
CHANGED
data/lib/geoplanet/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoplanet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Carlos Paramio
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-30 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|