Sha256: 33400dee8033dcd8d421a668894642e67f91a34e0048dd5d9ed31737d5e45f66
Contents?: true
Size: 1.2 KB
Versions: 30
Compression:
Stored size: 1.2 KB
Contents
require 'rake' require 'time' module Albacore class Application # the logger instance for this application attr_reader :logger # the output IO for this application, defaults to # STDOUT attr_reader :output # the standard IO error output attr_reader :output_err # initialize a new albacore application with a given log IO object def initialize log = STDOUT, output = STDOUT, output_err = STDERR raise ArgumentError, "log must not be nil" unless log raise ArgumentError, "output must not be nil" unless output raise ArgumentError, "out_err must not be nil" unless output_err @logger = Logger.new log @logger.level = Logger::INFO @logger.formatter = proc do |severity, datetime, progname, msg| "#{severity[0]} #{datetime.to_datetime.iso8601(6)}: #{msg}\n" end @output = output @output_err = output_err end def define_task *args, &block Rake::Task.define_task *args, &block end # wite a line to stdout def puts *args @output.puts *args end # write a line to stderr def err *args @output_err.puts *args end end end
Version data entries
30 entries across 30 versions & 1 rubygems