Sha256: 53acbb6ac6d9b51c01b9258c52f1b7e74a407473a1c53edf17eeaac843c382c6
Contents?: true
Size: 1.18 KB
Versions: 6
Compression:
Stored size: 1.18 KB
Contents
require 'rake' 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
6 entries across 6 versions & 1 rubygems