class ParseDecision::Plugin::Application

#######################################################################

Application XML plugin

Public Class Methods

new() click to toggle source
# File lib/parse_decision/plugin/application.rb, line 19
def initialize()
  $LOG.debug "Application::initialize"
  @fnameTemplate = "@INDEX@-APP.xml"
  @searchStr = "<DECISION_REQUEST><APPLICATION"
  @searchStr = "<APPLICATION "            # Note that the space at end is required.
end

Public Instance Methods

execute(context, ln) click to toggle source
# File lib/parse_decision/plugin/application.rb, line 26
def execute(context, ln)
 #$LOG.debug "Application::execute"
  if(ln.include?(@searchStr))
    context.nextIndex
    context.state = :app
    outfile = apply_template(@fnameTemplate, "@INDEX@", context.indexStr)
    puts "" if context.verbose
    puts "= = = = = = = = = = = = = = = = = = = = = = = = = = = =" if context.verbose
    puts "" if context.verbose
    puts "Creating Application XML file: #{outfile}" if context.verbose
    File.open(context.outputPath(outfile), "w") do |f|
      write_to_file(f,ln)
    end
    return true
  end
  return false
end