Class: Gonzui::AbstractUpdater
- Inherits:
-
Object
- Object
- Gonzui::AbstractUpdater
- Includes:
- Util
- Defined in:
- lib/gonzui/updater.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(config, options = {}) ⇒ AbstractUpdater
constructor
A new instance of AbstractUpdater.
- #summary ⇒ Object
Methods included from Util
assert, assert_equal, assert_equal_all, assert_non_nil, assert_not_reached, benchmark, command_exist?, commify, eprintf, format_bytes, program_name, protect_from_signals, require_command, set_verbosity, shell_escape, unix?, vprintf, windows?, wprintf
Constructor Details
#initialize(config, options = {}) ⇒ AbstractUpdater
Returns a new instance of AbstractUpdater.
19 20 21 22 23 24 25 26 |
# File 'lib/gonzui/updater.rb', line 19 def initialize(config, = {}) @start_time = Time.now @dbm = DBM.open(config) @config = config @ncontents = 0 @npackages = 0 @show_progress = [:show_progress] end |
Instance Method Details
#finish ⇒ Object
91 92 93 |
# File 'lib/gonzui/updater.rb', line 91 def finish @dbm.close end |
#summary ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/gonzui/updater.rb', line 83 def summary elapsed = Time.now - @start_time format = "%d contents of %d packages %s in %.2f sec. (%.2f contents / sec.)\n" summary = sprintf(format, @ncontents, @npackages, task_name, elapsed, @ncontents / elapsed) return summary end |