Parent

Methods

Newgem::QuickTemplate

Attributes

args[R]
text[R]
file[R]

Public Class Methods

new(file) click to toggle source
   # File lib/newgem/quick_template.rb, line 6
6:     def initialize(file)
7:       @file = file
8:       @text = File.read(file)
9:     end

Public Instance Methods

exec(b) click to toggle source
    # File lib/newgem/quick_template.rb, line 10
10:     def exec(b)
11:       begin
12:         # b = binding
13:         template = ERB.new(@text, 0, "%<>")
14:         result = template.result(b)
15:         # Chomp the trailing newline
16:         result.gsub(/\n$/,'')
17:       rescue NameError
18:         puts "Error found for #{file}"
19:         raise $!
20:       end
21:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.