aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/range/blockless_step.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/range/blockless_step.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/range/blockless_step.rb29
1 files changed, 0 insertions, 29 deletions
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 db42ef5c47..0000000000
--- a/activesupport/lib/active_support/core_ext/range/blockless_step.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'active_support/core_ext/module/aliasing'
-
-class Range
- begin
- (1..2).step
- # Range#step doesn't return an Enumerator
- rescue LocalJumpError
- # Return an array when step is called without a block.
- def step_with_blockless(*args, &block)
- if block_given?
- step_without_blockless(*args, &block)
- else
- array = []
- step_without_blockless(*args) { |step| array << step }
- array
- end
- end
- else
- def step_with_blockless(*args, &block) #:nodoc:
- if block_given?
- step_without_blockless(*args, &block)
- else
- step_without_blockless(*args).to_a
- end
- end
- end
-
- alias_method_chain :step, :blockless
-end