Class CodeRay::Encoders::HTML::Output::Template
In: lib/coderay/encoders/html/output.rb
Parent: String

Methods

apply   wrap!  

Classes and Modules

Module CodeRay::Encoders::HTML::Output::Template::Simple

Public Class methods

[Source]

     # File lib/coderay/encoders/html/output.rb, line 123
123:         def self.wrap! str, template, target
124:           target = Regexp.new(Regexp.escape("<%#{target}%>"))
125:           if template =~ target
126:             str[0,0] = $`
127:             str << $'
128:           else
129:             raise "Template target <%%%p%%> not found" % target
130:           end
131:         end

Public Instance methods

[Source]

     # File lib/coderay/encoders/html/output.rb, line 133
133:         def apply target, replacement
134:           target = Regexp.new(Regexp.escape("<%#{target}%>"))
135:           if self =~ target
136:             Template.new($` + replacement + $')
137:           else
138:             raise "Template target <%%%p%%> not found" % target
139:           end
140:         end

[Validate]