Permalink
Browse files

Remove Geocoder.config method.

This requires a parameter to be accepted by the block passed to
Geocoder.configure, which means you don't need to remember that the
method is called "config"--you can call it whatever you want.
This behavior seems more standard for configuration blocks.
  • Loading branch information...
1 parent 31d6d8a commit 3e72c47241522818288b44a8c847551a51fe8a26 @alexreisner committed May 24, 2012
Showing with 3 additions and 8 deletions.
  1. +0 −5 lib/geocoder.rb
  2. +1 −1 lib/geocoder/configuration.rb
  3. +1 −1 test/calculations_test.rb
  4. +1 −1 test/configuration_test.rb
View
@@ -70,10 +70,6 @@ def ip_lookups
private # -----------------------------------------------------------------
- def config # :nodoc
- Configuration.instance
- end
-
##
# Get a Lookup object (which communicates with the remote geocoding API).
# Takes a search query and returns an IP or street address Lookup
@@ -135,4 +131,3 @@ def blank_query?(value)
require "geocoder/railtie"
Geocoder::Railtie.insert
end
-
@@ -7,7 +7,7 @@ module Geocoder
#
def self.configure(&block)
if block_given?
- module_eval(&block)
+ block.call(Configuration.instance)
else
Configuration.instance
end
@@ -3,7 +3,7 @@
class CalculationsTest < Test::Unit::TestCase
def setup
- Geocoder.configure do
+ Geocoder.configure do |config|
config.units = :mi
config.distances = :linear
end
@@ -39,7 +39,7 @@ def test_configurated_by_class_method
# --- Geocoder#configure distances configuration ---
def test_geocoder_configuration
# DSL
- Geocoder.configure do
+ Geocoder.configure do |config|
config.units = :mi
config.distances = :linear
end

0 comments on commit 3e72c47

Please sign in to comment.