Class: Escort::Setup::Configuration::Locator::ExecutingScriptDirectory

Inherits:
Base
  • Object
show all
Defined in:
lib/escort/setup/configuration/locator/executing_script_directory.rb

Instance Attribute Summary

Attributes inherited from Base

#filename

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Escort::Setup::Configuration::Locator::Base

Instance Method Details

#locateObject



6
7
8
9
10
# File 'lib/escort/setup/configuration/locator/executing_script_directory.rb', line 6

def locate
  location_directory = File.dirname($0)
  filepath = File.expand_path(File.join(location_directory, filename))
  File.exists?(filepath) ? filepath : nil
end