Browse files

Require different core extensions correctly.

The begin rescue block is specifically to catch LoadError while loading
i18n gem. Other core extensions, under active support, should be
required outside of the begin rescue block.
  • Loading branch information...
waseem committed May 9, 2013
1 parent 5e03239 commit 1a4d8736ce7294d2ecfc46172cc8de3b4591ac23
Showing with 4 additions and 4 deletions.
  1. +4 −4 activesupport/lib/active_support/i18n.rb
@@ -1,13 +1,13 @@
+require 'active_support/core_ext/hash/deep_merge'
+require 'active_support/core_ext/hash/except'
+require 'active_support/core_ext/hash/slice'
- require 'active_support/core_ext/hash/deep_merge'
- require 'active_support/core_ext/hash/except'
- require 'active_support/core_ext/hash/slice'
require 'i18n'
- require 'active_support/lazy_load_hooks'
rescue LoadError => e
$stderr.puts "The i18n gem is not available. Please add it to your Gemfile and run bundle install"
raise e
+require 'active_support/lazy_load_hooks'
I18n.load_path << "#{File.dirname(__FILE__)}/locale/en.yml"

0 comments on commit 1a4d873

Please sign in to comment.