forked from alexreisner/geocoder
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a config generator for Geocoder.
- Loading branch information
1 parent
86f418f
commit 268f3d5
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Geocoder | ||
class ConfigGenerator < Rails::Generators::Base | ||
source_root File.expand_path("../templates", __FILE__) | ||
|
||
desc "This generator creates an initializer file at config/initializers, " + | ||
"with the default configuration options for Geocoder." | ||
def add_initializer | ||
template "initializer.rb", "config/initializers/geocoder.rb" | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Geocoder.configure do | ||
## Configurable parameters: if you wish to change some configurable | ||
## behaviour in Geocoder, feel free to uncomment the following lines | ||
## and provide custom parameters. | ||
|
||
# config.timeout = 3 # geocoding service timeout (secs) | ||
# config.lookup = :google # name of geocoding service (symbol) | ||
# config.language = :en # ISO-639 language code | ||
# config.use_https = false # use HTTPS for lookup requests? (if supported) | ||
# config.http_proxy = nil # HTTP proxy server (user:pass@host:port) | ||
# config.https_proxy = nil # HTTPS proxy server (user:pass@host:port) | ||
# config.api_key = nil # API key for geocoding service | ||
# config.cache = nil # cache object (must respond to #[], #[]=, and #keys) | ||
# config.cache_prefix = "geocoder:" # prefix (string) to use for all cache keys | ||
|
||
## exceptions that should not be rescued by default | ||
## (if you want to implement custom error handling); | ||
## supports SocketError and TimeoutError | ||
# config.always_raise = [] | ||
|
||
## Calculation options | ||
# config.units = :mi # :km for kilometers or :mi for miles | ||
# config.method = :linear # :spherical or :linear | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters