graticule 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 0.2.10 (2009-04-17)
2
+ * Added #blank? to Location
3
+
1
4
  0.2.9 (2009-04-14)
2
5
  * Remove retired MapQuest geocoder
3
6
  * Slightly more aggressive error handling for Geocoder.us
@@ -21,6 +21,10 @@ module Graticule
21
21
  end
22
22
  end
23
23
 
24
+ def blank?
25
+ attributes.except(:precision).empty?
26
+ end
27
+
24
28
  # Returns an Array with latitude and longitude.
25
29
  def coordinates
26
30
  [latitude, longitude]
@@ -2,7 +2,7 @@ module Graticule #:nodoc:
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 9
5
+ TINY = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -62,5 +62,12 @@ module Graticule
62
62
  assert_equal "1600 Pennsylvania Avenue, NW\nWashington, DC 20500\nlatitude: 38.898748, longitude: -77.037684",
63
63
  @washington_dc.to_s(:country => false, :coordinates => true)
64
64
  end
65
+
66
+ def test_blank?
67
+ assert Location.new.blank?
68
+ [:latitude, :longitude, :street, :locality, :region, :postal_code, :country].each do |attr|
69
+ assert !Location.new(attr => 'Foo').blank?
70
+ end
71
+ end
65
72
  end
66
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graticule
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-14 00:00:00 -04:00
12
+ date: 2009-04-17 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency