geofips 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ require 'geofips'
2
+
3
+ describe Geofips do
4
+ describe Geofips::Location
5
+ subject { Geofips::Location.new(fips_code) }
6
+
7
+ let(:fips_code) { "002020" }
8
+ let(:rows) {[{
9
+ fips: fips_code,
10
+ lat: 32.5349,
11
+ lng: -86.6428,
12
+ ne_lat: 32.708213,
13
+ ne_lng: -86.4111719,
14
+ sw_lat: 32.3075739,
15
+ sw_lng: -86.9212369
16
+ }]}
17
+
18
+ before do
19
+ CSV.stub(:read).and_return(rows)
20
+ end
21
+
22
+ its(:lat) { should == rows.first[:lat] }
23
+ its(:lng) { should == rows.first[:lng] }
24
+ its(:ne_lat) { should == rows.first[:ne_lat] }
25
+ its(:ne_lng) { should == rows.first[:ne_lng] }
26
+ its(:sw_lat) { should == rows.first[:sw_lat] }
27
+ its(:sw_lng) { should == rows.first[:sw_lng] }
28
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: geofips
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Cameron Cundiff
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70290063984620 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.9.0
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70290063984620
25
+ description: Get latitude and longitude coordinates and bounds from FIPS location
26
+ codes
27
+ email:
28
+ - ckundo@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - Gemfile
35
+ - Rakefile
36
+ - geofips.gemspec
37
+ - lib/geofips.rb
38
+ - lib/geofips/version.rb
39
+ - lib/locations.csv
40
+ - spec/geofips_spec.rb
41
+ homepage: ''
42
+ licenses: []
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project: geofips
61
+ rubygems_version: 1.8.16
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: FIPS location codes to geo coordinates
65
+ test_files:
66
+ - spec/geofips_spec.rb