Class: Gem::StreamUI::ThreadedDownloadReporter
- Inherits:
 - 
      Object
      
        
- Object
 - Gem::StreamUI::ThreadedDownloadReporter
 
 
- Defined in:
 - lib/rubygems/user_interaction.rb
 
Overview
A progress reporter that behaves nicely with threaded downloading.
Constant Summary collapse
- MUTEX =
 Thread::Mutex.new
Instance Attribute Summary collapse
- 
  
    
      #file_name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The current file name being displayed.
 
Instance Method Summary collapse
- 
  
    
      #done  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Indicates the download is complete.
 - 
  
    
      #fetch(file_name, *args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Tells the download reporter that the
file_nameis being fetched. - 
  
    
      #initialize(out_stream, *args)  ⇒ ThreadedDownloadReporter 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Creates a new threaded download reporter that will display on
out_stream. - 
  
    
      #update(bytes)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Updates the threaded download reporter for the given number of
bytes. 
Constructor Details
#initialize(out_stream, *args) ⇒ ThreadedDownloadReporter
Creates a new threaded download reporter that will display on out_stream.  The other arguments are ignored.
      559 560 561 562  | 
    
      # File 'lib/rubygems/user_interaction.rb', line 559 def initialize(out_stream, *args) @file_name = nil @out = out_stream end  | 
  
Instance Attribute Details
#file_name ⇒ Object (readonly)
The current file name being displayed
      553 554 555  | 
    
      # File 'lib/rubygems/user_interaction.rb', line 553 def file_name @file_name end  | 
  
Instance Method Details
#done ⇒ Object
Indicates the download is complete.
      585 586 587  | 
    
      # File 'lib/rubygems/user_interaction.rb', line 585 def done # Do nothing. end  | 
  
#fetch(file_name, *args) ⇒ Object
Tells the download reporter that the file_name is being fetched. The other arguments are ignored.
      568 569 570 571 572 573  | 
    
      # File 'lib/rubygems/user_interaction.rb', line 568 def fetch(file_name, *args) if @file_name.nil? @file_name = file_name locked_puts "Fetching #{@file_name}" end end  | 
  
#update(bytes) ⇒ Object
Updates the threaded download reporter for the given number of bytes.
      578 579 580  | 
    
      # File 'lib/rubygems/user_interaction.rb', line 578 def update(bytes) # Do nothing. end  |