geokit-rails 1.1.4 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of geokit-rails might be problematic. Click here for more details.
- checksums.yaml +15 -0
- data/lib/geokit-rails.rb +10 -26
- data/lib/geokit-rails/acts_as_mappable.rb +269 -369
- data/lib/geokit-rails/adapters/mysql2.rb +22 -0
- data/lib/geokit-rails/adapters/sqlite.rb +53 -0
- data/lib/geokit-rails/core_extensions.rb +10 -0
- data/lib/geokit-rails/defaults.rb +0 -1
- data/lib/geokit-rails/geocoder_control.rb +11 -9
- data/lib/geokit-rails/ip_geocode_lookup.rb +2 -4
- data/lib/geokit-rails/railtie.rb +38 -0
- data/lib/geokit-rails/version.rb +3 -0
- data/test/acts_as_mappable_test.rb +236 -281
- data/test/boot.rb +20 -13
- data/test/database.yml +10 -6
- data/test/{ip_geocode_lookup_test.rb → ip_geocode_lookup_test.disabled.rb} +7 -2
- data/test/models/mock_family.rb +2 -0
- data/test/models/mock_organization.rb +2 -0
- data/test/models/mock_person.rb +3 -0
- data/test/sqlite-debug.log +1293 -0
- data/test/tasks.rake +16 -10
- data/test/test.sqlite3 +0 -0
- data/test/test_helper.rb +26 -5
- metadata +223 -126
- data/CHANGELOG.rdoc +0 -46
- data/MIT-LICENSE +0 -20
- data/Manifest.txt +0 -44
- data/README.markdown +0 -561
- data/Rakefile +0 -54
- data/about.yml +0 -9
- data/assets/api_keys_template +0 -61
- data/geokit-rails.gemspec +0 -39
- data/init.rb +0 -1
- data/install.rb +0 -14
data/Rakefile
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
|
5
|
-
load 'test/tasks.rake'
|
6
|
-
|
7
|
-
desc 'Default: run unit tests.'
|
8
|
-
task :default => :test
|
9
|
-
|
10
|
-
desc 'Generate documentation for the GeoKit plugin.'
|
11
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
12
|
-
rdoc.rdoc_dir = 'rdoc'
|
13
|
-
rdoc.title = 'GeoKit'
|
14
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
15
|
-
rdoc.rdoc_files.include('README')
|
16
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
17
|
-
end
|
18
|
-
|
19
|
-
require 'yaml'
|
20
|
-
about = YAML.load(IO.read('about.yml'))
|
21
|
-
|
22
|
-
%w[rubygems hoe].each { |f| require f }
|
23
|
-
|
24
|
-
# Generate all the Rake tasks
|
25
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
26
|
-
$hoe = Hoe.spec('geokit-rails') do |p|
|
27
|
-
p.version = about['version']
|
28
|
-
p.developer("Andre Lewis", "andre@earthcode.com")
|
29
|
-
p.developer("Bill Eisenhauer", "bill@billeisenhauer.com")
|
30
|
-
p.changes = p.paragraphs_of("CHANGELOG.rdoc", 0..1).join("\n\n")
|
31
|
-
p.summary = about['summary']
|
32
|
-
|
33
|
-
p.rubyforge_name = p.name # TODO this is default value
|
34
|
-
p.extra_deps = [
|
35
|
-
['geokit', '>= 1.5.0']
|
36
|
-
]
|
37
|
-
|
38
|
-
p.clean_globs |= %w[**/.DS_Store tmp *.log]
|
39
|
-
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
40
|
-
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
41
|
-
p.rsync_args = '-av --delete --ignore-errors'
|
42
|
-
end
|
43
|
-
|
44
|
-
desc 'Recreate Manifest.txt to include ALL files'
|
45
|
-
task :manifest do
|
46
|
-
`rake check_manifest | grep -v "^\(in" | patch -p0`
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Generate a #{$hoe.name}.gemspec file"
|
50
|
-
task :gemspec do
|
51
|
-
File.open("#{$hoe.name}.gemspec", "w") do |file|
|
52
|
-
file.puts $hoe.spec.to_ruby
|
53
|
-
end
|
54
|
-
end
|
data/about.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
author:
|
2
|
-
name_1: Bill Eisenhauer
|
3
|
-
homepage_1: http://blog.billeisenhauer.com
|
4
|
-
name_2: Andre Lewis
|
5
|
-
homepage_2: http://www.earthcode.com
|
6
|
-
summary: Geo distance calculations, distance calculation query support, geocoding for physical and ip addresses.
|
7
|
-
version: 1.1.4
|
8
|
-
rails_version: 1.0+
|
9
|
-
license: MIT
|
data/assets/api_keys_template
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
if defined? Geokit
|
2
|
-
|
3
|
-
# These defaults are used in Geokit::Mappable.distance_to and in acts_as_mappable
|
4
|
-
Geokit::default_units = :miles
|
5
|
-
Geokit::default_formula = :sphere
|
6
|
-
|
7
|
-
# This is the timeout value in seconds to be used for calls to the geocoder web
|
8
|
-
# services. For no timeout at all, comment out the setting. The timeout unit
|
9
|
-
# is in seconds.
|
10
|
-
Geokit::Geocoders::request_timeout = 3
|
11
|
-
|
12
|
-
# These settings are used if web service calls must be routed through a proxy.
|
13
|
-
# These setting can be nil if not needed, otherwise, addr and port must be
|
14
|
-
# filled in at a minimum. If the proxy requires authentication, the username
|
15
|
-
# and password can be provided as well.
|
16
|
-
Geokit::Geocoders::proxy_addr = nil
|
17
|
-
Geokit::Geocoders::proxy_port = nil
|
18
|
-
Geokit::Geocoders::proxy_user = nil
|
19
|
-
Geokit::Geocoders::proxy_pass = nil
|
20
|
-
|
21
|
-
# This is your yahoo application key for the Yahoo Geocoder.
|
22
|
-
# See http://developer.yahoo.com/faq/index.html#appid
|
23
|
-
# and http://developer.yahoo.com/maps/rest/V1/geocode.html
|
24
|
-
Geokit::Geocoders::yahoo = 'REPLACE_WITH_YOUR_YAHOO_KEY'
|
25
|
-
|
26
|
-
# This is your Google Maps geocoder key.
|
27
|
-
# See http://www.google.com/apis/maps/signup.html
|
28
|
-
# and http://www.google.com/apis/maps/documentation/#Geocoding_Examples
|
29
|
-
Geokit::Geocoders::google = 'REPLACE_WITH_YOUR_GOOGLE_KEY'
|
30
|
-
|
31
|
-
# This is your username and password for geocoder.us.
|
32
|
-
# To use the free service, the value can be set to nil or false. For
|
33
|
-
# usage tied to an account, the value should be set to username:password.
|
34
|
-
# See http://geocoder.us
|
35
|
-
# and http://geocoder.us/user/signup
|
36
|
-
Geokit::Geocoders::geocoder_us = false
|
37
|
-
|
38
|
-
# This is your authorization key for geocoder.ca.
|
39
|
-
# To use the free service, the value can be set to nil or false. For
|
40
|
-
# usage tied to an account, set the value to the key obtained from
|
41
|
-
# Geocoder.ca.
|
42
|
-
# See http://geocoder.ca
|
43
|
-
# and http://geocoder.ca/?register=1
|
44
|
-
Geokit::Geocoders::geocoder_ca = false
|
45
|
-
|
46
|
-
# Uncomment to use a username with the Geonames geocoder
|
47
|
-
#Geokit::Geocoders::geonames="REPLACE_WITH_YOUR_GEONAMES_USERNAME"
|
48
|
-
|
49
|
-
# This is the order in which the geocoders are called in a failover scenario
|
50
|
-
# If you only want to use a single geocoder, put a single symbol in the array.
|
51
|
-
# Valid symbols are :google, :yahoo, :us, and :ca.
|
52
|
-
# Be aware that there are Terms of Use restrictions on how you can use the
|
53
|
-
# various geocoders. Make sure you read up on relevant Terms of Use for each
|
54
|
-
# geocoder you are going to use.
|
55
|
-
Geokit::Geocoders::provider_order = [:google,:us]
|
56
|
-
|
57
|
-
# The IP provider order. Valid symbols are :ip,:geo_plugin.
|
58
|
-
# As before, make sure you read up on relevant Terms of Use for each
|
59
|
-
# Geokit::Geocoders::ip_provider_order = [:geo_plugin,:ip]
|
60
|
-
|
61
|
-
end
|
data/geokit-rails.gemspec
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = %q{geokit-rails}
|
5
|
-
s.version = "1.1.4"
|
6
|
-
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Andre Lewis", "Bill Eisenhauer"]
|
9
|
-
s.date = %q{2010-09-08}
|
10
|
-
s.description = %q{}
|
11
|
-
s.email = ["andre@earthcode.com", "bill@billeisenhauer.com"]
|
12
|
-
s.extra_rdoc_files = ["Manifest.txt"]
|
13
|
-
s.files = ["CHANGELOG.rdoc", "MIT-LICENSE", "Manifest.txt", "README.markdown", "Rakefile", "about.yml", "assets/api_keys_template", "geokit-rails.gemspec", "init.rb", "install.rb", "lib/geokit-rails.rb", "lib/geokit-rails/acts_as_mappable.rb", "lib/geokit-rails/adapters/abstract.rb", "lib/geokit-rails/adapters/mysql.rb", "lib/geokit-rails/adapters/postgresql.rb", "lib/geokit-rails/adapters/sqlserver.rb", "lib/geokit-rails/defaults.rb", "lib/geokit-rails/geocoder_control.rb", "lib/geokit-rails/ip_geocode_lookup.rb", "test/acts_as_mappable_test.rb", "test/boot.rb", "test/database.yml", "test/fixtures/companies.yml", "test/fixtures/custom_locations.yml", "test/fixtures/locations.yml", "test/fixtures/mock_addresses.yml", "test/fixtures/mock_families.yml", "test/fixtures/mock_houses.yml", "test/fixtures/mock_organizations.yml", "test/fixtures/mock_people.yml", "test/fixtures/stores.yml", "test/ip_geocode_lookup_test.rb", "test/models/company.rb", "test/models/custom_location.rb", "test/models/location.rb", "test/models/mock_address.rb", "test/models/mock_family.rb", "test/models/mock_house.rb", "test/models/mock_organization.rb", "test/models/mock_person.rb", "test/models/store.rb", "test/schema.rb", "test/tasks.rake", "test/test_helper.rb"]
|
14
|
-
s.rdoc_options = ["--main", "README.txt"]
|
15
|
-
s.require_paths = ["lib"]
|
16
|
-
s.rubyforge_project = %q{geokit-rails}
|
17
|
-
s.rubygems_version = %q{1.3.7}
|
18
|
-
s.summary = %q{Geo distance calculations, distance calculation query support, geocoding for physical and ip addresses.}
|
19
|
-
s.test_files = ["test/test_helper.rb"]
|
20
|
-
|
21
|
-
if s.respond_to? :specification_version then
|
22
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
-
s.specification_version = 3
|
24
|
-
|
25
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
-
s.add_runtime_dependency(%q<geokit>, [">= 1.5.0"])
|
27
|
-
s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
|
28
|
-
s.add_development_dependency(%q<hoe>, [">= 2.6.2"])
|
29
|
-
else
|
30
|
-
s.add_dependency(%q<geokit>, [">= 1.5.0"])
|
31
|
-
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
|
32
|
-
s.add_dependency(%q<hoe>, [">= 2.6.2"])
|
33
|
-
end
|
34
|
-
else
|
35
|
-
s.add_dependency(%q<geokit>, [">= 1.5.0"])
|
36
|
-
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
|
37
|
-
s.add_dependency(%q<hoe>, [">= 2.6.2"])
|
38
|
-
end
|
39
|
-
end
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'geokit-rails'
|
data/install.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# Display to the console the contents of the README file.
|
2
|
-
puts IO.read(File.join(File.dirname(__FILE__), 'README.markdown'))
|
3
|
-
|
4
|
-
# place the api_keys_template in the application's /config/initializers/geokit_config.rb
|
5
|
-
path=File.expand_path(File.join(File.dirname(__FILE__), '../../../config/initializers/geokit_config.rb'))
|
6
|
-
template_path=File.join(File.dirname(__FILE__), '/assets/api_keys_template')
|
7
|
-
if File.exists?(path)
|
8
|
-
puts "It looks like you already have a configuration file at #{path}. We've left it as-is. Recommended: check #{template_path} to see if anything has changed, and update config file accordingly."
|
9
|
-
else
|
10
|
-
File.open(path, "w") do |f|
|
11
|
-
f.puts IO.read(template_path)
|
12
|
-
puts "We created a configuration file for you in config/initializers/geokit_config.rb. Add your Google API keys, etc there."
|
13
|
-
end
|
14
|
-
end
|