Sha256: 496d0e27e964fba0d6d5c0156bf9fe59ed81774185d47714675f845a396794f9

Contents?: true

Size: 498 Bytes

Versions: 14

Compression:

Stored size: 498 Bytes

Contents

module Kernel
  unless const_defined? :StopIteration
    
    class StopIteration < IndexError; end

    def loop_with_stop_iteration(&block)
      loop_without_stop_iteration(&block)
    rescue StopIteration
      # ignore silently
    end
    alias_method_chain :loop, :stop_iteration
    
  end
  
  def __callee__
    caller(1).first[/`(.*)'/,1].try(:to_sym)
  end unless (__callee__ || true rescue false)
  
  alias_method :__method__, :__callee__  unless (__method__ || true rescue false)
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
marcandre-backports-1.6.0 lib/backports/kernel.rb
marcandre-backports-1.6.1 lib/backports/kernel.rb
marcandre-backports-1.6.3 lib/backports/kernel.rb
marcandre-backports-1.6.4 lib/backports/kernel.rb
marcandre-backports-1.6.6 lib/backports/kernel.rb
marcandre-backports-1.6.7 lib/backports/kernel.rb
marcandre-backports-1.6.8 lib/backports/kernel.rb
backports-1.6.8 lib/backports/kernel.rb
backports-1.6.1 lib/backports/kernel.rb
backports-1.6.7 lib/backports/kernel.rb
backports-1.6.4 lib/backports/kernel.rb
backports-1.6.3 lib/backports/kernel.rb
backports-1.6.6 lib/backports/kernel.rb
backports-1.6.0 lib/backports/kernel.rb