atomist-rubington 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.txt +52 -0
- data/Rakefile +32 -0
- data/bin/rubington +8 -0
- data/lib/rubington.rb +51 -0
- data/lib/rubington/citizen_atlas.rb +111 -0
- data/spec/rubington_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- data/test/test_rubington.rb +0 -0
- metadata +84 -0
data/History.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
rubington
|
2
|
+
by Thomas Gallaway
|
3
|
+
http://www.atomlab.us/projects/rubington
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
The idea is to add dc & surrounding areas (VA&MD) services into a gem.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* CitizenAtlas is currently working
|
12
|
+
* Need to put some filter's in place to get less crap. XML is so ugly.
|
13
|
+
* Need to write tests!
|
14
|
+
|
15
|
+
== SYNOPSIS:
|
16
|
+
|
17
|
+
require 'rubington'
|
18
|
+
Rubington::CitizenAtlas.verify_dc_address_throu_string("1650 Harvard St")
|
19
|
+
|
20
|
+
== REQUIREMENTS:
|
21
|
+
|
22
|
+
* httparty
|
23
|
+
|
24
|
+
== INSTALL:
|
25
|
+
|
26
|
+
* gem sources -a http://gems.github.com
|
27
|
+
* sudo gem install atomist-rubington
|
28
|
+
|
29
|
+
== LICENSE:
|
30
|
+
|
31
|
+
(The MIT License)
|
32
|
+
|
33
|
+
Copyright (c) 2009 Thomas Gallaway
|
34
|
+
|
35
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
36
|
+
a copy of this software and associated documentation files (the
|
37
|
+
'Software'), to deal in the Software without restriction, including
|
38
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
39
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
40
|
+
permit persons to whom the Software is furnished to do so, subject to
|
41
|
+
the following conditions:
|
42
|
+
|
43
|
+
The above copyright notice and this permission notice shall be
|
44
|
+
included in all copies or substantial portions of the Software.
|
45
|
+
|
46
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
47
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
48
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
49
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
50
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
51
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
52
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Look in the tasks/setup.rb file for the various options that can be
|
2
|
+
# configured in this Rakefile. The .rake files in the tasks directory
|
3
|
+
# are where the options are used.
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'bones'
|
7
|
+
Bones.setup
|
8
|
+
rescue LoadError
|
9
|
+
begin
|
10
|
+
load 'tasks/setup.rb'
|
11
|
+
rescue LoadError
|
12
|
+
raise RuntimeError, '### please install the "bones" gem ###'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
ensure_in_path 'lib'
|
17
|
+
require 'rubington'
|
18
|
+
|
19
|
+
task :default => 'spec:run'
|
20
|
+
|
21
|
+
PROJ.name = 'rubington'
|
22
|
+
PROJ.authors = 'Thomas Gallaway'
|
23
|
+
PROJ.email = 'atomist@gmail.com'
|
24
|
+
PROJ.url = 'http://www.atomlab.us/projects/rubington'
|
25
|
+
PROJ.version = Rubington::VERSION
|
26
|
+
PROJ.rubyforge.name = 'rubington'
|
27
|
+
|
28
|
+
PROJ.ignore_file = '.gitignore'
|
29
|
+
|
30
|
+
PROJ.spec.opts << '--color'
|
31
|
+
|
32
|
+
# EOF
|
data/bin/rubington
ADDED
data/lib/rubington.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
module Rubington
|
5
|
+
|
6
|
+
# :stopdoc:
|
7
|
+
VERSION = '1.0.0'
|
8
|
+
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
9
|
+
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
10
|
+
# :startdoc:
|
11
|
+
|
12
|
+
# Returns the version string for the library.
|
13
|
+
#
|
14
|
+
def self.version
|
15
|
+
VERSION
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns the library path for the module. If any arguments are given,
|
19
|
+
# they will be joined to the end of the libray path using
|
20
|
+
# <tt>File.join</tt>.
|
21
|
+
#
|
22
|
+
def self.libpath( *args )
|
23
|
+
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns the lpath for the module. If any arguments are given,
|
27
|
+
# they will be joined to the end of the path using
|
28
|
+
# <tt>File.join</tt>.
|
29
|
+
#
|
30
|
+
def self.path( *args )
|
31
|
+
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Utility method used to require all files ending in .rb that lie in the
|
35
|
+
# directory below this file that has the same name as the filename passed
|
36
|
+
# in. Optionally, a specific _directory_ name can be passed in such that
|
37
|
+
# the _filename_ does not have to be equivalent to the directory.
|
38
|
+
#
|
39
|
+
def self.require_all_libs_relative_to( fname, dir = nil )
|
40
|
+
dir ||= ::File.basename(fname, '.*')
|
41
|
+
search_me = ::File.expand_path(
|
42
|
+
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
43
|
+
|
44
|
+
Dir.glob(search_me).sort.each {|rb| require rb}
|
45
|
+
end
|
46
|
+
|
47
|
+
end # module Rubington
|
48
|
+
|
49
|
+
Rubington.require_all_libs_relative_to(__FILE__)
|
50
|
+
|
51
|
+
# EOF
|
@@ -0,0 +1,111 @@
|
|
1
|
+
module Rubington
|
2
|
+
class CitizenAtlas
|
3
|
+
include HTTParty
|
4
|
+
base_uri 'citizenatlas.dc.gov/newwebservices/locationverifier.asmx'
|
5
|
+
format :xml
|
6
|
+
|
7
|
+
# Find Outside Location
|
8
|
+
def self.find_outside_location(location, city, state, zipcode)
|
9
|
+
self.query("/findOutsideLocation", {:location => location, :city => city, :state => state, :zipcode => zipcode})
|
10
|
+
end
|
11
|
+
|
12
|
+
# Find DC Block From Intersection
|
13
|
+
def self.find_dc_blk_from_intersection(crossstreet1, crossstreet2)
|
14
|
+
query('/findDCBlkFromIntersection', {:crossstreet1 => crossstreet1, :crossstreet2 => crossstreet2})
|
15
|
+
end
|
16
|
+
|
17
|
+
# Find add from ssl
|
18
|
+
def self.find_add_from_ssl(square, suffix, lot)
|
19
|
+
query('/findAddFromSSL', {:square => square, :suffix => suffix, :lot => lot})
|
20
|
+
end
|
21
|
+
|
22
|
+
# Find DC Intersection through String
|
23
|
+
def self.find_dc_inter_throu_string(intersection)
|
24
|
+
query('/findDCInterThrouString', {:intersection => intersection})
|
25
|
+
end
|
26
|
+
|
27
|
+
# Find Mini Marid from Marid
|
28
|
+
def self.find_mini_marid_from_marid(marid)
|
29
|
+
query('/findMiniMARIDFromMARID', {:marid => marid})
|
30
|
+
end
|
31
|
+
|
32
|
+
# Find DC Intersection through Components
|
33
|
+
def self.find_dc_inter_throu_components(crossstreet1, crossstreet2)
|
34
|
+
query('/findDCInterThrouComponents', {:crossstreet1 => crossstreet1, :crossstreet2 => crossstreet2})
|
35
|
+
end
|
36
|
+
# Find Marid from Mini Marid
|
37
|
+
def self.find_marid_from_mini_marid(minimarid)
|
38
|
+
query('/findMARIDFromMiniMARID', {:minimarid => minimarid})
|
39
|
+
end
|
40
|
+
|
41
|
+
# Find Condo Unit from Aid
|
42
|
+
def self.find_condo_unit_from_aid(aid)
|
43
|
+
query('/FindCondoUnitFromAID', {:aid => aid})
|
44
|
+
end
|
45
|
+
|
46
|
+
# Find find location
|
47
|
+
def self.find_location(str)
|
48
|
+
query('/findLocation', {:str => str})
|
49
|
+
end
|
50
|
+
|
51
|
+
# Find reverse geocoding
|
52
|
+
def self.reverse_geocoding(x, y)
|
53
|
+
query('/reverseGeocoding', {:x => x, :y => y})
|
54
|
+
end
|
55
|
+
|
56
|
+
# Verify DC Address through components
|
57
|
+
def self.verify_dc_address_throu_components(addnumber, addnumbersuffix, stname, sttype, quad)
|
58
|
+
query('/verifyDCAddressThrouComponents', {:addnumber => addnumber, :addnumbersuffix => addnumbersuffix, :stname => stname, :sttype => sttype, :quad => quad})
|
59
|
+
end
|
60
|
+
|
61
|
+
# Find ssl from Aid
|
62
|
+
def self.find_ssl_from_aid(aid)
|
63
|
+
query('/findSSLFromAID', {:aid => aid})
|
64
|
+
end
|
65
|
+
|
66
|
+
# Find alias from Aid
|
67
|
+
def self.find_alias_from_aid(aid)
|
68
|
+
query('/findAliasFromAID', {:aid => aid})
|
69
|
+
end
|
70
|
+
|
71
|
+
# Find in outside location
|
72
|
+
def self.find_in_outside_location(location, city, state, zipcode)
|
73
|
+
query('/findInOutsideLocation', {:location => location, :city => city, :state => state, :zipcode => zipcode})
|
74
|
+
end
|
75
|
+
|
76
|
+
# Find aid
|
77
|
+
def self.find_aid(aid)
|
78
|
+
query('/findAID', {:aid => aid})
|
79
|
+
end
|
80
|
+
|
81
|
+
# Find DC Block through Components
|
82
|
+
def self.find_dc_blk_throu_components(onstreet, fromstreet, tostreet)
|
83
|
+
query('/findDCBlkThrouComponents', {:onstreet => onstreet, :fromstreet => fromstreet, :tostreet => tostreet})
|
84
|
+
end
|
85
|
+
|
86
|
+
# Find ssl from square suffix
|
87
|
+
def self.find_ssl_from_square_suffix(square, suffix)
|
88
|
+
query('/findSSLFromSquareSuffix', {:square => square, :suffix => suffix})
|
89
|
+
end
|
90
|
+
|
91
|
+
# Find submit address
|
92
|
+
def self.submit_address(address, name, agency, phone, email, source, comment, withverification)
|
93
|
+
query('/submitAddress', {:address => address, :name => name, :agency => agency, :phone => phone, :email => email, :source => source, :comment => comment, :withverification => withverification})
|
94
|
+
end
|
95
|
+
|
96
|
+
# Verify DC address through string
|
97
|
+
def self.verify_dc_address_throu_string(address)
|
98
|
+
query('/verifyDCAddressThrouString', {:address => address})
|
99
|
+
end
|
100
|
+
|
101
|
+
# Find unit from aid
|
102
|
+
def self.find_unit_from_aid(aid)
|
103
|
+
query('/FindUnitFromAID', {:aid => aid})
|
104
|
+
end
|
105
|
+
|
106
|
+
# Performs the query and extracts the ReturnObject
|
107
|
+
def self.query(uri, query)
|
108
|
+
get(uri, :query => query)["ReturnObject"]
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
require File.expand_path(
|
3
|
+
File.join(File.dirname(__FILE__), %w[.. lib rubington]))
|
4
|
+
|
5
|
+
Spec::Runner.configure do |config|
|
6
|
+
# == Mock Framework
|
7
|
+
#
|
8
|
+
# RSpec uses it's own mocking framework by default. If you prefer to
|
9
|
+
# use mocha, flexmock or RR, uncomment the appropriate line:
|
10
|
+
#
|
11
|
+
# config.mock_with :mocha
|
12
|
+
# config.mock_with :flexmock
|
13
|
+
# config.mock_with :rr
|
14
|
+
end
|
15
|
+
|
16
|
+
# EOF
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: atomist-rubington
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Thomas Gallaway
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-21 00:00:00 -07:00
|
13
|
+
default_executable: rubington
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: bones
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.5.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: httparty
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.4.4
|
34
|
+
version:
|
35
|
+
description: The idea is to add dc & surrounding areas (VA&MD) services into a gem.
|
36
|
+
email: atomist@gmail.com
|
37
|
+
executables:
|
38
|
+
- rubington
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- History.txt
|
43
|
+
- README.txt
|
44
|
+
- bin/rubington
|
45
|
+
files:
|
46
|
+
- History.txt
|
47
|
+
- README.txt
|
48
|
+
- Rakefile
|
49
|
+
- bin/rubington
|
50
|
+
- lib/rubington.rb
|
51
|
+
- lib/rubington/citizen_atlas.rb
|
52
|
+
- spec/rubington_spec.rb
|
53
|
+
- spec/spec_helper.rb
|
54
|
+
- test/test_rubington.rb
|
55
|
+
has_rdoc: false
|
56
|
+
homepage: http://www.atomlab.us/projects/rubington
|
57
|
+
licenses:
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --main
|
61
|
+
- README.txt
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
version:
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
version:
|
76
|
+
requirements: []
|
77
|
+
|
78
|
+
rubyforge_project: rubington
|
79
|
+
rubygems_version: 1.3.5
|
80
|
+
signing_key:
|
81
|
+
specification_version: 3
|
82
|
+
summary: The idea is to add dc & surrounding areas (VA&MD) services into a gem
|
83
|
+
test_files:
|
84
|
+
- test/test_rubington.rb
|