aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-11-09 21:11:26 +0100
committerXavier Noria <fxn@hashref.com>2009-11-09 22:16:51 +0100
commit1979e9c8553f4d7905822fdcc99e52d179e78c3c (patch)
treec0b82d5b85bec43c14fc215aa8082e020df35dae
parentd4513ac69958063de3cad9aa655fe9d63e82ec76 (diff)
downloadrails-1979e9c8553f4d7905822fdcc99e52d179e78c3c.tar.gz
rails-1979e9c8553f4d7905822fdcc99e52d179e78c3c.tar.bz2
rails-1979e9c8553f4d7905822fdcc99e52d179e78c3c.zip
Symbol#to_proc is not needed for Ruby >= 1.8.7
-rw-r--r--actionpack/test/controller/filters_test.rb1
-rwxr-xr-xactiverecord/lib/active_record/base.rb1
-rw-r--r--activeresource/test/cases/base/load_test.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/symbol.rb1
-rw-r--r--activesupport/lib/active_support/core_ext/symbol/to_proc.rb14
-rw-r--r--activesupport/lib/active_support/ruby/shim.rb2
-rw-r--r--activesupport/test/core_ext/enumerable_test.rb1
-rw-r--r--activesupport/test/core_ext/symbol_test.rb9
-rw-r--r--activesupport/test/dependencies_test.rb1
9 files changed, 0 insertions, 31 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 2da97a9d86..8445428e8f 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
-require 'active_support/core_ext/symbol'
class ActionController::Base
class << self
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 4e6090458a..056f29f029 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -12,7 +12,6 @@ require 'active_support/core_ext/hash/deep_merge'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/string/behavior'
-require 'active_support/core_ext/symbol'
require 'active_support/core_ext/object/metaclass'
module ActiveRecord #:nodoc:
diff --git a/activeresource/test/cases/base/load_test.rb b/activeresource/test/cases/base/load_test.rb
index 189a4d81fe..7745a9439b 100644
--- a/activeresource/test/cases/base/load_test.rb
+++ b/activeresource/test/cases/base/load_test.rb
@@ -1,7 +1,6 @@
require 'abstract_unit'
require "fixtures/person"
require "fixtures/street_address"
-require 'active_support/core_ext/symbol'
require 'active_support/core_ext/hash/conversions'
module Highrise
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
diff --git a/activesupport/lib/active_support/ruby/shim.rb b/activesupport/lib/active_support/ruby/shim.rb
index 37c57c485a..43e7ffc938 100644
--- a/activesupport/lib/active_support/ruby/shim.rb
+++ b/activesupport/lib/active_support/ruby/shim.rb
@@ -9,7 +9,6 @@
# Process Process.daemon
# REXML security fix
# String ord
-# Symbol to_proc
# Time to_date, to_time, to_datetime
require 'active_support'
require 'active_support/core_ext/date/calculations'
@@ -20,5 +19,4 @@ require 'active_support/core_ext/object/tap'
require 'active_support/core_ext/process/daemon'
require 'active_support/core_ext/string/conversions'
require 'active_support/core_ext/rexml'
-require 'active_support/core_ext/symbol/to_proc'
require 'active_support/core_ext/time/conversions'
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb
index 4170de3dce..a8e98891d3 100644
--- a/activesupport/test/core_ext/enumerable_test.rb
+++ b/activesupport/test/core_ext/enumerable_test.rb
@@ -1,6 +1,5 @@
require 'abstract_unit'
require 'active_support/core_ext/array'
-require 'active_support/core_ext/symbol'
require 'active_support/core_ext/enumerable'
Payment = Struct.new(:price)
diff --git a/activesupport/test/core_ext/symbol_test.rb b/activesupport/test/core_ext/symbol_test.rb
deleted file mode 100644
index 1eaccb9965..0000000000
--- a/activesupport/test/core_ext/symbol_test.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'abstract_unit'
-
-class SymbolTests < Test::Unit::TestCase
- def test_to_proc
- assert_equal %w(one two three), [:one, :two, :three].map(&:to_s)
- assert_equal(%w(one two three),
- {1 => "one", 2 => "two", 3 => "three"}.sort_by(&:first).map(&:last))
- end
-end
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 97d70cf8c4..0fcf1eaf00 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -3,7 +3,6 @@ require 'pp'
require 'active_support/dependencies'
require 'active_support/core_ext/module/loading'
require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/symbol/to_proc'
module ModuleWithMissing
mattr_accessor :missing_count