| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Ruby's original behaviour is that :
* It only returns a const name, not a qualified aname
* It returns a symbol, not a string
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
guides/source/active_record_validations.md
guides/source/api_documentation_guidelines.md
guides/source/configuring.md
|
| |
| |
| |
| | |
kind of exception we should expect for this internal comment.
|
|/
|
|
| |
unexpected circular dependency error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary of the changes:
* Add thread_safe gem.
* Use thread safe cache for digestor caching.
* Replace manual synchronization with ThreadSafe::Cache in Relation::Delegation.
* Replace @attribute_method_matchers_cache Hash with ThreadSafe::Cache.
* Use TS::Cache to avoid the synchronisation overhead on listener retrieval.
* Replace synchronisation with TS::Cache usage.
* Use a preallocated array for performance/memory reasons.
* Update the controllers cache to the new AS::Dependencies::ClassCache API.
The original @controllers cache no longer makes much sense after @tenderlove's
changes in 7b6bfe84f3 and f345e2380c.
* Use TS::Cache in the connection pool to avoid locking overhead.
* Use TS::Cache in ConnectionHandler.
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).
This commit removes all the non-breaking spaces inadvertently
introduced in the comments of the code.
|
| |
|
|
|
|
|
| |
The method #remove_const does not load the file, so we
can still remove the constant.
|
| |
|
| |
|
|
|
|
|
| |
I have also chosen a variable name that matches the
parameter in the definition of load_missing_constant.
|
|
|
|
| |
Those who say source code should be without comments lie.
|
|
|
|
|
|
|
|
| |
Basically, const_missing had a loop to try parent namespaces
if the constant lookup failed, but at the same time delegated
to load_missing_constant which in turn also walks up parent
namespaces calling const_missing by hand. In the case of missing
constants this results in repeated work in some funky nested way.
|
|
|
|
|
|
|
| |
#{qualified_name}"
Users need to know the ultimate problem here is that AS was
trying to autoload a constant and it failed.
|
|
|
|
|
|
|
|
| |
We need to anchor to remove the extension. In addition to
be the correct way to do that, files in ~/.rbenv get that
.rb removed, so it is a real source of bugs, as reported in
https://github.com/rails/rails/commit/b33700f5580b4cd85379a1dc60fa341ac4d8deb2#commitcomment-1781840
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.
The solution is hackish, but this file needs a revamp.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
We simplify two things here: First since * is greedy it is enough to go
look for the rightmost ::, no need to ask the regexp engine to match the
rest of the string since we are not validating anything, only capturing.
The second simplification comes from using a look-ahead assertion, that
allows us to have the capture in $&, thus removing the need of a group.
|
|
|
|
|
| |
The new regexp has less work to do, we anchor a fixed string at the end
and need no group.
|
|
|
|
|
|
| |
This argument is there because that's the signature of Kernel#load.
This reverts commit bf3fa34ed0aa33bca3aac9c96165662fe864a7b4.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ruby does not pass the nesting to const_missing (unfortunately).
That second argument was there in case that changed, Yehuda
sent a patch to MRI
http://bugs.ruby-lang.org/issues/2740
but there is not much movement there and Matz told me in
Amsterdam there was no immediate plan to pass the nesting.
So let's go back to implement what happens now, and if
in the future we get the nesting then we will adapt this.
Double-checked this with Mr Katz.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
there is no need in local_const_defined? helper method
|
|
|
|
|
|
|
|
|
| |
* Refactor log subscriber, use select! to avoid a new object
* Remove deprecation messages related to AS::Deprecation behavior
This was added about 2 years ago for Rails 3:
https://github.com/rails/rails/commit/d4c7d3fd94e5a885a6366eaeb3b908bb58ffd4db
* Remove some not used requires
* Refactor delegate to avoid string conversions and if statements inside each block
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
A patch has been provided earlier and we have asked for feedback:
https://gist.github.com/1437939
Except one case, all other cases showed improvements in boot time.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Test coverage isn't comprehensive enough to catch what this breaks. :(
This reverts commit 45dad592e47944704ab6951351b2fa29d4a2385f.
|
| |
|
| |
|