Sha256: 4f78c57f578f08a80e1d38fb6e61e37f1f9cb7b03710e574e25187fc9275a953
Contents?: true
Size: 707 Bytes
Versions: 24
Compression:
Stored size: 707 Bytes
Contents
# Must be defined outside of Kernel for jruby, see http://jira.codehaus.org/browse/JRUBY-3609 Enumerator = Enumerable::Enumerator unless Object.const_defined? :Enumerator # Standard in ruby 1.9 class Enumerator # new with block, standard in Ruby 1.9 unless (self.new{} rescue false) def initialize_with_optional_block(*arg, &block) return initialize_without_optional_block(*arg, &nil) unless arg.empty? # Ruby 1.9 apparently ignores the block if any argument is present initialize_without_optional_block(Backports::Yielder.new(&block)) end Backports.alias_method_chain self, :initialize, :optional_block end Backports.alias_method self, :with_object, :each_with_object end
Version data entries
24 entries across 24 versions & 1 rubygems