Module: EasyType::FileIncluder
- Defined in:
- lib/easy_type/file_includer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#include_file(name) ⇒ Object
This is an implementation of a C like include.
Class Method Details
.included(parent) ⇒ Object
6 7 8 |
# File 'lib/easy_type/file_includer.rb', line 6 def self.included(parent) parent.extend(FileIncluder) end |
Instance Method Details
#include_file(name) ⇒ Object
This is an implementation of a C like include. You can use this at places where Puppet doesn’t support parent-classed like when defining Custum Types. include_file uses the already established search path. If you need to include a file from a subdirectory, use the subdirectory name
26 27 28 29 30 |
# File 'lib/easy_type/file_includer.rb', line 26 def include_file(name) full_name = get_ruby_file(name) fail ArgumentError, "file #{name} not found" unless full_name eval(IO.read(full_name), nil, full_name) end |