Class: File

### Home Classes Methods

### In Files

- lib/hoe.rb

### Parent

Object

### Methods

- ::read_utf

### Files

- History.rdoc
- Manifest.txt

### Class/Module Index

Quicksearch

- Hoe
- Hoe::Clean
- Hoe::Compiler
- Hoe::Debug
- Hoe::Deps
- Hoe::Flay
- Hoe::Flog
- Hoe::GemPreludeSucks
- Hoe::Gemcutter
- Hoe::Inline
- Hoe::Newb
- Hoe::Package
- Hoe::Publish
- Hoe::RCov
- Hoe::Racc
- Hoe::Rdoc
- Hoe::Signing
- Hoe::Test
- Rake
- Rake::Task
- Rake::TaskManager
- File
- Object
- String

No matching classes.

# File

### Public Class Methods

read_utf(path) click to toggle source

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

    # File lib/hoe.rb, line 884
    def self.read_utf path
      r19 = "<3".respond_to? :encoding
      opt = r19 ? "r:bom|utf-8" : "rb"

      open path, opt do |f|
        if r19 then
          f.read
        else
          f.read.sub %\A\xEF\xBB\xBF%, ""
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.