Class: Sprout::FlashPlayerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/sprout/tasks/flashplayer_task.rb

Overview

FlashPlayerConfig Class

Constant Summary collapse

@@file_name =

:nodoc:

'mm.cfg'

Instance Method Summary collapse

Instance Method Details

#content(file) ⇒ Object



392
393
394
395
396
397
398
399
# File 'lib/sprout/tasks/flashplayer_task.rb', line 392

def content(file)
  return <<EOF
ErrorReportingEnable=1
MaxWarnings=0
TraceOutputEnable=1
TraceOutputFileName=#{file}
EOF
end

#create_config_fileObject



401
402
403
404
405
406
407
408
409
# File 'lib/sprout/tasks/flashplayer_task.rb', line 401

def create_config_file
  path = config_path 

  if(file_blank?(path))
    write_config(path, content(path))
  end

  path
end

#log_fileObject



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/sprout/tasks/flashplayer_task.rb', line 374

def log_file
  create_config_file
  path = File.join(FlashPlayerTask.home, 'Logs', 'flashlog.txt')
  if(User.new().is_a?(CygwinUser))
    parts = path.split("/")
    parts.shift()
    part = parts.shift() # shift cygdrive
    if(part != 'cygdrive')
      Log.puts "[WARNING] There may have been a problem writing mm.cfg, please check the path in #{@config} and make sure it's a windows path..."
      return path
    end
    drive = parts.shift()
    parts.unshift(drive.upcase + ":")
    path = parts.join("/")
  end
  return path
end