Commit Graph

55 Commits

Author SHA1 Message Date
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
Nicholas Seckar
7441b19d0c Fix logic error in determining what was loaded by a given file. Closes #6039.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-05 23:36:14 +00:00
Nicholas Seckar
1d554b84f8 Equate Kernel.const_missing with Object.const_missing. Fixes #5988.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-05 22:36:28 +00:00
Nicholas Seckar
26f28e7cfa Add ApplicationController special case to Dependencies.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-02 21:13:30 +00:00
Nicholas Seckar
68c9c93118 Update Initializer to use load_once_paths to avoid plugin reloading. References #5852.
Add Dependencies.load_once_paths.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4837 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-29 06:52:39 +00:00
Nicholas Seckar
4584376a91 Add tests for prior checkin
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-17 17:32:23 +00:00
Nicholas Seckar
924ef18d4b Detect missing_constants calls from removed modules and fail accordingly.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4780 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-17 03:35:36 +00:00
Nicholas Seckar
2b37d59976 Fix const_missing to behave responsibly when called within anonymous modules
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4779 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 20:54:25 +00:00
Nicholas Seckar
38f598ec0b Update require_dependency to return true or false as require does.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 20:33:31 +00:00
Nicholas Seckar
593f04e6a9 Stop using defined? in Dependencies.qualified_const_defined? since defined? may invoke const_missing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4774 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 17:50:52 +00:00
Jeremy Kemper
80f1597942 Dependencies can autoload directories of nested classes.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 09:18:17 +00:00
Nicholas Seckar
9bd007c7c7 Add forgotten files; Fix double loading errors.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4730 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 22:08:09 +00:00
Nicholas Seckar
4635d33996 Checkin forgotten add. Update const_missing handler to avoid double loading files.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4729 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 21:44:34 +00:00
Nicholas Seckar
74165eb6ac New dependencies implementation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 21:21:04 +00:00
Nicholas Seckar
52d4166947 Raise fully qualified names upon name errors. Closes #5533.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 22:52:15 +00:00
Jeremy Kemper
71234daef1 r4487@asus: jeremy | 2006-04-29 12:21:39 -0700
Check whether @flash is defined? for warnings-safety.
 r4488@asus:  jeremy | 2006-04-29 12:23:15 -0700
 Check whether @flash is defined? for warnings-safety. Obviates nil? check.
 r4489@asus:  jeremy | 2006-04-29 12:45:18 -0700
 Check whether @session is defined? for warnings-safety.
 r4490@asus:  jeremy | 2006-04-29 12:50:41 -0700
 Check whether @rendering_runtime is defined? for warnings-safety.
 r4491@asus:  jeremy | 2006-04-29 12:55:01 -0700
 Check whether @_cycles is defined? for warnings-safety.
 r4492@asus:  jeremy | 2006-04-29 12:59:19 -0700
 Check whether instance variables are defined? for warnings-safety.
 r4493@asus:  jeremy | 2006-04-29 13:14:09 -0700
 Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning.
 r4494@asus:  jeremy | 2006-04-29 13:31:34 -0700
 Check whether @auto_index defined? for warnings-safety.
 r4495@asus:  jeremy | 2006-04-29 13:32:24 -0700
 Wrap content_columns redefinitions with silence_warnings.
 r4496@asus:  jeremy | 2006-04-29 13:35:28 -0700
 Wrap more redefinitions with silence_warnings.
 r4829@asus:  jeremy | 2006-07-08 10:59:20 -0700
 abstract unit, fix warnings
 r4830@asus:  jeremy | 2006-07-08 11:06:12 -0700
 Use parens to silence warning.
 r4831@asus:  jeremy | 2006-07-08 11:06:48 -0700
 Use parens to silence warning.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 18:14:49 +00:00
Nicholas Seckar
9efca53908 Dependencies cleanup. Fixes #4221.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-27 05:13:46 +00:00
Tobias Lütke
6fa5b7b304 added some (pointless) test cases to dependency loading, the more the merrier
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3537 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-04 21:24:40 +00:00
David Heinemeier Hansson
01b1a87729 Added reusable reloading support through the inclusion of the Relodable 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
2006-01-29 00:37:39 +00:00
Jeremy Kemper
e7219e9e2a Introduce Dependencies.warnings_on_first_load setting. If true, enables warnings on first load of a require_dependency. Otherwise, loads without warnings. Disabled (set to false) by default.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3190 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-24 20:26:01 +00:00
Jeremy Kemper
52325f6bf8 Sever infinite loop for mutual dependencies. Closes #2997.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-24 05:43:27 +00:00
Jeremy Kemper
b94d6c0654 Enable warnings on first load only. File which are loaded but raise an exception are not added to loaded set.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-23 21:31:51 +00:00
Nicholas Seckar
24064910d0 Fix broken tests caused by incomplete loading of active support.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-07 01:48:33 +00:00