Sha256: a61c424d6b1ced2a9ae563d98bb153526cc6da876126a3fb3a0619b8b658b56e

Contents?: true

Size: 700 Bytes

Versions: 12

Compression:

Stored size: 700 Bytes

Contents

module PatternPark
  
  class Log
    @@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

12 entries across 12 versions & 1 rubygems

Version Path
sprout-0.3.35 lib/log.rb
sprout-0.5.10 lib/log.rb
sprout-0.5.13 lib/log.rb
sprout-0.3.36 lib/log.rb
sprout-0.5.0 lib/log.rb
sprout-0.5.11 lib/log.rb
sprout-0.5.19 lib/log.rb
sprout-0.5.25 lib/log.rb
sprout-0.5.15 lib/log.rb
sprout-0.5.29 lib/log.rb
sprout-0.5.23 lib/log.rb
sprout-0.5.9 lib/log.rb