Method: OrgMode::Configuration#read_and_evaluate
- Defined in:
- lib/org_mode/configuration.rb
#read_and_evaluate ⇒ Object
Reads a config file and avaluates it.
Returns a Configuration object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/org_mode/configuration.rb', line 116 def read_and_evaluate contents = ::File.open(path).read instance_eval " ::Configuration.for('org-mode') do\n \#{contents}\n end\n RUBY\n\n ::Configuration.for('org-mode')\n\nrescue ::Errno::ENOENT => e\n raise NonExistant, \"config file does not exist\"\nrescue ::IOError, ::SystemCallError => e\n raise IOError, \"problem loading config: \#{e}\"\nrescue ::ScriptError => e\n raise ScriptError, \"problem loading config: \#{e}\"\nend\n", path, 0 |