Sha256: d225d872743b967d0c4b2dc235d7f513c48191a1db9c744b10ccaa763fdc2ed0

Contents?: true

Size: 329 Bytes

Versions: 4

Compression:

Stored size: 329 Bytes

Contents

module IOStreams
  module File
    class Writer
      # Write to a file or stream
      def self.open(file_name_or_io, _=nil, &block)
        unless file_name_or_io.respond_to?(:write)
          ::File.open(file_name_or_io, 'wb', &block)
        else
          block.call(file_name_or_io)
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iostreams-0.8.2 lib/io_streams/file/writer.rb
iostreams-0.8.1 lib/io_streams/file/writer.rb
iostreams-0.8.0 lib/io_streams/file/writer.rb
iostreams-0.7.0 lib/io_streams/file/writer.rb