graticule 0.2.0 → 0.2.1

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/CHANGELOG.txt CHANGED
@@ -1,4 +1,7 @@
1
- 0.2.0
1
+ 0.2.1 (2007-03-19)
2
+ * fixed error in command line interface
3
+
4
+ 0.2.0 (2007-03-17)
2
5
  * changed city to locality, state to region, and zip to postal_code
3
6
  * added support for PostcodeAnywhere
4
7
  * added support for Local Search Maps (James Stewart)
data/lib/graticule/cli.rb CHANGED
@@ -45,7 +45,7 @@ module Graticule
45
45
  result = Graticule.service(options[:service]).new(options[:api_key]).locate(options[:location])
46
46
  location = (result.is_a?(Array) ? result.first : result)
47
47
  if location
48
- puts location.to_s(true)
48
+ puts location.to_s(:coordinates => true)
49
49
  else
50
50
  puts "Location not found"
51
51
  end
@@ -2,7 +2,7 @@ module Graticule #:nodoc:
2
2
  module Version #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,26 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+ require 'graticule/cli'
3
+
4
+ module Graticule
5
+ class CliTest < Test::Unit::TestCase
6
+
7
+ def setup
8
+ URI::HTTP.responses = []
9
+ URI::HTTP.uris = []
10
+ end
11
+
12
+ def test_start
13
+ prepare_response(:success)
14
+ Kernel.expects(:puts)
15
+ Kernel.stubs(:puts)
16
+ result = Graticule::Cli.start ['-s', 'yahoo', '-a', 'YahooDemo', 'Saugatuck,', 'MI']
17
+ end
18
+
19
+ protected
20
+
21
+ def prepare_response(id)
22
+ URI::HTTP.responses << response('yahoo', id)
23
+ end
24
+
25
+ end
26
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: graticule
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-03-17 00:00:00 -04:00
6
+ version: 0.2.1
7
+ date: 2007-03-19 00:00:00 -04:00
8
8
  summary: API for using all the popular geocoding services.
9
9
  require_paths:
10
10
  - lib
@@ -91,6 +91,7 @@ files:
91
91
  - test/unit/graticule/geocoder_test.rb
92
92
  - test/unit/graticule/location_test.rb
93
93
  test_files:
94
+ - test/unit/graticule/cli_test.rb
94
95
  - test/unit/graticule/distance_test.rb
95
96
  - test/unit/graticule/geocoder_test.rb
96
97
  - test/unit/graticule/location_test.rb