lib/asproject.rb in asproject-0.1.44 vs lib/asproject.rb in asproject-0.1.60

- old
+ new

@@ -37,10 +37,11 @@ require 'tasks/swfmill_input_resolver' require 'tasks/swfmill_input' require 'tasks/swfmill' module AsProject + class AsProject < AsProjectBase @@ASPROJECT_FILE_NAME = 'AsProject' @@TEMPLATE_TYPE = 'asproject' @@DEFAULT_TEMPLATES = ['as2', 'config', 'asunit25', 'fdt'] @@ -262,8 +263,44 @@ @context.project_name end def project_path return @context.project_path + end + end + + class Logger + @@output = '' + @@debug = false + + def Logger.debug=(debug) + @@debug = debug + end + + def Logger.debug + return @@debug + end + + def Logger.puts(line) + if(!Logger.debug) + $stdout.puts line + else + @@output << "#{line}\n" + end + end + + def Logger.printf(msg) + if(!Logger.debug) + $stdout.puts msg + else + @@output << msg + end + end + + def Logger.flush + if(!Logger.debug) + $stdout.puts @@output + end + @@output = '' end end end