Francesco Rodriguez
cc14a3b2c1
Fix ActiveSupport tests that depend on run order
2012-08-23 16:00:58 -05:00
Aaron Patterson
56a1bb2f10
raise the same exception in order to keep path info
...
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
2012-06-12 16:19:51 -07:00
Xavier Noria
d3a99c32d1
removes the obsolete require_association method from dependencies
...
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.
2012-06-10 00:38:40 +02:00
Aaron Patterson
b8d8c50785
use AS::TestCase as the base class
2012-01-05 17:12:46 -08:00
Sam Umbach
cfc467f73e
Simplify load and require tests
...
- These tests don't use autoloading so there's no need to add anything to autoload_paths
2011-12-03 13:11:02 -05:00
Sam Umbach
2a9f063082
Test that require and load raise LoadError if file not found
2011-12-03 13:08:18 -05:00
Sam Umbach
0a485309a0
Test return value of ActiveSupport::Dependencies::Loadable#load
2011-12-03 12:58:41 -05:00
Sam Umbach
93580f4936
Test return value of ActiveSupport::Dependencies::Loadable#require
...
- 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
2011-12-03 11:52:25 -05:00
Jonathan del Strother
e0714ee005
Fix autoload_once_paths when using Pathnames & ruby 1.9
...
Under ruby 1.9.2 -
"/var/log".starts_with?(Pathname.new("/var")) # => false
so setting config.autoload_once_paths with Pathnames would not work
2011-08-24 18:14:25 +01:00
Arun Agrawal
ec7457ed2a
Removing extra requires from the test. Already loaded in abstract_unit.
2011-07-31 23:36:21 +05:30
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