Puppet Function: compile_redirects

Defined in:
modules/mediawiki/lib/puppet/parser/functions/compile_redirects.rb
Function type:
Ruby 3.x API

Overview

compile_redirects()Any

Returns:

  • (Any)


404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'modules/mediawiki/lib/puppet/parser/functions/compile_redirects.rb', line 404

newfunction(:compile_redirects, :type => :rvalue) do |args|
  raise Puppet::ParseError, 'compile_redirects() requires at least one argument' if args.length < 1 || args.length > 2
  Puppet::Parser::Functions.autoloader.loadall
  input = case args.first
          when %r{^puppet://.*} then Puppet::FileServing::Content.indirection.find($&).content.force_encoding("utf-8")
          when %r{^/} then function_file(args)
          else args.first
          end
  if args.length == 1
    web_server = 'apache'
  else
    web_server = args[1]
  end
  parser = DomainRedirects::Parser.new(input, web_server)
  parser.parse
end