Sha256: a24f5d6f1cb66a4fb0f4d3ba93b86b524941683d99faab1ebd5402329c6f0e7d

Contents?: true

Size: 456 Bytes

Versions: 10

Compression:

Stored size: 456 Bytes

Contents

# DEPRECATE
require 'facets/file/create'
require 'facets/file/append'
require 'facets/file/writelines'

class File

  # Writes the given data to the given path and closes the file.  This is
  # done in binary mode, complementing <tt>IO.read</tt> in standard Ruby.
  #
  # Returns the number of bytes written.
  #
  # CREDIT: Gavin Sinclair

  def self.write(path, data)
    File.open(path, "wb") do |file|
      return file.write(data)
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/file/write.rb
facets-2.8.3 lib/core/facets/file/write.rb
facets-2.8.2 lib/core/facets/file/write.rb
facets-2.8.1 lib/core/facets/file/write.rb
facets-2.8.0 lib/core/facets/file/write.rb
facets-2.7.0 lib/core/facets/file/write.rb
facets-2.6.0 lib/core/facets/file/write.rb
facets-2.5.0 lib/core/facets/file/write.rb
facets-2.5.1 lib/core/facets/file/write.rb
facets-2.5.2 lib/core/facets/file/write.rb