module GitStatistics
  class Pipe
    include Enumerable

    def initialize(command)
      @command  = command
    end

    def command
      @command.dup.gsub(/\A\|/i, '')
    end

    def each(&block)
      lines.each(&block)
    end

    def empty?
      lines.empty?
    end

    def lines
      io.map(&:clean_for_authors)
    end

    def io
      open("|#{command}")
    end
  end
end

module GitStatistics
  class Pipe
    include Enumerable

    attr_reader :command
    def initialize(command)
      command.gsub!(/^\|/i, '')
      @command  = command
    end

    def each(&block)
      lines.each(&block)
    end

    def empty?
      lines.empty?
    end

    def lines
      io.map(&:clean_for_authors)
    end

    def io
      open("|#{command}")
    end
  end
end

--- 
+++ 
@@ -2,10 +2,12 @@
   class Pipe
     include Enumerable
 
-    attr_reader :command
     def initialize(command)
-      command.gsub!(/^\|/i, '')
       @command  = command
+    end
+
+    def command
+      @command.dup.gsub(/\A\|/i, '')
     end
 
     def each(&block)
Remove side effect on Pipe initialization
