From b6e11033e0254f07887eb41ce5422b89d79e17b2 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Tue, 28 Jan 2014 18:03:43 -0500 Subject: [PATCH] Remove deprecated methods. --- lib/geocoder.rb | 8 -------- lib/geocoder/configuration.rb | 8 +------- test/configuration_test.rb | 10 ---------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/lib/geocoder.rb b/lib/geocoder.rb index cc5dcffc..8be093ab 100644 --- a/lib/geocoder.rb +++ b/lib/geocoder.rb @@ -39,14 +39,6 @@ module Geocoder results.first.address end end - - ## - # The working Cache object, or +nil+ if none configured. - # - def cache - warn "WARNING: Calling Geocoder.cache is DEPRECATED. The #cache method now belongs to the Geocoder::Lookup object." - Geocoder::Lookup.get(Geocoder.config.lookup).cache - end end # load Railtie if Rails exists diff --git a/lib/geocoder/configuration.rb b/lib/geocoder/configuration.rb index dc5d4222..9248b97b 100644 --- a/lib/geocoder/configuration.rb +++ b/lib/geocoder/configuration.rb @@ -14,14 +14,8 @@ module Geocoder # ) # def self.configure(options = nil, &block) - if block_given? - warn "WARNING: Passing a block to Geocoder.configure is DEPRECATED. Please pass a hash instead (eg: Geocoder.configure(:units => ..., :api_key => ...))." - block.call(Configuration.instance) - elsif !options.nil? + if !options.nil? Configuration.instance.configure(options) - else - warn "WARNING: Use of Geocoder.configure to read or write single config options is DEPRECATED. To write to the config please pass a hash (eg: Geocoder.configure(:units => ...)). To read config options please use the Geocoder.config object (eg: Geocoder.config.units)." - Configuration.instance end end diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 3ea27572..212f87ae 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -23,16 +23,6 @@ class ConfigurationTest < Test::Unit::TestCase assert_equal :test, Geocoder.config.units end - def test_setting_with_block_syntax - orig = $VERBOSE; $VERBOSE = nil - Geocoder.configure do |config| - config.units = :test - end - assert_equal :test, Geocoder.config.units - ensure - $VERBOSE = orig - end - def test_config_for_lookup Geocoder.configure( :timeout => 5, -- GitLab