Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Retab

  • Loading branch information...
commit 14f890656fbdac422884c7ecc286df2a6b10a1e3 1 parent 9f9e8d1
authored
40  lib/rake_bubbler/bubble_task.rb
@@ -4,40 +4,40 @@
4 4
 require 'tempfile'
5 5
 
6 6
 module RakeBubbler
7  
-	module BubbleTask
  7
+  module BubbleTask
8 8
 
9 9
     def self.included(klass)
10 10
       klass.class_eval do
11 11
 
12  
-			  def invoke_with_output_capture(*params)
13  
-		      return invoke_without_output_capture(*params) unless RakeBubbler.capture_task?(name)
14  
-		
15  
-		      duration, error = nil
  12
+        def invoke_with_output_capture(*params)
  13
+          return invoke_without_output_capture(*params) unless RakeBubbler.capture_task?(name)
  14
+    
  15
+          duration, error = nil
16 16
           started = Time.now
17  
-		
18  
-		      # capture task output
19  
-		      output = RakeBubbler.capture_output do
20  
-		        time = Benchmark.measure(name) do
  17
+    
  18
+          # capture task output
  19
+          output = RakeBubbler.capture_output do
  20
+            time = Benchmark.measure(name) do
21 21
               begin
22  
-		            # invoke task
23  
-		            invoke_without_output_capture(*params)
  22
+                # invoke task
  23
+                invoke_without_output_capture(*params)
24 24
               rescue Exception => e
25 25
                 error = e
26 26
               end
27  
-		        end
28  
-		
29  
-		        duration = time.real
30  
-		      end
31  
-		
32  
-		      RakeBubbler.executed(name, duration, output, started, error)
  27
+            end
  28
+    
  29
+            duration = time.real
  30
+          end
  31
+    
  32
+          RakeBubbler.executed(name, duration, output, started, error)
33 33
           raise error if error
34  
-			  end  # invoke_with_output_capture
  34
+        end  # invoke_with_output_capture
35 35
 
36 36
         alias_method :invoke_without_output_capture, :invoke
37 37
         alias_method :invoke, :invoke_with_output_capture 
38 38
 
39 39
       end
40 40
     end
41  
-	  
42  
-	end  # BubbleTask 
  41
+    
  42
+  end  # BubbleTask 
43 43
 end # RakeBubbler
48  lib/rake_bubbler/rake_bubbler.rb
@@ -17,31 +17,31 @@ def capture_task?(name)
17 17
     end
18 18
 
19 19
     def capture_output
20  
-	    file = Tempfile.new(Digest::MD5.hexdigest((Time.now.to_i + rand(2**16)).to_s))
21  
-	
22  
-	    read, write = IO.pipe
23  
-	
24  
-	    save_stdout = $stdout.dup
25  
-	    $stdout.reopen(write)
26  
-	
27  
-	    if fork
28  
-	      read.close
29  
-	      yield
30  
-	      write.close
31  
-	      $stdout.reopen(save_stdout)
32  
-	      save_stdout.close
33  
-	      Process.wait
  20
+      file = Tempfile.new(Digest::MD5.hexdigest((Time.now.to_i + rand(2**16)).to_s))
  21
+  
  22
+      read, write = IO.pipe
  23
+  
  24
+      save_stdout = $stdout.dup
  25
+      $stdout.reopen(write)
  26
+  
  27
+      if fork
  28
+        read.close
  29
+        yield
  30
+        write.close
  31
+        $stdout.reopen(save_stdout)
  32
+        save_stdout.close
  33
+        Process.wait
34 34
         file.unlink
35  
-	      file.read
36  
-	    else
37  
-	      write.close
38  
-	      $stdout.close
39  
-	      Shell.new.tee(file.path) < read > save_stdout
40  
-	      read.close
41  
-	      save_stdout.close
42  
-	      exit!
43  
-	    end  # fork
44  
-	  end  # capture_output
  35
+        file.read
  36
+      else
  37
+        write.close
  38
+        $stdout.close
  39
+        Shell.new.tee(file.path) < read > save_stdout
  40
+        read.close
  41
+        save_stdout.close
  42
+        exit!
  43
+      end  # fork
  44
+    end  # capture_output
45 45
 
46 46
   end
47 47
 end

0 notes on commit 14f8906

Please sign in to comment.
Something went wrong with that request. Please try again.