Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fixing issue when delegating to methods named "block", "args", or "arg" | Jake Bell | 2015-08-19 | 1 | -0/+15 |
| | |||||
* | Deprecate alias_method_chain in favour of Module#prepend | Kir Shatrov | 2015-03-22 | 1 | -95/+125 |
| | | | …as discussed #19413 | ||||
* | Revert 88d08f2ec9f89ba431cba8d0c06ac9ebc204bbbb | Rafael Mendonça França | 2015-02-11 | 1 | -1/+1 |
| | | | | | | | This caused a performance regression since we were decided to do the nil check in run time not in the load time. See https://github.com/rails/rails/pull/15187#issuecomment-71760058 | ||||
* | Delegation works with reserved words passed to `:to` | Agis- | 2014-09-19 | 1 | -0/+11 |
| | | | | Fixes #16956. | ||||
* | Fix confusing exception in ActiveSupport delegation | Vladimir Yarotsky | 2014-05-20 | 1 | -1/+1 |
| | |||||
* | Remove warning | Rafael Mendonça França | 2014-01-16 | 1 | -2/+2 |
| | |||||
* | define the delegate methods on one line. fixes #13724 | Aaron Patterson | 2014-01-16 | 1 | -0/+10 |
| | | | | sup haters | ||||
* | Unused classes in AS tests | Akira Matsuda | 2013-12-19 | 1 | -6/+0 |
| | |||||
* | Only raise DelegationError if it's is the source of the exception | Andrew White | 2013-07-11 | 1 | -0/+27 |
| | | | | | | | | | This fixes situations where nested NoMethodError exceptions are masked by delegations. This would cause confusion especially where there was a problem in the Rails booting process because of a delegation in the routes reloading code. Fixes #10559 | ||||
* | Fixed test broken by local_constant_names | Arun Agrawal | 2013-07-03 | 1 | -6/+0 |
| | | | depreciation removed | ||||
* | Move delegation error constant to inside Module | Carlos Antonio da Silva | 2013-06-26 | 1 | -1/+1 |
| | |||||
* | Add DelegationError class. Rasied by delegation to a nil object | Steve Faulkner | 2013-06-26 | 1 | -1/+1 |
| | |||||
* | Module#delegate checks nilness rather that falsehood if :allow_nil is true, ↵ | Xavier Noria | 2013-04-26 | 1 | -0/+31 |
| | | | | | | | | | | | | | | and avoids multiple evaluation of the target method Notes: 1) I hope nilness is a word. 2) See rationale for avoiding multiple evaluation in a comment in the patch, credit goes to @jeremy for pointing out this gotcha in the existing implementation. 3) Embeds a little joke dedicated to @pixeltrix (it could be worse! :D). References #10347. | ||||
* | Delegation method bug | Li Ellis Gallardo | 2013-04-25 | 1 | -0/+5 |
| | | | | | | Add documentation and test to delegation method that make sure we're aware that when a delegated object is not nil or false and doesn't respond to the method it will still raise a NoMethodError exception. | ||||
* | Nice and easy delegation to the class | Marc-Andre Lafortune | 2012-09-11 | 1 | -0/+11 |
| | |||||
* | JRuby return different Array for module contents. | Arun Agrawal | 2012-05-29 | 1 | -1/+1 |
| | | | | | Test was failing against JRuby. It loads like [Constant3 Constant1] | ||||
* | Optimize the performance of #delegate | Daniel Schierbeck | 2012-04-12 | 1 | -0/+19 |
| | | | | | | Remove the use of #__send__ in order to boost performance. This also means that you can no longer delegate to private methods on the target object. | ||||
* | deprecates Module#local_constant_names | Xavier Noria | 2012-01-12 | 1 | -0/+6 |
| | |||||
* | use AS::TestCase as the base class | Aaron Patterson | 2012-01-05 | 1 | -2/+2 |
| | |||||
* | We can't simply check the first line of the backtrace, | Arun Agrawal | 2011-09-04 | 1 | -4/+6 |
| | | | because JRuby reports the call to __send__ in the backtrace. | ||||
* | Revert all the stuff to do with disallowing non-public methods for ↵ | Jon Leighton | 2011-08-25 | 1 | -19/+1 |
| | | | | Module#delegate | ||||
* | Add a test for delegating a method ending in '=' as this is a special case. | Jon Leighton | 2011-08-15 | 1 | -0/+8 |
| | |||||
* | Split up the definitions in Module#delegate depending on :allow_nil, and ↵ | Jon Leighton | 2011-08-15 | 1 | -0/+12 |
| | | | | don't use exceptions for flow control in the :allow_nil => true case. | ||||
* | Fix the line number in the backtrace when Module#delegate raises | Jon Leighton | 2011-08-15 | 1 | -1/+13 |
| | |||||
* | Just do the method call directly in Module#delegate, if we can (we cannot ↵ | Jon Leighton | 2011-08-15 | 1 | -2/+20 |
| | | | | for method names ending in '='). Two reasons: 1) it's faster, see https://gist.github.com/1089783 and 2) more importantly, delegate should not allow you to accidentally call private or protected methods. | ||||
* | Remove unused line in test setup. | Ben Orenstein | 2011-02-17 | 1 | -1/+0 |
| | | | | | | [#6442 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | Remove unused code. | Ben Orenstein | 2011-02-16 | 1 | -3/+0 |
| | | | | | | [#6437 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | delegate method should treat :prefix => false same as :prefix => nil | Neeraj Singh | 2010-09-01 | 1 | -0/+13 |
| | | | | | | [#5375 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Removes unused vars | Santiago Pastorino | 2010-07-24 | 1 | -1/+1 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Final iteration of use better testing methods | Neeraj Singh | 2010-05-19 | 1 | -5/+5 |
| | | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Singleton classes returns parent's methods with instance_methods(false) and ↵ | José Valim | 2010-03-19 | 1 | -0/+14 |
| | | | | this makes remove_method in Module#delegate fail. Add a test case and fix the bug. | ||||
* | Fix test ordering bug related to introducing masked Name class | Yehuda Katz | 2010-02-19 | 1 | -14/+6 |
| | |||||
* | removes Module#as_load_path, which is no longer used | Xavier Noria | 2010-02-07 | 1 | -5/+0 |
| | |||||
* | removes Module#included_in_classes, which is no longer used | Xavier Noria | 2010-02-07 | 1 | -7/+0 |
| | |||||
* | Allow delegating to nil, because the method might actually exist on it | Bryan Helmkamp | 2009-08-10 | 1 | -1/+12 |
| | |||||
* | Friendlier runtime exception if delegatee is nil | Jeremy Kemper | 2009-06-18 | 1 | -1/+1 |
| | |||||
* | Explicit test dependencies | Jeremy Kemper | 2009-03-28 | 1 | -0/+1 |
| | |||||
* | Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. | Jeremy Kemper | 2009-03-08 | 1 | -5/+5 |
| | | | | [#1617 state:resolved] | ||||
* | Add :allow_nil option to delegate [#1127 state:resolved] | Sergio Gil | 2008-12-21 | 1 | -0/+27 |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Ensure only delegations to methods can have an automatic prefix. [#1235 ↵ | Daniel Schierbeck | 2008-11-21 | 1 | -0/+11 |
| | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Moved test object instantiation to a setup method. | Daniel Schierbeck | 2008-10-19 | 1 | -9/+9 |
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | Made the :prefix option on Module#delegate accept a custom prefix. | Daniel Schierbeck | 2008-10-19 | 1 | -0/+9 |
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | Added :prefix option to Module#delegate. | Daniel Schierbeck | 2008-10-19 | 1 | -0/+12 |
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> | ||||
* | require abstract_unit directly since test is in load path | Jeremy Kemper | 2008-01-05 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Prefer class_eval with block to many sends for Ruby 1.9 compat | Jeremy Kemper | 2007-09-27 | 1 | -53/+72 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | alias_method_chain preserves the original method's visibility. Closes #7854. | Jeremy Kemper | 2007-03-18 | 1 | -0/+45 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6441 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Update Dependencies to ignore constants inherited from ancestors. Closes #6951. | Nicholas Seckar | 2007-03-14 | 1 | -0/+8 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | alias_method_chain yields method target and punctuation to simplify wrapper ↵ | Jeremy Kemper | 2006-09-15 | 1 | -0/+15 |
| | | | | | | method definition. Used by the deprecate module method. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | alias_method_chain works with accessor= methods also. Closes #6153. | Jeremy Kemper | 2006-09-12 | 1 | -9/+22 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | More tests for alias_method_chain with feature and method punctuation. ↵ | Jeremy Kemper | 2006-09-03 | 1 | -0/+15 |
| | | | | | | Closes #4954. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |