Skip to content

Commit

Permalink
Update docs and have #on_update return self
Browse files Browse the repository at this point in the history
  • Loading branch information
lexun committed May 23, 2015
1 parent d5a1877 commit e780cc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/launchpad/index.rb
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/launchpad/patcher.rb
Expand Up @@ -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
Expand Down

0 comments on commit e780cc7

Please sign in to comment.