module Chef::Mixin::Template

Public Class Methods

binread(file) click to toggle source

A compatibility wrapper around IO.binread so it works on Ruby 1.8.7. – Used in the TemplateContext class, but that method namespace is shared with user code, so we want to avoid adding methods there when possible.

# File lib/chef/mixin/template.rb, line 30
def self.binread(file)
  if IO.respond_to?(:binread)
    IO.binread(file)
  else
    File.open(file, "rb") {|f| f.read }
  end
end