Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #234 from carlosantoniodasilva/ca-fix-warnings

Fix instance variable not defined warnings due to added deprecations
  • Loading branch information...
commit 8fc94e7e9ec20396e974b0549cf499662238bf56 2 parents 12aa0f0 + 3d03935
@tigrish tigrish authored
View
4 lib/i18n.rb
@@ -358,8 +358,8 @@ def default_exception_handler(exception, locale, key, options)
end
def handle_enforce_available_locales_deprecation
- if config.enforce_available_locales.nil? && !@unenforced_available_locales_deprecation
- $stderr.puts "[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message."
+ if config.enforce_available_locales.nil? && !defined?(@unenforced_available_locales_deprecation)
+ $stderr.puts "[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message."
@unenforced_available_locales_deprecation = true
end
end
View
2  lib/i18n/exceptions.rb
@@ -13,7 +13,7 @@ def call(exception, locale, key, options)
# TODO: this block is to be replaced by `exception.message` when
# rescue_format is removed
if options[:rescue_format] == :html
- if @rescue_format_deprecation
+ if !defined?(@rescue_format_deprecation)
$stderr.puts "[DEPRECATED] I18n's :recue_format option will be removed from a future release. All exception messages will be plain text. If you need the exception handler to return an html format please set or pass a custom exception handler."
@rescue_format_deprecation = true
end
View
2  test/i18n/exceptions_test.rb
@@ -3,7 +3,7 @@
class I18nExceptionsTest < Test::Unit::TestCase
def test_invalid_locale_stores_locale
force_invalid_locale
- rescue I18n::ArgumentError => e
+ rescue I18n::ArgumentError => exception
assert_nil exception.locale
end
Please sign in to comment.
Something went wrong with that request. Please try again.