aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-01 22:38:28 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-07-01 22:38:28 -0300
commitf62fb985b6a7b90872148f0786219c9cc94c9356 (patch)
treeb8d24927a0d48d4aceca5f6d0fee81b01c9f4a6f /activesupport
parent1c06bd17a9faf0ad05bf0336eea4d219c0960bbc (diff)
downloadrails-f62fb985b6a7b90872148f0786219c9cc94c9356.tar.gz
rails-f62fb985b6a7b90872148f0786219c9cc94c9356.tar.bz2
rails-f62fb985b6a7b90872148f0786219c9cc94c9356.zip
Remove deprecated `Proc#bind` with no replacement.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG.md4
-rw-r--r--activesupport/lib/active_support/core_ext/proc.rb17
-rw-r--r--activesupport/lib/active_support/rescuable.rb1
-rw-r--r--activesupport/test/core_ext/proc_test.rb14
4 files changed, 4 insertions, 32 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index bd3d20d0f9..d4679eac6c 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove deprecated `Proc#bind` with no replacement.
+
+ *Carlos Antonio da Silva*
+
* Remove deprecated `Array#uniq_by` and `Array#uniq_by!`, use native
`Array#uniq` and `Array#uniq!` instead.
diff --git a/activesupport/lib/active_support/core_ext/proc.rb b/activesupport/lib/active_support/core_ext/proc.rb
deleted file mode 100644
index 166c3855a0..0000000000
--- a/activesupport/lib/active_support/core_ext/proc.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require "active_support/core_ext/kernel/singleton_class"
-require "active_support/deprecation"
-
-class Proc #:nodoc:
- def bind(object)
- ActiveSupport::Deprecation.warn 'Proc#bind is deprecated and will be removed in future versions'
-
- block, time = self, Time.now
- object.class_eval do
- method_name = "__bind_#{time.to_i}_#{time.usec}"
- define_method(method_name, &block)
- method = instance_method(method_name)
- remove_method(method_name)
- method
- end.bind(object)
- end
-end
diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb
index 9a038dfbca..a7eba91ac5 100644
--- a/activesupport/lib/active_support/rescuable.rb
+++ b/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'
diff --git a/activesupport/test/core_ext/proc_test.rb b/activesupport/test/core_ext/proc_test.rb
deleted file mode 100644
index c4d5592196..0000000000
--- a/activesupport/test/core_ext/proc_test.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'abstract_unit'
-require 'active_support/core_ext/proc'
-
-class ProcTests < ActiveSupport::TestCase
- def test_bind_returns_method_with_changed_self
- assert_deprecated do
- block = Proc.new { self }
- assert_equal self, block.call
- bound_block = block.bind("hello")
- assert_not_equal block, bound_block
- assert_equal "hello", bound_block.call
- end
- end
-end