Class
PhusionPassenger::ConsoleTextTemplate

In: | lib/phusion_passenger/console_text_template.rb
Parent: | Object

Methods

- []=
- new
- result

Constants

TEMPLATE_DIR | = | "#{File.dirname(__FILE__)}/templates"
DEFAULT_TERMINAL_COLORS | = | "\e[0m\e[37m\e[40m"

Public Class methods
new(input, options = {})

[ show source ]

        # File lib/phusion_passenger/console_text_template.rb, line 30
    30:         def initialize(input, options = {})
    31:                 @buffer = ''
    32:                 if input[:file]
    33:                         data = File.read("#{TEMPLATE_DIR}/#{input[:file]}.txt.erb")
    34:                 else
    35:                         data = input[:text]
    36:                 end
    37:                 @template = ERB.new(substitute_color_tags(data),
    38:                         nil, nil, '@buffer')
    39:                 options.each_pair do |name, value|
    40:                         self[name] = value
    41:                 end
    42:         end

Public Instance methods
[]=(name, value)

[ show source ]

        # File lib/phusion_passenger/console_text_template.rb, line 44
    44:         def []=(name, value)
    45:                 instance_variable_set("@#{name}".to_sym, value)
    46:                 return self
    47:         end

result()

[ show source ]

        # File lib/phusion_passenger/console_text_template.rb, line 49
    49:         def result
    50:                 return @template.result(binding)
    51:         end