Module: S4tUtils::Hidden

Defined in:
lib/s4t-utils/load-path-auto-adjuster.rb

Overview

:nodoc: all

Defined Under Namespace

Classes: Arranger

Class Method Summary collapse

Class Method Details

.auto_adjust_load_pathObject



107
108
109
110
111
112
113
114
115
116
# File 'lib/s4t-utils/load-path-auto-adjuster.rb', line 107

def self.auto_adjust_load_path
  $:.shift   # Remove extra element used to find this file.
  
  # Having loaded us, __FILE__ is something like this:
  # ...lib.../package/third-party/s4t-utils/load-path-auto-adjuster.rb
  relative_third_party = Pathname.new(__FILE__).parent.parent
  # Pathname#real_path doesn't work on Windows (1.8.2). Grr.
  third_party = Pathname.new(File.expand_path(relative_third_party.to_s))
  Arranger.arrange_path_around(third_party)
end