Sha256: a3a789f787939427c48d98a4fceb6e44e0c2e6e8c10742324202f7e823b1d6b5
Contents?: true
Size: 366 Bytes
Versions: 54
Compression:
Stored size: 366 Bytes
Contents
# if given a filename, writes to the file (and returns the filename), # otherwise, writes to a string. Yields an io object to write to. def write_file_or_string(filename=nil, &block) out = if filename File.open(filename,'w') else StringIO.new end block.call(out) if filename out.close filename else out.string end end
Version data entries
54 entries across 54 versions & 1 rubygems