Method: Im::Loader::Config#push_dir
- Defined in:
- lib/im/loader/config.rb
#push_dir(path) ⇒ Object
Pushes ‘path` to the list of root directories.
Raises ‘Im::Error` if `path` does not exist, or if another loader in the same process already manages that directory or one of its ascendants or descendants.
109 110 111 112 113 114 115 116 117 |
# File 'lib/im/loader/config.rb', line 109 def push_dir(path) abspath = File.(path) if dir?(abspath) raise_if_conflicting_directory(abspath) root_dirs << abspath else raise Im::Error, "the root directory #{abspath} does not exist" end end |