class SystemUtils

Class containing system utility funcions.

Public Instance Methods

setup() click to toggle source

Sets up the class.

# File lib/ceedling/system_utils.rb, line 17
def setup
  @tcsh_shell = nil
end
tcsh_shell?() click to toggle source

Checks the system shell to see if it a tcsh shell.

# File lib/ceedling/system_utils.rb, line 23
def tcsh_shell?
  # once run a single time, return state determined at that execution
  return @tcsh_shell if not @tcsh_shell.nil?

  result = @system_wrapper.shell_backticks('echo $version')

  if ((result[:exit_code] == 0) and (result[:output].strip =~ /^tcsh/))
    @tcsh_shell = true
  else
    @tcsh_shell = false
  end

  return @tcsh_shell
end