Sha256: 20453f1e484fdfaf9159a8c1d36217dee4753cf684c2bed2378883137f240466
Contents?: true
Size: 815 Bytes
Versions: 24
Compression:
Stored size: 815 Bytes
Contents
def SugarCube.log(message=nil) @log ||= [] if message.nil? return @log end if suppress? log << message elsif log? SugarCube.stderr(message) end self end def SugarCube.flush_log(notification=nil) return unless @log && ! @log.empty? output = "SugarCube recorded the following warnings:" @log.uniq.each do |message| output << "\n" output << message end SugarCube.stderr(output) @log = nil end def SugarCube.log?(value=nil) if value.nil? if @logging.nil? @logging = (RUBYMOTION_ENV == 'development') end @logging else @logging = value unless @logging @log = nil end end end def SugarCube.suppress?(value=nil) if value.nil? @suppress else @suppress = value unless @suppress @log = nil end end end
Version data entries
24 entries across 24 versions & 1 rubygems