Module Ohai::Mixin::FromFile
In: lib/ohai/mixin/from_file.rb
Mixlib::CLI Application System RuntimeError Exec Config Log lib/ohai/config.rb lib/ohai/log.rb lib/ohai/system.rb lib/ohai/application.rb Command FromFile Mixin lib/ohai/exception.rb Exceptions Ohai dot/m_130_0.png

Methods

from_file  

Public Instance methods

Loads a given ruby file, and runs instance_eval against it in the context of the current object.

Raises an IOError if the file cannot be found, or is not readable.

[Source]

    # File lib/ohai/mixin/from_file.rb, line 27
27:       def from_file(filename)
28:         if File.exists?(filename) && File.readable?(filename)
29:           self.instance_eval(IO.read(filename), filename, 1)
30:         else
31:           raise IOError, "Cannot open or read #{filename}!"
32:         end
33:       end

[Validate]