Class: Albacore::Application
- Inherits:
-
Object
- Object
- Albacore::Application
- Defined in:
- lib/albacore/application.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
the logger instance for this application.
-
#output ⇒ Object
readonly
the output IO for this application, defaults to STDOUT.
-
#output_err ⇒ Object
readonly
the standard IO error output.
Instance Method Summary collapse
- #define_task(*args, &block) ⇒ Object
-
#err(*args) ⇒ Object
write a line to stderr.
-
#initialize(log = STDOUT, output = STDOUT, output_err = STDERR) ⇒ Application
constructor
initialize a new albacore application with a given log IO object.
-
#puts(*args) ⇒ Object
wite a line to stdout.
Constructor Details
#initialize(log = STDOUT, output = STDOUT, output_err = STDERR) ⇒ Application
initialize a new albacore application with a given log IO object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/albacore/application.rb', line 18 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 |
Instance Attribute Details
#logger ⇒ Object (readonly)
the logger instance for this application
8 9 10 |
# File 'lib/albacore/application.rb', line 8 def logger @logger end |
#output ⇒ Object (readonly)
the output IO for this application, defaults to STDOUT
12 13 14 |
# File 'lib/albacore/application.rb', line 12 def output @output end |
#output_err ⇒ Object (readonly)
the standard IO error output
15 16 17 |
# File 'lib/albacore/application.rb', line 15 def output_err @output_err end |
Instance Method Details
#define_task(*args, &block) ⇒ Object
31 32 33 |
# File 'lib/albacore/application.rb', line 31 def define_task *args, &block Rake::Task.define_task *args, &block end |