Class: RDI::ContextModifiers::SystemPath

Inherits:
Model::ContextModifier show all
Defined in:
lib/rdi/Plugins/ContextModifiers/SystemPath.rb

Instance Attribute Summary

Attributes inherited from Model::ContextModifier

#LocationSelectorName

Instance Method Summary collapse

Instance Method Details

#addLocationToContext(iLocation) ⇒ Object

Add a given location to the context

Parameters:

  • iLocation (Object): Location to add



56
57
58
59
# File 'lib/rdi/Plugins/ContextModifiers/SystemPath.rb', line 56

def addLocationToContext(iLocation)
  # * *iLocation* (_String_): Directory
  $rUtilAnts_Platform_Info.setSystemExePath($rUtilAnts_Platform_Info.getSystemExePath + [ iLocation ])
end

#getLocationSelectorNameObject

Get the name of classes that provide selection facility for locations

Return:

  • String: The name of the LocationSelector class



18
19
20
# File 'lib/rdi/Plugins/ContextModifiers/SystemPath.rb', line 18

def getLocationSelectorName
  return 'Directory'
end

#isLocationInContext?(iLocation) ⇒ Boolean

Is a given location present in the context ?

Parameters:

  • iLocation (Object): Location to add

Return:

  • Boolean: Is the location already present ?

Returns:

  • (Boolean)


47
48
49
50
# File 'lib/rdi/Plugins/ContextModifiers/SystemPath.rb', line 47

def isLocationInContext?(iLocation)
  # * *iLocation* (_String_): Directory
  return $rUtilAnts_Platform_Info.getSystemExePath.include?(iLocation)
end

#removeLocationFromContext(iLocation) ⇒ Object

Remove a given location from the context

Parameters:

  • iLocation (Object): Location to remove



65
66
67
68
# File 'lib/rdi/Plugins/ContextModifiers/SystemPath.rb', line 65

def removeLocationFromContext(iLocation)
  # * *iLocation* (_String_): Directory
  $rUtilAnts_Platform_Info.setSystemExePath($rUtilAnts_Platform_Info.getSystemExePath - [ iLocation ])
end

#transformContentWithInstallEnv(iLocation, iInstallEnv) ⇒ Object

Transform a given content based on an installation environment. This is called to pass some specific installation parameters to a more generic content (useful for installation directories for example)

Parameters:

  • iLocation (Object): Location to transform

  • iInstallEnv (map<Symbol,Object>): The installation environment that called this context modification

Return:

  • Object: The location transformed with the installation environment



30
31
32
33
34
35
36
37
38
39
# File 'lib/rdi/Plugins/ContextModifiers/SystemPath.rb', line 30

def transformContentWithInstallEnv(iLocation, iInstallEnv)
  rNewLocation = iLocation

  lInstallDir = iInstallEnv[:InstallDir]
  if (lInstallDir != nil)
    rNewLocation = iLocation.gsub(/%INSTALLDIR%/, lInstallDir)
  end

  return rNewLocation
end