Class: OodCore::Job::Adapters::Helper Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ood_core/job/adapters/helper.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.bin_path(cmd, bin_default, bin_overrides) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get the configured path to a command allowing overrides from bin_overrides

Parameters:

  • cmd (String)

    the desired command

  • bin_default (String)

    the default place to find cmd on the file system

  • bin_overrides (Hash<String, String>)

    commands associated with the full path to their replacement e.g. => ‘/usr/local/slurm/bin/squeue’

Returns:

  • (String)

    path to the configured command



12
13
14
# File 'lib/ood_core/job/adapters/helper.rb', line 12

def self.bin_path(cmd, bin_default, bin_overrides)
  bin_overrides.fetch(cmd.to_s) { Pathname.new(bin_default.to_s).join(cmd.to_s).to_s }
end