mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Syntax (spacing)
This commit is contained in:
parent
ba56310415
commit
bdee20cf21
2 changed files with 17 additions and 13 deletions
|
|
@ -2,15 +2,15 @@
|
|||
# available to younger rubies. It trys hard to not re-require
|
||||
# files.
|
||||
|
||||
unless Kernel.respond_to?( :require_relative )
|
||||
unless Kernel.respond_to?(:require_relative)
|
||||
module Kernel
|
||||
def require_relative( path )
|
||||
desired_path = File.expand_path( '../' + path.to_str, caller[0] )
|
||||
def require_relative(path)
|
||||
desired_path = File.expand_path('../'+path.to_str, caller[0])
|
||||
shortest = desired_path
|
||||
$:.each do |path|
|
||||
path += '/'
|
||||
if desired_path.index( path ) == 0
|
||||
candidate = desired_path.sub( path, '' )
|
||||
if desired_path.index(path) == 0
|
||||
candidate = desired_path.sub(path, '')
|
||||
shortest = candidate if candidate.size < shortest.size
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue