modules/vhosts_whimsy/lib/puppet/parser/functions/preprocess_vhosts.rb
# common logic to add/update an Apache http config section
common logic to add/update an Apache http config section
common logic to add / update an Apache http config section
def section(tag, path, content=nil)
      unless @fragment.include? "<#{tag} #{path}>"
        @fragment += "\n<#{tag} #{path}>\n</#{tag}>\n"
      end
      if content
        path = Regexp.escape(path)
        content.strip!.gsub! /^#{content[/^\s+/]}/, '  '
        @fragment[/\n<#{tag} #{path}>\n.*?()<\/#{tag}>/m, 1] = content + "\n"
      end
    end
def section ( tag , path , content = nil ) unless @fragment . include? "<#{tag} #{path}>" @fragment += "\n<#{tag} #{path}>\n</#{tag}>\n" end if content path = Regexp . escape ( path ) content . strip! . gsub! / ^ #{ content [ / ^ \s + / ] } / , '  ' @fragment [ / \n < #{ tag } #{ path } > \n .*?()< \/ #{ tag } > /m , 1 ] = content + "\n" end end
common logic to add/update an Apache http config section
common logic to add / update an Apache http config section
tag
<not_specific>
path
<not_specific>
content
<not_specific>