Sha256: e356eba4755440922cab5680beff0ed0aad1579bf3397ca90d66abca9f27bc66

Contents?: true

Size: 565 Bytes

Versions: 11

Compression:

Stored size: 565 Bytes

Contents

#
# Compatibility for older rubies
#

unless Object.method_defined?(:__send)
  class Object
    alias __send __send__
  end
end

unless Object.method_defined?(:funcall)
  class Object
    alias funcall __send
  end
end

unless String.method_defined?(:lines)
  class String
    alias lines to_a
  end
end

unless String.method_defined?(:bytesize)
  class String
    alias bytesize size
  end
end

def fopen(*args, &block)
  option = args[1]
  if option and !Object.const_defined?(:Encoding)
    args[1] = option.sub(/:.*\z/, '')
  end
  File.open(*args, &block)
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bitclust-core-1.2.5 lib/bitclust/compat.rb
bitclust-core-1.2.4 lib/bitclust/compat.rb
bitclust-core-1.2.3 lib/bitclust/compat.rb
bitclust-core-1.2.2 lib/bitclust/compat.rb
bitclust-core-1.2.1 lib/bitclust/compat.rb
bitclust-core-1.2.0 lib/bitclust/compat.rb
bitclust-core-1.1.1 lib/bitclust/compat.rb
bitclust-core-1.1.0 lib/bitclust/compat.rb
bitclust-core-1.0.0 lib/bitclust/compat.rb
bitclust-core-0.9.6 lib/bitclust/compat.rb
bitclust-core-0.9.5 lib/bitclust/compat.rb