Sha256: 0360cae1169d4782bc9d25a47498ef2ab709636c04cd791206e6eef522768a27

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

module AsProject
  class FlashLog
    attr_accessor :version

    def initialize
      @path_finder = PathFinder.new
      verify_config_file
    end
    
    def get_file
      return @path_finder.flash_player_log
    end

    private
    def verify_config_file
      config = @path_finder.flash_player_config
      if(!File.exists?(config))
        content = @path_finder.flash_player_config_content
        write_config(config, content)
      end
    end
    
    private
    def write_config(location, content)
      puts <<EOF

Correctly configured mm.cfg file not found at: #{location}

This file is required in order to capture trace output.

Would you like this file created automatically? [Yn]

EOF
      if($stdin.gets.chomp.downcase.index('y'))
        File.open(location, 'w') do |f|
          f.write(content)
        end
        puts ">> Created: " + File.expand_path(location)
      else
        raise BuildError.new("Unable to create mm.cfg file at: #{location}")
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
asproject-0.1.40 lib/tasks/flash_log.rb
asproject-0.1.41 lib/tasks/flash_log.rb
asproject-0.1.42 lib/tasks/flash_log.rb
asproject-0.1.43 lib/tasks/flash_log.rb
asproject-0.1.44 lib/tasks/flash_log.rb
asproject-0.1.38 lib/tasks/flash_log.rb
asproject-0.1.68 lib/tasks/flash_log.rb
asproject-0.1.60 lib/tasks/flash_log.rb
asproject-0.1.71 lib/tasks/flash_log.rb
asproject-0.1.69 lib/tasks/flash_log.rb
asproject-0.1.74 lib/tasks/flash_log.rb
asproject-0.1.75 lib/tasks/flash_log.rb
asproject-0.1.80 lib/tasks/flash_log.rb
asproject-0.1.84 lib/tasks/flash_log.rb
asproject-0.1.89 lib/tasks/flash_log.rb
asproject-0.1.92 lib/tasks/flash_log.rb