Commit Graph

4830 Commits

Author SHA1 Message Date
Rafael Mendonça França
534ef88899 Merge pull request #10659 from vipulnsward/normalize_param2
"normalize_callback_params" doesn't require name param
2013-05-19 12:18:12 -07:00
Carl Lerche
e539228d08 Bug fix: Evented notification subscribers can handle published events 2013-05-17 16:27:23 -07:00
Vipul A M
872e2a8184 "normalize_callback_params" doesn't require name param 2013-05-17 09:04:44 +05:30
Aaron Patterson
156e2e3fd8 Revert "just call the class method since we know the callbacks are stored at the"
This reverts commit 55975c71ec9c2c18b67020484959ff5c69d4d3fb.
2013-05-16 14:19:50 -07:00
Rafael Mendonça França
8f2b1a12dc Merge pull request #10652 from md5/concern-multiple-included
Raise an error when multiple included blocks are defined for a Concern
2013-05-16 14:06:00 -07:00
Aaron Patterson
9fef7c8dc9 Merge pull request #10527 from zenspider/squishy_minitest5
Squishy minitest5
2013-05-16 13:41:54 -07:00
Mike Dillon
2d7a86e179 Raise when multiple included blocks are defined 2013-05-16 11:28:31 -07:00
Rafael Mendonça França
ed738f75d2 Revert "Merge pull request #10600 from aditya-kapoor/code_refactor"
This reverts commit 8ce3c1e5dde9fb180813e4d89324db03da110b13, reversing
changes made to f93da579ce7f77dbd58b9a2165861aee265b8c93.

Reason: It slow down the running time.

require "diffbench"
load 'output_safety.rb'

N = 10000
b = ActiveSupport::SafeBuffer.new("hello world")
DiffBench.bm do
  report "capitalize in safe buffer" do
    N.times do
      b.capitalize
    end
  end
end

> git checkout  069ea45; diffbench bench.rb;
diffbench bench.rb;diffbench
bench.rb;diffbench bench.rb;diffbench
bench.rb;diffbench bench.rb;diffbench
bench.rb;

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.009733)
Before patch:   0.010000   0.000000   0.010000
(  0.007702)
Improvement: -26%

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.009768)
Before patch:   0.010000   0.000000   0.010000
(  0.007896)
Improvement: -24%

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.009938)
Before patch:   0.010000   0.000000   0.010000
(  0.007768)
Improvement: -28%

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.010001)
Before patch:   0.010000   0.000000   0.010000
(  0.007873)
Improvement: -27%

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.009670)
Before patch:   0.010000   0.000000   0.010000
(  0.007800)
Improvement: -24%

Running benchmark with current working tree
Checkout HEAD^
Running benchmark with HEAD^
Checkout to previous HEAD again

                    user     system      total
                    real
----------------------------------capitalize
in safe buffer
After patch:    0.010000   0.000000   0.010000
(  0.009949)
Before patch:   0.010000   0.000000   0.010000
(  0.007752)
Improvement: -28%
2013-05-15 14:00:58 -03:00
Aaron Patterson
55975c71ec just call the class method since we know the callbacks are stored at the
class level
2013-05-15 09:54:14 -07:00
Aaron Patterson
920753f376 this variable is used, so we don't have to use double assignments 2013-05-15 09:53:13 -07:00
Aaron Patterson
8559871cd3 remove dead code 2013-05-15 09:43:17 -07:00
Aaron Patterson
1012c3e969 remove deprecation notices 2013-05-15 09:40:58 -07:00
Aaron Patterson
db78643a17 stop keeping a reference to the options hash 2013-05-15 09:39:23 -07:00
Aaron Patterson
99f5add4be conditions are guaranteed to be arrays by initialize 2013-05-15 09:30:08 -07:00
Aaron Patterson
d10cadca0c simplify the condions lambda generation 2013-05-15 09:28:50 -07:00
Aaron Patterson
d433436271 use unless instead of if! 2013-05-15 09:18:16 -07:00
kennyj
f9c82f586c Fix HWIA#to_hash behavior with array of hashes. 2013-05-16 00:08:58 +09:00
Aaron Patterson
dd03f10d52 only dup the options once, the Callback object does not mutate them 2013-05-14 16:22:29 -07:00
Aaron Patterson
132db318b3 make the compile method thread safe 2013-05-14 16:18:11 -07:00
Aaron Patterson
d2405a0aab use inject rather than multiple assignments 2013-05-14 16:15:57 -07:00
Aaron Patterson
ba55276434 deprecating string based terminators 2013-05-14 16:03:09 -07:00
Aaron Patterson
def815a461 halting lambda must be instance execed 2013-05-14 14:08:39 -07:00
Aaron Patterson
dbee8c3258 fixing arity2 test 2013-05-14 14:03:14 -07:00
Rafael Mendonça França
c7182563e5 Merge pull request #10266 from vipulnsward/fix_HIA_to_hash
fix HashWithIndifferentAccess#to_hash behaviour
2013-05-14 12:39:48 -07:00
Aaron Patterson
e8e7d8357c Merge branch 'polymorphic'
* polymorphic: (41 commits)
  fix shadowed variable warnings
  polymorphic around callbacks
  polymorphic after filter
  rename terminal to halting, try to keep naming consistent
  push the before filter lambdas to factory methods
  polymorphic before callbacks
  use a singleton end node
  Revert "we never pass blocks, so remove this"
  if there is nothing to compile, then do not bother compiling
  Arrays are no longer supported
  we never pass blocks, so remove this
  raise an argument error if the filter arity is greater than 1
  pass the actual filter, not a string
  do not keep a reference to the chain in the callback objects
  fix deprecation test
  push merge code to the callback itself
  dup the callback and set the chain
  remove klass because it is not used
  rename instance variables
  push duplicates? logic to the instance
  ...
