diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-23 15:31:33 +0200 |
---|---|---|
committer | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-23 15:31:33 +0200 |
commit | eff5d9aed468e8d6c4ffb103dad8e99b0a65465d (patch) | |
tree | 25ac5fe5eb416c1089c277cd398f23856e3a35fd /activesupport/lib/active_support/core_ext/kernel/requires.rb | |
parent | a8b2a895b795b02805a6d6478f7a8c55035e19d4 (diff) | |
download | rails-eff5d9aed468e8d6c4ffb103dad8e99b0a65465d.tar.gz rails-eff5d9aed468e8d6c4ffb103dad8e99b0a65465d.tar.bz2 rails-eff5d9aed468e8d6c4ffb103dad8e99b0a65465d.zip |
Removed AS core_ext/kernel/requires as it's not used and is bad practice.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/kernel/requires.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel/requires.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/activesupport/lib/active_support/core_ext/kernel/requires.rb b/activesupport/lib/active_support/core_ext/kernel/requires.rb deleted file mode 100644 index 3bf46271d7..0000000000 --- a/activesupport/lib/active_support/core_ext/kernel/requires.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'active_support/core_ext/kernel/reporting' - -module Kernel - # Require a library with fallback to RubyGems. Warnings during library - # loading are silenced to increase signal/noise for application warnings. - def require_library_or_gem(library_name) - silence_warnings do - begin - require library_name - rescue LoadError => cannot_require - # 1. Requiring the module is unsuccessful, maybe it's a gem and nobody required rubygems yet. Try. - begin - require 'rubygems' - rescue LoadError # => rubygems_not_installed - raise cannot_require - end - # 2. Rubygems is installed and loaded. Try to load the library again - begin - require library_name - rescue LoadError # => gem_not_installed - raise cannot_require - end - end - end - end -end |