Skip to Content Skip to Search

A progress reporter that behaves nicely with threaded downloading.

Methods
D
F
N
U

Constants

MUTEX = Thread::Mutex.new
 

Attributes

[R] file_name

The current file name being displayed

Class Public methods

new(out_stream, *args)

Creates a new threaded download reporter that will display on out_stream. The other arguments are ignored.

# File ruby/lib/rubygems/user_interaction.rb, line 553
def initialize(out_stream, *args)
  @file_name = nil
  @out = out_stream
end

Instance Public methods

done()

Indicates the download is complete.

# File ruby/lib/rubygems/user_interaction.rb, line 579
def done
  # Do nothing.
end

fetch(file_name, *args)

Tells the download reporter that the file_name is being fetched. The other arguments are ignored.

# File ruby/lib/rubygems/user_interaction.rb, line 562
def fetch(file_name, *args)
  if @file_name.nil?
    @file_name = file_name
    locked_puts "Fetching #{@file_name}"
  end
end

update(bytes)

Updates the threaded download reporter for the given number of bytes.

# File ruby/lib/rubygems/user_interaction.rb, line 572
def update(bytes)
  # Do nothing.
end