Parent

Syckle::Log

Log

The Log class provides a common and easy to use means for different services to log there activity.

Attributes

file[R]
project[R]

Public Class Methods

new(domain, filename) click to toggle source
# File lib/syckle/log.rb, line 14
def initialize(domain, filename)
  @domain   = domain
  @project  = domain.project
  @file     = filename
  #super(domain, key)
end

Public Instance Methods

<<(str) click to toggle source
Alias for: write
append(str) click to toggle source
# File lib/syckle/log.rb, line 34
def append(str)
  mkdir_p(File.dirname(file)) #unless File.file?(file)
  File.open(file, 'a'){ |f| f << str }
end
clear() click to toggle source
# File lib/syckle/log.rb, line 40
def clear
  File.open(file, 'w'){ |f| f << '' } if File.file?(file)
end
method_missing(s, *a, &b) click to toggle source
# File lib/syckle/log.rb, line 22
def method_missing(s, *a, &b)
  @domain.send(s, *a, &b)
end
outofdate?(*sources) click to toggle source
# File lib/syckle/log.rb, line 45
def outofdate?(*sources)
  FileUtils.outofdate?(file.to_s, sources.flatten)
end
uptodate?(*sources) click to toggle source
# File lib/syckle/log.rb, line 50
def uptodate?(*sources)
  FileUtils.uptodate?(file.to_s, sources.flatten)
end
write(str) click to toggle source

Write to log file.

# File lib/syckle/log.rb, line 27
def write(str)
  mkdir_p(File.dirname(file)) #unless File.file?(file)
  File.open(file, 'w'){ |f| f << str }
end
Also aliased as: <<

[Validate]

Generated with the Darkfish Rdoc Generator 2.