15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/vagrant-node/obmanager.rb', line 15
def procs_for_path(path)
return Config.capture_configures do
begin
modaux=Module.new
res=modaux.module_eval(File.read(path))
obconstants = Object.constants
modaux.constants.each do |var|
Object.send(:remove_const,var) if Object.constants.include?(var)
end
Kernel.load path
rescue SyntaxError => e
raise Errors::VagrantfileSyntaxError, :file => e.message
rescue SystemExit
raise
rescue Vagrant::Errors::VagrantError
raise
rescue Exception => e
@logger.error("Vagrantfile load error: #{e.message}")
@logger.error(e.backtrace.join("\n"))
raise Errors::VagrantfileLoadError,
:path => path,
:message => e.message
end
end
end
|