diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 19:44:39 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 19:44:39 -0300 |
commit | 734d97d292b4f04c13f03625e07f2888e88b0649 (patch) | |
tree | 941f9ab3764da181497c36264fb74a7a598fb844 /guides/source/active_support_core_extensions.md | |
parent | 48deeab90acd9f8f609fa461205a793c52f11ed2 (diff) | |
download | rails-734d97d292b4f04c13f03625e07f2888e88b0649.tar.gz rails-734d97d292b4f04c13f03625e07f2888e88b0649.tar.bz2 rails-734d97d292b4f04c13f03625e07f2888e88b0649.zip |
Deprecate `MissingSourceFile` in favor of `LoadError`.
`MissingSourceFile` was just an alias to `LoadError` and was not
being raised inside the framework.
Diffstat (limited to 'guides/source/active_support_core_extensions.md')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index c857f30541..ba839e1723 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -3873,7 +3873,7 @@ def default_helper_module! module_name = name.sub(/Controller$/, '') module_path = module_name.underscore helper module_path -rescue MissingSourceFile => e +rescue LoadError => e raise e unless e.is_missing? "helpers/#{module_path}_helper" rescue NameError => e raise e unless e.missing_name? "#{module_name}Helper" @@ -3885,7 +3885,7 @@ NOTE: Defined in `active_support/core_ext/name_error.rb`. Extensions to `LoadError` ------------------------- -Active Support adds `is_missing?` to `LoadError`, and also assigns that class to the constant `MissingSourceFile` for backwards compatibility. +Active Support adds `is_missing?` to `LoadError`. Given a path name `is_missing?` tests whether the exception was raised due to that particular file (except perhaps for the ".rb" extension). @@ -3896,7 +3896,7 @@ def default_helper_module! module_name = name.sub(/Controller$/, '') module_path = module_name.underscore helper module_path -rescue MissingSourceFile => e +rescue LoadError => e raise e unless e.is_missing? "helpers/#{module_path}_helper" rescue NameError => e raise e unless e.missing_name? "#{module_name}Helper" |