class Drupid::Updater::Log
Attributes
actions[R]
errors[R]
notices[R]
warnings[R]
Public Class Methods
new()
click to toggle source
Creates a new log object.
# File lib/drupid/updater.rb 490 def initialize 491 @actions = Array.new 492 @errors = Array.new 493 @warnings = Array.new 494 @notices = Array.new 495 end
Public Instance Methods
action(a)
click to toggle source
Adds an action to the log.
# File lib/drupid/updater.rb 498 def action(a) 499 @actions << a 500 puts a.msg 501 end
actions?()
click to toggle source
# File lib/drupid/updater.rb 503 def actions? 504 @actions.size > 0 505 end
apply_pending_actions()
click to toggle source
# File lib/drupid/updater.rb 511 def apply_pending_actions 512 @actions.find_all { |a| a.pending? }.each do |pa| 513 pa.fire! 514 puts pa.msg 515 end 516 end
clear()
click to toggle source
Clears the whole log.
# File lib/drupid/updater.rb 551 def clear 552 @errors.clear 553 @warnings.clear 554 @notices.clear 555 end
error(msg)
click to toggle source
Adds an error message to the log.
# File lib/drupid/updater.rb 519 def error(msg) 520 @errors << msg 521 ofail @errors.last 522 end
errors?()
click to toggle source
Returns true if this log contains error messages; returns false otherwise.
# File lib/drupid/updater.rb 526 def errors? 527 @errors.size > 0 528 end
merge(other)
click to toggle source
Appends the content of another log to this one.
# File lib/drupid/updater.rb 558 def merge(other) 559 @actions += other.actions 560 @errors += other.errors 561 @warnings += other.warnings 562 @notices += other.notices 563 end
notice(msg)
click to toggle source
Adds a notice to the log.
# File lib/drupid/updater.rb 541 def notice(msg) 542 @notices << msg 543 blah @notices.last 544 end
notices?()
click to toggle source
# File lib/drupid/updater.rb 546 def notices? 547 @notices.size > 0 548 end
pending_actions?()
click to toggle source
# File lib/drupid/updater.rb 507 def pending_actions? 508 @actions.find_all { |a| a.pending? }.size > 0 509 end
warning(msg)
click to toggle source
Adds a warning to the log.
# File lib/drupid/updater.rb 531 def warning(msg) 532 @warnings << msg 533 owarn @warnings.last 534 end
warnings?()
click to toggle source
# File lib/drupid/updater.rb 536 def warnings? 537 @warnings.size > 0 538 end