From 1c481be331f32a7768b1017b86bd1b1beea02efc Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sun, 13 May 2012 13:44:35 -0300 Subject: [PATCH] Remove blockless_step leave all that up to Ruby Closes #6297 --- activesupport/lib/active_support/core_ext/range.rb | 1 - .../active_support/core_ext/range/blockless_step.rb | 13 ------------- activesupport/test/core_ext/range_ext_test.rb | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/range/blockless_step.rb diff --git a/activesupport/lib/active_support/core_ext/range.rb b/activesupport/lib/active_support/core_ext/range.rb index c0736f3a44..1d8b1ede5a 100644 --- a/activesupport/lib/active_support/core_ext/range.rb +++ b/activesupport/lib/active_support/core_ext/range.rb @@ -1,4 +1,3 @@ -require 'active_support/core_ext/range/blockless_step' require 'active_support/core_ext/range/conversions' require 'active_support/core_ext/range/include_range' require 'active_support/core_ext/range/overlaps' diff --git a/activesupport/lib/active_support/core_ext/range/blockless_step.rb b/activesupport/lib/active_support/core_ext/range/blockless_step.rb deleted file mode 100644 index f687287f0d..0000000000 --- a/activesupport/lib/active_support/core_ext/range/blockless_step.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'active_support/core_ext/module/aliasing' - -class Range - def step_with_blockless(*args, &block) #:nodoc: - if block_given? - step_without_blockless(*args, &block) - else - step_without_blockless(*args).to_a - end - end - - alias_method_chain :step, :blockless -end diff --git a/activesupport/test/core_ext/range_ext_test.rb b/activesupport/test/core_ext/range_ext_test.rb index 9c3389ba82..78a3bd8c85 100644 --- a/activesupport/test/core_ext/range_ext_test.rb +++ b/activesupport/test/core_ext/range_ext_test.rb @@ -70,7 +70,7 @@ def test_should_include_identical_exclusive_with_floats end def test_blockless_step - assert_equal [1,3,5,7,9], (1..10).step(2) + assert_equal [1,3,5,7,9], (1..10).step(2).to_a end def test_original_step -- GitLab