| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes https://github.com/rails/rails/issues/9933.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Ruby's original behaviour is that :
* It only returns a const name, not a qualified aname
* It returns a symbol, not a string
|
| |
|
|
|
|
| |
unexpected circular dependency error
|
|
|
|
|
|
| |
Change most tests to make use of assert_raise returning the raised
exception rather than relying on a combination of flunk + rescue to
check for exception types/messages.
|
|
|
|
|
|
|
|
|
|
| |
In Minitest, the second argument of assert_raise(s) accepts a string as
the message that should be shown in case of a failure in the assertion
(eg nothing was raised when it should), and not the exception message to
be matched.
To do that we need to save the exception returned from assert_raise(s)
into a local variable and check for the exception message using it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#13204]
load_missing_constant is a private method that basically plays the role of const_missing.
This method has an error condition that is surprising: it raises if the class or module
already has the missing constant. How is it possible that if the class of module has
the constant Ruby has called const_missing in the first place?
The answer is that the from_mod argument is self except for anonymous modules, because
const_missing passes down Object in such case (see the comment in the source code of the
patch for the rationale).
But then, it is better to pass down Object *if Object is also missing the constant* and
otherwise err with an informative message right away.
|
|\
| |
| | |
Allow Pathname for require dependency
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, an autoloaded constant `HTML::SomeClass` would not be marked
as autoloaded by AS::Dependencies. This is because the
`#loadable_constants_for_path` method uses `String#camelize` on the
inferred file path, which in turn means that, unless otherwise directed,
AS::Dependencies watches for loaded constants in the `Html` namespace.
By passing the original qualified constant name to `#load_or_require`,
this inference step is avoided, and the new constant is picked up in the
correct namespace.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
ActiveSupport::Dependencies::Loadable
It is possible under some environments to receive an Exception that is
not extended with Blamable (e.g. JRuby).
ActiveSupport::Dependencies::Loadable#load_dependency blindly call
blame_file! on the exception which throws it's own NoMethodError
exception and hides the original Exception.
This commit fixes #9521
|
| |
|
|\
| |
| | |
Fix typo in DependenciesTestHelpers module name
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The AS utility silence_warnings does not really silence this
one, because it is issued at parse-time. It seemed to in
some places because the constant was the only expression in
the block and therefore it was its return value, that could
potentially be used by silence_warnings are return value of
the yield call.
To bypass the warning we assign to a variable. The chosen
variable is "_" because it is special-cased in parse.c not
to issue an "assigned but unused variable" warning in turn.
|
| |
|
|
|
|
| |
(active_support/dependecies.rb) (issue #8167)
|
| |
|
|
|
|
|
| |
The method #remove_const does not load the file, so we
can still remove the constant.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Nowadays circular autoloads do not work, but the user gets a NameError
that says some constant is undefined. That's puzzling, because he is
normally trying to autoload a constant he knows can be autoloaded.
With this check we can give a better error message.
|
| |
|
|
|
|
|
|
| |
Ruby 2.0.0 implements LoadError#path, but newly raised load errors will
not contain the path information. Replace the error message, copy
blame, and rereaise the same exception object
|
|
|
|
|
|
|
|
| |
This is an obsolete method from the very early days,
apparently it was used circa 2004 because STI support
was not smart enough. This method is not public
interface, and we are heading a major version, so
removal seems right.
|
| |
|
|
|
|
| |
- These tests don't use autoloading so there's no need to add anything to autoload_paths
|
| |
|
| |
|
|
|
|
|
| |
- Add tests to protect from regressions in require's return value behavior
- See a10606c490471d8e1483acb3b31d7f2d51e9ebbe (require needs to return true or false) for the original bug fix
|
|
|
|
|
|
|
| |
Under ruby 1.9.2 -
"/var/log".starts_with?(Pathname.new("/var")) # => false
so setting config.autoload_once_paths with Pathnames would not work
|
| |
|
|
|
|
|
|
|
|
| |
ActiveSupport::Dependencies now raises NameError if it finds an existing
constant in load_missing_constant. This better reflects the nature of
the error which is usually caused by calling constantize on a nested constant.
Closes #1423
|
| |
|
| |
|
| |
|
|
|
|
| |
that anonymous classes are supported
|
|
|
|
|
|
| |
ActiveSupport::Dependencies.remove_unloadable_constants!
Signed-off-by: Xavier Noria <fxn@hashref.com>
|
| |
|
| |
|
|
|
|
| |
autoloaded_constants list, causing mayhem. [#5165 state:resolved]
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
| |
lookups
|
| |
|