aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaseem Ahmad <talk.to.waseem@gmail.com>2013-05-09 12:32:02 +0530
committerWaseem Ahmad <talk.to.waseem@gmail.com>2013-05-09 12:32:02 +0530
commit1a4d8736ce7294d2ecfc46172cc8de3b4591ac23 (patch)
tree8a4c58cedf800e33659ab285b5cf712f5675aa82
parent5e03239d59db7b21ceda576ce52b7fab3ad58c2d (diff)
downloadrails-1a4d8736ce7294d2ecfc46172cc8de3b4591ac23.tar.gz
rails-1a4d8736ce7294d2ecfc46172cc8de3b4591ac23.tar.bz2
rails-1a4d8736ce7294d2ecfc46172cc8de3b4591ac23.zip
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.
-rw-r--r--activesupport/lib/active_support/i18n.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/i18n.rb b/activesupport/lib/active_support/i18n.rb
index 22521a8e93..6cc98191d4 100644
--- a/activesupport/lib/active_support/i18n.rb
+++ b/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'
begin
- 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
end
+require 'active_support/lazy_load_hooks'
ActiveSupport.run_load_hooks(:i18n)
I18n.load_path << "#{File.dirname(__FILE__)}/locale/en.yml"