A progress reporter that behaves nicely with threaded downloading.
Constants
No documentation available
Attributes
Read
The current file name being displayed
Class Methods
lib/rubygems/user_interaction.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/rubygems/user_interaction.rb, line 557
def initialize(out_stream, *args)
@file_name = nil
@out = out_stream
end
Creates a new threaded download reporter that will display on out_stream
. The other arguments are ignored.
Instance Methods
#
lib/rubygems/user_interaction.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/rubygems/user_interaction.rb, line 583
def done
# Do nothing.
end
Indicates the download is complete.
lib/rubygems/user_interaction.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/rubygems/user_interaction.rb, line 566
def fetch(file_name, *args)
if @file_name.nil?
@file_name = file_name
locked_puts "Fetching #{@file_name}"
end
end
Tells the download reporter that the file_name
is being fetched. The other arguments are ignored.
lib/rubygems/user_interaction.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/rubygems/user_interaction.rb, line 589
def locked_puts(message)
MUTEX.synchronize do
@out.puts message
end
end
No documentation available
lib/rubygems/user_interaction.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/rubygems/user_interaction.rb, line 576
def update(bytes)
# Do nothing.
end
Updates the threaded download reporter for the given number of bytes
.