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 132
132:         def self.wrap! str, template, target
133:           target = Regexp.new(Regexp.escape("<%#{target}%>"))
134:           if template =~ target
135:             str[0,0] = $`
136:             str << $'
137:           else
138:             raise "Template target <%%%p%%> not found" % target
139:           end
140:         end

Public Instance methods

[Source]

     # File lib/coderay/encoders/html/output.rb, line 142
142:         def apply target, replacement
143:           target = Regexp.new(Regexp.escape("<%#{target}%>"))
144:           if self =~ target
145:             Template.new($` + replacement + $')
146:           else
147:             raise "Template target <%%%p%%> not found" % target
148:           end
149:         end

[Validate]