graticule 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +4 -1
- data/lib/graticule/cli.rb +1 -1
- data/lib/graticule/version.rb +1 -1
- data/test/unit/graticule/cli_test.rb +26 -0
- metadata +3 -2
data/CHANGELOG.txt
CHANGED
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
|
data/lib/graticule/version.rb
CHANGED
@@ -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.
|
7
|
-
date: 2007-03-
|
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
|