geoplanet 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "geoplanet"
3
- s.version = "0.2.5"
4
- s.date = "2010-06-25"
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/"
@@ -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(';')}" if matrix_params.any?
21
- query_params = "?#{query_params.map{|k,v| "#{k}=#{v}"}.join('&')}" if query_params.any?
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
 
@@ -118,5 +118,9 @@ module GeoPlanet
118
118
  self.woeid.to_i
119
119
  end
120
120
 
121
+ def inspect
122
+ "#<GeoPlanet::Place #{instance_variables.map{|ivar| "#{ivar}: #{instance_variable_get(ivar).inspect}"}.join(', ')}>"
123
+ end
124
+
121
125
  end
122
126
  end
@@ -2,7 +2,7 @@ module GeoPlanet
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 5
5
+ TINY = 6
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
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-25 00:00:00 +02:00
18
+ date: 2010-06-30 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency