| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
### Summary
There was an issues when using `safe_constantize` on a string that has
the wrong case.
File `em.rb` defines `EM`.
`"Em".safe_constantize` causes a little confusion with the autoloader.
The autoloader finds file "em.rb",
expecting it to define `Em`, but `Em` is not defined.
The autoloader raises a `LoadError`, which is good,
But `safe_constantize` is defined to return `nil` when a class is not found.
### Before
```
"Em".safe_constantize
LoadError: Unable to autoload constant Em, \
expected rails/activesupport/test/autoloading_fixtures/em.rb to define it
```
### After
```
"Em".safe_constantize
# => nil
```
|
|
|
|
|
|
|
| |
If you require `nokogiri` from `app/models/user.rb`, dependencies.rb
does not mark `Nokogiri` as an autoloaded constant, as expected.
But the logic to detect these non-autoloaded constants is incomplete.
See the tests defined in the patch for some cases incorrectly handled.
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
|
|
| |
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -error -source=text .
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the following situation:
```ruby
class Bar
end
module Baz
end
class Foo
prepend Baz
end
class Foo::Bar
end
```
Running `Inflector.constantize('Foo::Bar')` would blow up with a NameError.
What is happening is that `constatize` was written before the introduction
of prepend, and wrongly assume that `klass.ancestors.first == klass`.
So it uses `klass.ancestors.inject` without arguments, as a result
a prepended module is used in place of the actual class.
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
| |
The constant reference A::B used to trigger autoloading causes a warning
to be logged about the possible use of :: in a void context so assign it
to the _ variable to prevent the warnings from being triggered.
|
| |
|
| |
|
|
|
|
| |
References #24205.
|
|
|
|
|
| |
Minitest sets an E constant to an empty string to save GC time.
This clashes with autoloading tests which define an E constant.
|
|
|
|
|
|
|
|
|
|
| |
The check for circular loading should depend on a stack of files being
loaded at the moment, rather than the collection of loaded files.
This showed up indirectly in #16468, where a misspelled helper would
incorrectly result in a circularity error message.
References #16468
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
's/[ \t]*$//' -i {} \;)
|
| |
|
|
|
|
| |
autoloaded_constants list, causing mayhem. [#5165 state:resolved]
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4928 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4730 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3537 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
module that all subclasses of ActiveRecord::Base, ActiveRecord::Observer, ActiveController::Base, and ActionMailer::Base automatically gets [DHH]. Added auto-loading support for classes in modules, so Conductor::Migration will look for conductor/migration.rb and Conductor::Database::Settings will look for conductor/database/settings.rb [Nicholas Seckar]. Refactored extensions to module, class, and object in active support [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|