Module: BuildpackSupport::QualifyPath

Defined in:
lib/buildpack_support/qualify_path.rb

Overview

Mixin with a method for qualifying a given path relative to a root

Instance Method Summary collapse

Instance Method Details

#qualify_path(path, root = @droplet_root) ⇒ String

Qualifies the path such that is is formatted as $PWD/<path>. Also ensures that the path is relative to a root, which defaults to the @droplet_root of the class.

Parameters:

  • path (Pathname)

    the path to qualify

  • root (Pathname) (defaults to: @droplet_root)

    the root to make relative to

Returns:

  • (String)

    the qualified path



30
31
32
# File 'lib/buildpack_support/qualify_path.rb', line 30

def qualify_path(path, root = @droplet_root)
  "$PWD/#{path.relative_path_from(root)}"
end