Sha256: 74ce5ecbf9f8e8e12bf4fbb8fbd4c15aac35747653a64d716a2bf466cc34aa80
Contents?: true
Size: 587 Bytes
Versions: 3
Compression:
Stored size: 587 Bytes
Contents
class File # Read in a file as binary data. # # CREDIT: George Moschovitis def self.read_binary(fname) open(fname, 'rb') {|f| return f.read } end # Reads in a file, removes blank lines and remarks # (lines starting with '#') and then returns # an array of all the remaining lines. # # CREDIT: Trans def self.read_list(filepath, chomp_string='') farr = nil farr = read(filepath).split("\n") farr.collect! { |line| l = line.strip.chomp(chomp_string) (l.empty? or l[0,1] == '#') ? nil : l } farr.compact end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
facets-2.2.0 | lib/core/facets/file/read.rb |
facets-2.2.1 | lib/core/facets/file/read.rb |
facets-2.3.0 | lib/core/facets/file/read.rb |