Class: Limelight::Templates::TemplaterLogger
- Inherits:
-
Object
- Object
- Limelight::Templates::TemplaterLogger
- Defined in:
- lib/limelight/templates/templater_logger.rb
Overview
Templaters uses this class to log activity.
Instance Attribute Summary collapse
-
#output ⇒ Object
An accessor to the output IO.
Instance Method Summary collapse
- #creating_directory(name) ⇒ Object
- #creating_file(name) ⇒ Object
- #file_already_exists(name) ⇒ Object
-
#initialize ⇒ TemplaterLogger
constructor
A new instance of TemplaterLogger.
- #log(message, name) ⇒ Object
Constructor Details
#initialize ⇒ TemplaterLogger
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
#output ⇒ Object
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(, name) spaces = 21 - .length - 1 @output.puts "\t#{}:#{' '*spaces}#{name}" end |