Sha256: fa19d07f2cf73d0cf85f111e3f675458e291add0912dfa0b859b257628ff876e

Contents?: true

Size: 409 Bytes

Versions: 10

Compression:

Stored size: 409 Bytes

Contents

require 'rubygems'
require 'test-unit'
require 'uri'
require 'http/cookie'

module Enumerable
  def combine
    masks = inject([[], 1]){|(ar, m), e| [ar << m, m << 1 ] }[0]
    all = masks.inject(0){ |al, m| al|m }

    result = []
    for i in 1..all do
      tmp = []
      each_with_index do |e, idx|
        tmp << e unless (masks[idx] & i) == 0
      end
      result << tmp
    end
    result
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
http-cookie-1.0.0.pre11 test/helper.rb
http-cookie-1.0.0.pre10 test/helper.rb
http-cookie-1.0.0.pre9 test/helper.rb
http-cookie-1.0.0.pre8 test/helper.rb
http-cookie-1.0.0.pre7 test/helper.rb
http-cookie-1.0.0.pre6 test/helper.rb
http-cookie-1.0.0.pre5 test/helper.rb
http-cookie-1.0.0.pre4 test/helper.rb
http-cookie-1.0.0.pre3 test/helper.rb
http-cookie-1.0.0.pre2 test/helper.rb