Author: assaf
Date: Wed Mar 26 17:54:45 2008
New Revision: 641668

URL: http://svn.apache.org/viewvc?rev=641668&view=rev
Log:
Wider progressbar

Modified:
    incubator/buildr/trunk/NOTICE
    incubator/buildr/trunk/lib/core/progressbar.rb
    incubator/buildr/trunk/lib/core/transports.rb

Modified: incubator/buildr/trunk/NOTICE
URL: 
http://svn.apache.org/viewvc/incubator/buildr/trunk/NOTICE?rev=641668&r1=641667&r2=641668&view=diff
==============================================================================
--- incubator/buildr/trunk/NOTICE (original)
+++ incubator/buildr/trunk/NOTICE Wed Mar 26 17:54:45 2008
@@ -15,7 +15,7 @@
 http://www.intalio.com
 
 
-* progressbar - http://0xcc.net/ruby-progressbar/
+progressbar - http://0xcc.net/ruby-progressbar/
 Licensed under the Ruby License
 Copyright (C) 2001-2005 Satoru Takabayashi <[EMAIL PROTECTED]>
 

Modified: incubator/buildr/trunk/lib/core/progressbar.rb
URL: 
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/progressbar.rb?rev=641668&r1=641667&r2=641668&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/progressbar.rb (original)
+++ incubator/buildr/trunk/lib/core/progressbar.rb Wed Mar 26 17:54:45 2008
@@ -120,6 +120,10 @@
   end
 
   def get_width
+    @screen_width ||= HighLine::SystemExtensions.terminal_size.first rescue 80
+    return @screen_width
+    # Original code below, above code adds dependency on HighLine.
+=begin
     # FIXME: I don't know how portable it is.
     default_width = 80
     begin
@@ -134,6 +138,7 @@
     rescue Exception
       default_width
     end
+=end
   end
 
   def show

Modified: incubator/buildr/trunk/lib/core/transports.rb
URL: 
http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/transports.rb?rev=641668&r1=641667&r2=641668&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/transports.rb (original)
+++ incubator/buildr/trunk/lib/core/transports.rb Wed Mar 26 17:54:45 2008
@@ -260,7 +260,7 @@
     # Call << for each block of bytes down/uploaded.
     def with_progress_bar(enable, file_name, size) #:nodoc:
       if enable && $stdout.isatty && size
-        progress_bar = ProgressBar.new(file_name, size)
+        progress_bar = ProgressBar.new(file_name, size, $stdout)
         # Squeeze the filename into 30 characters.
         if file_name.size > 30
           base, ext = file_name.split('.')


Reply via email to