Module: BlackStack::OCRA

Defined in:
lib/functions.rb

Overview


OCRA Supporting Functions


Class Method Summary collapse

Class Method Details

.require_in_working_path(filename, path, show_path_info = false) ⇒ Object

OCRA files run into a temp folder, where the script is unpacked.

This function is useful to require a configuration file when the script is running inside an OCRA temp folder, since the local folder of the running command is not the filder where the exe file is hosted.

More information:



50
51
52
53
54
55
56
57
58
# File 'lib/functions.rb', line 50

def self.require_in_working_path(filename, path, show_path_info=false)
	puts '' if show_path_info
	path = File.expand_path File.dirname(path)
	#path = Dir.pwd
	puts "require_in_working_path.path:#{path}:." if show_path_info
	file = "#{path}/#{filename}"
	puts "require_in_working_path.file:#{file}:." if show_path_info
	require file
end