2013-05-14 12:04:18 -07:00
Aaron Patterson
78202055c9 fix shadowed variable warnings 2013-05-14 12:03:33 -07:00
Aaron Patterson
87378b0b6d polymorphic around callbacks 2013-05-14 11:48:04 -07:00
Rafael Mendonça França
8ce3c1e5dd Merge pull request #10600 from aditya-kapoor/code_refactor
Removed Class Eval and used define_method instead for the SafeBuffer
2013-05-14 11:39:18 -07:00
Aaron Patterson
e8ddd4f9e5 polymorphic after filter 2013-05-14 11:37:34 -07:00
Aaron Patterson
c5953f7dba rename terminal to halting, try to keep naming consistent 2013-05-14 11:30:14 -07:00
Aaron Patterson
bd95ff84f3 push the before filter lambdas to factory methods 2013-05-14 11:27:24 -07:00
Aaron Patterson
eac50bc335 polymorphic before callbacks 2013-05-14 11:20:34 -07:00
Aaron Patterson
9dcecbb080 Merge branch 'master' into normalizecb
* master:
  private callback methods should work
  Update mail to minimum version 2.5.4
2013-05-14 10:48:43 -07:00
Aaron Patterson
f93da579ce private callback methods should work 2013-05-14 10:48:34 -07:00
aditya-kapoor
426f42c092 Added a blank space and removed to_sym 2013-05-14 19:36:35 +05:30
Aaron Patterson
73aefee3f2 use a singleton end node 2013-05-13 16:59:05 -07:00
Aaron Patterson
d2c0571bf6 Revert "we never pass blocks, so remove this"
This reverts commit 9caf0cf9c8c7b42737ae78c470a5dd2f583ada75.
2013-05-13 16:53:08 -07:00
Aaron Patterson
ccbefff684 if there is nothing to compile, then do not bother compiling 2013-05-13 16:43:27 -07:00
Aaron Patterson
877964dc61 Arrays are no longer supported 2013-05-13 16:41:43 -07:00
Aaron Patterson
9caf0cf9c8 we never pass blocks, so remove this 2013-05-13 15:54:45 -07:00
Aaron Patterson
b308f0d4f1 raise an argument error if the filter arity is greater than 1 2013-05-13 15:50:16 -07:00
Aaron Patterson
edf116a91b Merge branch 'master' into normalizecb
* master:
  adding more callback type coverage
2013-05-13 15:42:01 -07:00
Aaron Patterson
099e827f57 adding more callback type coverage 2013-05-13 15:40:39 -07:00
Aaron Patterson
1ad68e3600 Merge branch 'master' into normalizecb
* master:
  extract getting an setting callbacks to methods
  call extracted method from callback manipulation methods
  extract callback param munging
  no reason to make these defaulted, we always pass values in

Conflicts:
	activesupport/lib/active_support/callbacks.rb
2013-05-13 15:28:02 -07:00
Aaron Patterson
b93cd60949 extract getting an setting callbacks to methods 2013-05-13 14:23:03 -07:00
Aaron Patterson
72be280ffe call extracted method from callback manipulation methods 2013-05-13 14:14:50 -07:00
Aaron Patterson
35c4a2ca95 extract callback param munging 2013-05-13 14:11:09 -07:00
Aaron Patterson
0b9b132e32 no reason to make these defaulted, we always pass values in 2013-05-13 14:02:39 -07:00
aditya-kapoor
069ea45c5d Removed Class Eval and used define_method instead for the SafeBuffer 2013-05-14 01:09:03 +05:30
Aaron Patterson
19b9f7ba33 pass the actual filter, not a string 2013-05-13 12:05:22 -07:00