Sha256: eb11f368e57d9ac746cfee80e20924d8e18ee0b645c29e26f96a11df8752ecf2

Contents?: true

Size: 1.17 KB

Versions: 23

Compression:

Stored size: 1.17 KB

Contents

#!/usr/bin/env bash

# General tools for manipulating patches
# and dealing with patches.

# Returns the path used to look for a patch given a specific name.
__rvm_patch_lookup_path()
{
  echo "/"

  [[ -n "${rvm_patch_original_pwd:-""}" ]] && echo "$rvm_patch_original_pwd/"

  echo "$PWD/"

  __rvm_ruby_string_paths_under "$rvm_path/patches" | sed 's/$/\//'

  return $?
}

__rvm_expand_patch_name()
{
  local name expanded_patch_name

  name="${1:-""}"

  [[ -z "$name" ]] && return 0

  expanded_patch_name="$("$rvm_path/scripts/patchsets" show "$name")"

  if [[ "$?" == "0" ]]; then
    echo "${expanded_patch_name}"

  elif [[ "$name" != "default" ]]; then
    echo "$name"
  fi

  return 0
}

# Return the full patch for a given patch.
__rvm_lookup_full_patch_path()
{
  local extension patch_path directory directories

  # Absolute path, pwd and then finally the rvm patches path.
  directories=($(__rvm_patch_lookup_path))

  for directory in "${directories[@]}" ; do

    for extension in {"",.patch,.diff}; do

      patch_path="${directory}${1}${extension}"

      if [[ -s "$patch_path" ]]; then
        echo "$patch_path"
        return 0
      fi

    done

  done

  return 0
}

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
gemrage-0.1.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patches
rvm-1.0.14 scripts/patches
rvm-1.0.13 scripts/patches