From 1979e9c8553f4d7905822fdcc99e52d179e78c3c Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 9 Nov 2009 21:11:26 +0100 Subject: Symbol#to_proc is not needed for Ruby >= 1.8.7 --- activesupport/lib/active_support/core_ext/symbol.rb | 1 - .../lib/active_support/core_ext/symbol/to_proc.rb | 14 -------------- 2 files changed, 15 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/symbol.rb delete mode 100644 activesupport/lib/active_support/core_ext/symbol/to_proc.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/symbol.rb b/activesupport/lib/active_support/core_ext/symbol.rb deleted file mode 100644 index c103cd9dcf..0000000000 --- a/activesupport/lib/active_support/core_ext/symbol.rb +++ /dev/null @@ -1 +0,0 @@ -require 'active_support/core_ext/symbol/to_proc' diff --git a/activesupport/lib/active_support/core_ext/symbol/to_proc.rb b/activesupport/lib/active_support/core_ext/symbol/to_proc.rb deleted file mode 100644 index 520369452b..0000000000 --- a/activesupport/lib/active_support/core_ext/symbol/to_proc.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Symbol - # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples: - # - # # The same as people.collect { |p| p.name } - # people.collect(&:name) - # - # # The same as people.select { |p| p.manager? }.collect { |p| p.salary } - # people.select(&:manager?).collect(&:salary) - # - # This is a builtin method in Ruby 1.8.7 and later. - def to_proc - Proc.new { |*args| args.shift.__send__(self, *args) } - end unless :to_proc.respond_to?(:to_proc) -end -- cgit v1.2.3