Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove Ruby < 1.8.7 specific extensions.

  • Loading branch information...
commit d507d7a39a09a546570cab1d13adedf5992827b4 1 parent b9a901a
@weppos authored
Showing with 0 additions and 33 deletions.
  1. +0 −23 lib/core_ext.rb
  2. +0 −10 test/whois/core_ext_test.rb
View
23 lib/core_ext.rb
@@ -1,26 +1,3 @@
-unless :to_proc.respond_to?(:to_proc)
- 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)
- #
- # Extracted from ActiveSupport.
- #
- # Returns a Proc which incapsulates the method business logic.
- def to_proc
- Proc.new { |*args| args.shift.__send__(self, *args) }
- end
- end
-end
-
-
require 'date'
class DateTime
View
10 test/whois/core_ext_test.rb
@@ -1,15 +1,5 @@
require 'test_helper'
-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
-
-
class DateTimeExtCalculationsTest < Test::Unit::TestCase
def test_to_time
Please sign in to comment.
Something went wrong with that request. Please try again.