Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #34 from github/dbussink/rails32-proc-bind
Browse files Browse the repository at this point in the history
Remove Proc#bind from Rails 3.2
  • Loading branch information
dbussink committed Oct 9, 2014
2 parents b6f150c + c831f67 commit eadedf7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
3 changes: 1 addition & 2 deletions actionmailer/lib/action_mailer/base.rb
Expand Up @@ -2,7 +2,6 @@
require 'action_mailer/collector'
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/module/anonymous'
Expand Down Expand Up @@ -627,7 +626,7 @@ def mail(headers={}, &block)

# Call all the procs (if any)
default_values = self.class.default.merge(self.class.default) do |k,v|
v.respond_to?(:call) ? v.bind(self).call : v
v.respond_to?(:call) ? instance_eval(&v) : v
end

# Handle defaults
Expand Down
14 changes: 0 additions & 14 deletions activesupport/lib/active_support/core_ext/proc.rb

This file was deleted.

7 changes: 5 additions & 2 deletions activesupport/lib/active_support/rescuable.rb
@@ -1,6 +1,5 @@
require 'active_support/concern'
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/array/extract_options'

Expand Down Expand Up @@ -108,7 +107,11 @@ def handler_for_rescue(exception)
when Symbol
method(rescuer)
when Proc
rescuer.bind(self)
if rescuer.arity == 0
Proc.new { instance_exec(&rescuer) }
else
Proc.new { |_exception| instance_exec(_exception, &rescuer) }
end
end
end
end
Expand Down
12 changes: 0 additions & 12 deletions activesupport/test/core_ext/proc_test.rb

This file was deleted.

0 comments on commit eadedf7

Please sign in to comment.