Class: OpsBuild::Validations

Inherits:
Object
  • Object
show all
Defined in:
lib/ops_build/validations.rb

Class Method Summary collapse

Class Method Details

.check_binary!(bin) ⇒ Object



7
8
9
# File 'lib/ops_build/validations.rb', line 7

def self.check_binary!(bin)
  raise "Binary '#{bin}' not found!" if `which #{bin}`.empty?
end

.not_empty!(val, var_name) ⇒ Object



3
4
5
# File 'lib/ops_build/validations.rb', line 3

def self.not_empty!(val, var_name)
  raise "'#{var_name}' cannot be empty!" if val.nil? || val.empty?
end