Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/hoe.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) read_utf(path)

Like File::read, but strips out a BOM marker if it exists.



682
683
684
685
686
# File 'lib/hoe.rb', line 682

def self.read_utf path
  open path, 'rb' do |f|
    f.read.sub %r/\A\xEF\xBB\xBF/, ''
  end
end