From e780cc72006215220c35d799b0876d91b89998ec Mon Sep 17 00:00:00 2001 From: Luke Barbuto Date: Sat, 23 May 2015 15:21:23 -0700 Subject: [PATCH] Update docs and have #on_update return self --- lib/launchpad/index.rb | 1 + lib/launchpad/patcher.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/launchpad/index.rb b/lib/launchpad/index.rb index d682017..ce4fba4 100644 --- a/lib/launchpad/index.rb +++ b/lib/launchpad/index.rb @@ -6,6 +6,7 @@ module Launchpad # Provides a diff between local and remote file data by maintaining a cache # with pathnames and md5 hex digests. class Index + # @param [Launchpad::Patcher] patcher def initialize(patcher) @patcher = patcher @target_dir = Pathname.new Settings.read :install diff --git a/lib/launchpad/patcher.rb b/lib/launchpad/patcher.rb index c46f316..cb4ec66 100644 --- a/lib/launchpad/patcher.rb +++ b/lib/launchpad/patcher.rb @@ -14,14 +14,14 @@ def in_sync? index.diff.empty? end - # Determines the code to be executed when progress changes for the current - # operation. + # @param [Proc] block sets the callback to be run when progress is updated. + # @return [self] def on_update(&block) @update_callback = block + self end - # @return [Float] - # denotes the completion percentage for the current operation. + # @return [Float] the completion percentage for the current operation. def progress @progress || 0.0 end