class PpmToGdl::PpmContext

Attributes

options[RW]
ppms[RW]

Public Class Methods

new() click to toggle source
# File lib/ppmtogdl/ppmcontext.rb, line 15
def initialize()
$LOG.debug "PpmContext::initialize()"
  @ppms     = Hash.new
end

Public Instance Methods

createValidName(inname) click to toggle source

Generate a valid guideline (GDL) ID

inname

name to convert

# File lib/ppmtogdl/ppmcontext.rb, line 27
def createValidName(inname)
$LOG.debug "PpmContext::createValidName( #{inname}  )"
  outname = inname.gsub(/[\s\/\\?*#+]/,'')        # Remove illegal chars (replace with underscore).
  outname.gsub!(/_+/,"_")                         # Replace consecutive uscores with single uscore.
  outname.gsub!(/\./,"-")                         # Replace period with dash.
  outname.gsub!(/[\(\)\$]/,"")                    # Remove L & R Parens, dollar signs.
  outname.gsub!(/\%/,"Perc")                      # Replace '%' with Perc.

  outname
end
dumpPpms() click to toggle source

Dump all PPM variables

# File lib/ppmtogdl/ppmcontext.rb, line 57
def dumpPpms()
$LOG.debug "PpmContext::dumpPpms()"
  79.times {print "="}
  puts
  puts "PPM DUMP".center(80)
  79.times {print "="}
  puts

  if(@ppms.length > 0)
    ppms = @ppms.sort
    ppms.each do |key, ppm|
      puts "#{ppm.name}\t(#{ppm.alias})"
    end

  else
    puts "No PPM variables to dump."
  end

  puts ""
end
isPpmVar(var) click to toggle source
# File lib/ppmtogdl/ppmcontext.rb, line 38
def isPpmVar(var)
  isPpm = false

  case var.varType
    when 'app'
      isPpm = true

    when 'crd'
      isPpm = true

    when 'prd'
      isPpm = true

  end # case

  isPpm
end
setOptions(options) click to toggle source
# File lib/ppmtogdl/ppmcontext.rb, line 20
def setOptions(options)
  $LOG.debug "PpmContext::setOptions( #{options} )"
  @options = options
end