Class: Limelight::Templates::TemplaterLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/limelight/templates/templater_logger.rb

Overview

Templaters uses this class to log activity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemplaterLogger

Returns a new instance of TemplaterLogger.



12
13
14
# File 'lib/limelight/templates/templater_logger.rb', line 12

def initialize
  @output = STDOUT
end

Instance Attribute Details

#outputObject

An accessor to the output IO. Defaults to STDOUT



10
11
12
# File 'lib/limelight/templates/templater_logger.rb', line 10

def output
  @output
end

Instance Method Details

#creating_directory(name) ⇒ Object



16
17
18
# File 'lib/limelight/templates/templater_logger.rb', line 16

def creating_directory(name)
  @output.puts "\tcreating directory:  #{name}"
end

#creating_file(name) ⇒ Object



20
21
22
# File 'lib/limelight/templates/templater_logger.rb', line 20

def creating_file(name)
  @output.puts "\tcreating file:       #{name}"
end

#file_already_exists(name) ⇒ Object



24
25
26
# File 'lib/limelight/templates/templater_logger.rb', line 24

def file_already_exists(name)
  @output.puts "\tfile already exists: #{name}"
end

#log(message, name) ⇒ Object



28
29
30
31
# File 'lib/limelight/templates/templater_logger.rb', line 28

def log(message, name)
  spaces = 21 - message.length - 1
  @output.puts "\t#{message}:#{' '*spaces}#{name}"
end