Commit Graph

77 Commits

Author SHA1 Message Date
Andrew White
cf3364a03c Raise NameError instead of ArgumentError in ActiveSupport::Dependencies
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
2011-06-01 01:16:20 +01:00
José Valim
a6e945554d Fix failing tests. 2011-05-22 13:21:47 +02:00
Aaron Patterson
69e348013b adding deprecation noticies to deprecated class cache methods 2011-03-02 09:31:40 -08:00
Aaron Patterson
66245441d4 adding backwards compat for class cache references. <3<3 2011-03-02 09:18:05 -08:00
Aaron Patterson
7b6bfe84f3 refactor Reference to a ClassCache object, fix lazy lookup in Middleware so that anonymous classes are supported 2011-03-01 17:20:35 -08:00
Andrew White
f1966337fa Add before_remove_const callback to ActiveSupport::Dependencies.remove_unloadable_constants!
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-09-01 22:32:41 +02:00
wycats
dbe08026e1 Sadly, this segv's in 1.8 :( 2010-08-17 16:51:35 -07:00
Santiago Pastorino
4ea1753fc2 This is for making sure const_missing is triggered without warnings 2010-07-26 12:51:52 -03:00
wycats
1b97701e51 Fix a bug where requires inside of autoloads were being added to the autoloaded_constants list, causing mayhem. [#5165 state:resolved] 2010-07-26 00:59:54 -07:00
Santiago Pastorino
e1d4e78b15 Removes unused vars
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-24 01:19:44 +02:00
Santiago Pastorino
80cf6559ed Makes restore previosly saved warnings_on_first_load value and avoid warning
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-24 01:19:43 +02:00
Xavier Noria
6f83a5036d renames load_(once_)paths to autoload_(once_)paths in dependencies and config 2010-06-24 00:17:28 +02:00
Jeremy Kemper
fd1a504136 ActiveSupport::Dependencies.constantize shortcut for caching named constant lookups 2010-06-05 22:05:58 -07:00
wycats
a6b3942843 Optimize LookupContext 2010-06-04 20:11:06 -07:00
Santiago Pastorino
aacf2581cd refactor evals and adds some __FILE__ and __LINE__
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-20 15:18:57 +02:00
Santiago Pastorino and Sebastian Martinez
e7276a9f09 Make dependencies_test pass running standalone [#4215 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-18 17:50:28 -07:00
Yehuda Katz
4da45060a2 Simplify dependencies.rb some. Remove alias of Kernel::Foo to Object::Foo as it was not used and breaks Ruby semantics. 2010-02-14 10:48:06 -08:00
Yehuda Katz
77f630d317 Since require_dependency cannot be cleared, remove the dependencies 2010-02-10 15:06:42 -08:00
Xavier Noria
cf9a52a7b6 removes Module#as_load_path, which is no longer used 2010-02-07 23:06:15 +01:00
Xavier Noria
1979e9c855 Symbol#to_proc is not needed for Ruby >= 1.8.7 2009-11-09 22:16:51 +01:00
Jeremy Kemper
87e2c1895f Fix failing dependencies test relying on . being in LOAD_PATH 2009-08-09 12:40:16 -07:00
Jeremy Kemper
d0bcf51191 Extract repetitive method 2009-08-09 12:14:25 -07:00
Jeremy Kemper
635f68dca9 Uses &:foo 2009-08-09 12:11:50 -07:00
Jeremy Kemper
f28bd9557c Fix dependencies revealed by testing in isolation 2009-04-22 18:54:13 -07:00
Jeremy Kemper
f5d720fb96 Opt in to Dependencies 2009-04-22 16:42:14 -07:00
Jeremy Kemper
1c36172c13 Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.
[#1617 state:resolved]
2009-03-08 13:11:58 -07:00
Jeremy Kemper
cbb38bbdba Only track new constant definitions when we're reloading dependencies 2008-11-10 22:21:09 -08:00
Pratik Naik
a5cdb7a813 Remove stuff that was deprecated in 2-1-stable 2008-10-21 11:34:56 +01:00
Jeremy Kemper
a1eb4e11c2 Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, but it has since been removed from 1.9.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>

Conflicts:

	actionpack/test/controller/layout_test.rb
2008-08-31 13:20:15 -07:00
Joshua Peek
3fd9036fc5 Added config.dependency_loading to enable or disable the dependency loader after initialization 2008-07-24 11:58:26 -05:00
Joshua Peek
c08547d226 Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved] 2008-06-03 13:32:53 -05:00
Tom Ward
77e45352e7 Fixed Dependencies so load errors are not masked behind a 'Expected x.rb to define X' message when mechanism is not set to :load [#87 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-05-31 13:33:38 -07:00
Tom Ward
ebb642fa3a Fix Dependencies watch_frames collection. [#24 state:resolved]
Previously, the code collecting watch_frames could fail leaving
watch_frames defined but nil. The cleanup code checks watch_frames
is defined, but not that it holds a value, raising an undefined method
on NilClass error rather than the original cause.  This can make
debugging the underlying cause a total pain.

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-20 11:44:23 +01:00
Jeremy Kemper
f8c12301bb remove some more absolute requires
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8567 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:32:48 +00:00
Jeremy Kemper
f6d8526659 require abstract_unit directly since test is in load path
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:31:04 +00:00
Jeremy Kemper
5f4d121798 Dependencies Ruby 1.9 compat
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-27 11:01:20 +00:00
Nicholas Seckar
4eec5f4fbb Update Dependencies to ignore constants inherited from ancestors. Closes #6951.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-14 23:27:28 +00:00
Jeremy Kemper
0a06ffc08e tighten test_load_once_paths_should_behave_when_recursively_loading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-01 00:25:30 +00:00
Jeremy Kemper
cbe0c3c54f Check for nil name also. Closes #6561.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5814 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-31 23:53:05 +00:00
Nicholas Seckar
91b71ed30c Fix Dependencies.autoloaded? to ignore anonymous modules. Closes #6561.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5811 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-31 18:53:58 +00:00
Nicholas Seckar
1e170da30d Checkin failing test case related to load once paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-24 14:41:29 +00:00
Nicholas Seckar
6a485c3100 Fix remove_constant to correctly handle constant names of the form "::A::...". References #6720.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5710 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-09 05:21:33 +00:00
Jeremy Kemper
615d05f5de Test autoloading nested subclass of parent.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5541 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-16 22:50:46 +00:00
Nicholas Seckar
ad06514257 Update dependencies to delete partially loaded constants.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 20:45:36 +00:00
Jeremy Kemper
e1140f876e Update failing autoload tests.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5463 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 20:29:50 +00:00
Nicholas Seckar
a7d0e0e011 Fix warning and incorrect test trigger
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-06 23:45:39 +00:00
Jeremy Kemper
07c51829ab Failing test for autoloading shadowed exceptions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-06 19:23:30 +00:00
Nicholas Seckar
5cc682da07 Update dependencies to allow constants to be defined alongside their siblings.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-01 23:21:13 +00:00
Nicholas Seckar
497b5dcf19 Add 'unloadable', a method used to mark any constant as requiring an unload after each request.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-15 23:32:31 +00:00
Nicholas Seckar
93659978d5 Fix loadable_constants_for_path to handle load paths that do not end with a slash.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5053 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-06 20:31:28 +00:00