Sha256: 681f32747e324f9f57cfd2e74c64107f9b9c94fc4588a53764462677a4899b94

Contents?: true

Size: 714 Bytes

Versions: 25

Compression:

Stored size: 714 Bytes

Contents

module Sprout #:nodoc:
  
  class Log #:nodoc:
    @@debug = false
    @@output = ''
    @@printout = ''
    
    def Log.debug=(debug)
      @@debug = debug
    end
    
    def Log.debug
      return @@debug
    end
    
    def Log.puts(msg)
      @@output << msg + "\n"
      Log.flush
    end
    
    def Log.print(msg)
      @@printout << msg
      Log.flush_print
    end
    
    def Log.printf(msg)
      @@printout << msg
      Log.flush_print
    end
    
    def Log.flush_print
      if(!Log.debug)
        $stdout.print @@printout
        @@printout = ''
      end
    end
    
    def Log.flush
      if(!Log.debug)
        $stdout.puts @@output
        @@output = ''
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sprout-1.0.32.pre lib/sprout/log.rb
sprout-1.0.31.pre lib/sprout/log.rb
sprout-1.0.29.pre lib/sprout/log.rb
sprout-1.0.26.pre lib/sprout/log.rb
sprout-1.0.25.pre lib/sprout/log.rb
sprout-1.0.24.pre lib/sprout/log.rb
sprout-1.0.23.pre lib/sprout/log.rb
sprout-1.0.22.pre lib/sprout/log.rb
sprout-1.0.20.pre lib/sprout/log.rb
sprout-1.0.19.pre lib/sprout/log.rb
sprout-1.0.18.pre lib/sprout/log.rb
sprout-1.0.17.pre lib/sprout/log.rb
sprout-1.0.16.pre lib/sprout/log.rb
sprout-1.0.15.pre lib/sprout/log.rb
sprout-1.0.14.pre lib/sprout/log.rb
sprout-1.0.13.pre lib/sprout/log.rb
sprout-1.0.11.pre lib/sprout/log.rb
sprout-1.0.9.pre lib/sprout/log.rb
sprout-1.0.8.pre lib/sprout/log.rb
sprout-1.0.5.pre lib/sprout/log.rb