Sha256: 952ac1362fa6854099b87039b7119d54915e4cef2639d081145db7d714e1430a

Contents?: true

Size: 743 Bytes

Versions: 2

Compression:

Stored size: 743 Bytes

Contents

module Shell
  private
  def run(command)
    if (!system(command))
      raise "error running command: #{command}"
    end
  end
  
  def run_command(full_command)
    if (@command_runner)
      @command_runner.call(full_command)
    else
      run(full_command)
    end
  end

  def check_directory(path)
    raise "#{path} is not a directory" unless File.directory? path    
    return path
  end
  
  def get_environment(name)
    value = ENV[name]
    raise "#{name} is not set" unless value
    return value
  end
  
  def get_environment_or_default(name, default_value='')
    value = ENV[name]
    value = default_value if not value
    return value
  end

end

class SystemCommandRunner
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
BuildMaster-0.5.0 lib/buildmaster/shell_command.rb
BuildMaster-0.6.0 lib/buildmaster/shell_command.rb