<commit_before>
module Sprout #:nodoc:
  
  class FDBTaskError < StandardError #:nodoc:
  end

  # The FDBTask provides a procedural rake front end to the FDB command line tool
  # 
  # Here is a decent tutorial on using FDB with SWF or HTML content:
  # http://installingcats.wordpress.com/tag/adobe-flex/
  #
  # You can send the fdb task some debug commands directly or simply
  # execute the rake task and interact with the debugger manually.
  #
  # The FDBTask requires that you have a debug Flash Player installed
  # on your system as the default execution application for SWF files.
  #
  # Following is an example of setting up a breakpoint in
  # SomeFile at line 23
  #   fdb :debug do |t|
  #     t.file = 'bin/SomeProject-debug.swf'
  #     t.run
  #     t.break = 'SomeFile:23'
  #     t.continue
  #   end
  #
  # You can also point the FDBTask at HTML pages. These pages will be 
  # launched in your default browser. You will need to manually install
  # a debug Flash Player in that particular browser.
  # 
  # To use a browser instead of the desktop Flash Player, simply point the
  # file argument at an HTML document or remote URL. The SWF file loaded
  # must be compiled using the -debug flag, and executed in a debug Flash Player
  # in order to connect to properly connect to the debugger.
  #   fdb :debug do |t|
  #     t.file = 'bin/SomeProject-debug.html'
  #     t.run
  #     t.continue
  #   end
  #
  class FDBTask < ToolTask
    TEST_RESULT_PRELUDE = '<XMLResultPrinter>'
    TEST_RESULT_CLOSING = '</XMLResultPrinter>'
    TEST_RESULT_FILE    = 'AsUnitResults.xml'<commit_msg>Added FDB docs for Continous Integration support<commit_after>
module Sprout #:nodoc:
  
  class FDBTaskError < StandardError #:nodoc:
  end

  # The FDBTask provides a procedural rake front end to the FDB command line tool
  # 
  # Here is a decent tutorial on using FDB with SWF or HTML content:
  # http://installingcats.wordpress.com/tag/adobe-flex/
  #
  # You can send the fdb task some debug commands directly or simply
  # execute the rake task and interact with the debugger manually.
  #
  # The FDBTask requires that you have a debug Flash Player installed
  # on your system as the default execution application for SWF files.
  #
  # Following is an example of setting up a breakpoint in
  # SomeFile at line 23
  #   fdb :debug do |t|
  #     t.file = 'bin/SomeProject-debug.swf'
  #     t.run
  #     t.break = 'SomeFile:23'
  #     t.continue
  #   end
  #
  # You can also point the FDBTask at HTML pages. These pages will be 
  # launched in your default browser. You will need to manually install
  # a debug Flash Player in that particular browser.
  # 
  # To use a browser instead of the desktop Flash Player, simply point the
  # file argument at an HTML document or remote URL. The SWF file loaded
  # must be compiled using the -debug flag, and executed in a debug Flash Player
  # in order to connect to properly connect to the debugger.
  #   fdb :debug do |t|
  #     t.file = 'bin/SomeProject-debug.html'
  #     t.run
  #     t.continue
  #   end
  #
  # .h3 Continuous Integration
  #
  # The FDBTask is also the only effective way to execute SWF content
  # in front of a CI (continuous integration) tool like Cruise Control.
  # The biggest problem facing SWF execution for CI is uncaught
  # runtime exceptions. The debug Flash Player throws uncaught exceptions
  # up to the operating system GUI layer where a user must manually dismiss
  # a dialog. In addition to blocking the CI process indefinitely, these
  # messages are also difficult to capture and log. 
  #
  # Using Sprouts and the FDBTask, we can capture these messages along
  # with additonal information (e.g. local variables and a complete stack trace)
  # about the state of the SWF file, and then cleanly exit the Flash Player
  # and log this information.
  #
  # The FDBTask has also been configured to work with the ASUnit XMLPrinter
  # so that an XML artifact is created and written to disk that includes
  # the results of running your test suites.
  # 
  # To use FDB with a CI tool do the following:
  #
  # 1) Create a new base runner class (we usually name this XMLRunner.as)
  # and make it look like the following:
  #
  #   package {
  #     import asunit.textui.TestRunner;
  #     import asunit.textui.XMLResultPrinter;
  # 
  #     public class XMLRunner extends TestRunner {
  # 
  #       public function XMLRunner() {
  #         setPrinter(new XMLResultPrinter());
  #         start(AllTests, null, TestRunner.SHOW_TRACE);
  #       }
  #     }
  #   }
  #
  # 2) Create a new MXMLCTask to compile the newly created runner.
  # NOTE: Be sure you set +debug+ to true, otherwise the SWF will
  # not connect to the debugger properly.
  #
  #   library :asunit3
  #
  #   desc 'Compile the CI SWF'
  #   mxmlc 'bin/XMLRunner.swf' => :asunit3 do |t|
  #     t.input = 'src/XMLRunner.as'
  #     t.debug = true
  #     t.source_path << 'test'
  #     # Add additional configuration here.
  #   end
  #
  # 3) Create a new FDBTask and set +kill_on_fault+ to true.
  #
  #   desc 'Execute the test harness for CI'
  #   fdb :cruise do |t|
  #     t.kill_on_fault = true
  #     t.file = 'bin/XMLRunner.swf'
  #     t.run
  #     t.continue
  #   end
  #

  class FDBTask < ToolTask
    TEST_RESULT_PRELUDE = '<XMLResultPrinter>'
    TEST_RESULT_CLOSING = '</XMLResultPrinter>'
    TEST_RESULT_FILE    = 'AsUnitResults.xml'
{'fraction_non_alphanumeric': 0.0695285268758026, 'fraction_numerical': 0.002568336085121996, 'mean_word_length': 2.8125874125874124, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4427345', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1658, 'n_words': 693}