<commit_before>#!/usr/bin/env ruby
# encoding: utf-8

require ENV['TM_SUPPORT_PATH'] + '/lib/escape'
require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes'
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/process'

require File.expand_path(File.dirname(__FILE__)) + '/../lib/add_lib'

require 'fm/flex_mate'
require 'fm/sdk'
require 'fm/compiler'
require 'fm/settings'
require 'as3/source_tools'

#Check for custom build files and execute them where they exist.
custom = "#{ENV['TM_PROJECT_DIRECTORY']}/#{ENV['TM_FLEX_BUILD_FILE']}"
if File.file?(custom)
  if File.executable?(custom)
    TextMate::Process.run(custom) do |str|
      STDOUT << str
    end
  else
    puts "WARNING: #{custom} not executable."  
  end
  TextMate.exit_show_html
end
  
if ENV['TM_PROJECT_DIRECTORY'] && ENV['TM_FLEX_USE_FCSH']
  
  #Requires are needed by FlexMate.required_settings + check_valid_paths
  require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'
  require ENV['TM_SUPPORT_PATH'] + '/lib/tm/htmloutput'

  c = FlexMate::FcshCompiler.new
  c.build
  
  TextMate.exit_discard
  
else
  
  STDOUT.sync = true

  c = FlexMate::Compiler.new
  c.build<commit_msg>• The env var TM_FLEX_USE_FCSH should specifically be set to 'true' to compile using fcsh.<commit_after>#!/usr/bin/env ruby
# encoding: utf-8

require ENV['TM_SUPPORT_PATH'] + '/lib/escape'
require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes'
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
require ENV['TM_SUPPORT_PATH'] + '/lib/tm/process'

require File.expand_path(File.dirname(__FILE__)) + '/../lib/add_lib'

require 'fm/flex_mate'
require 'fm/sdk'
require 'fm/compiler'
require 'fm/settings'
require 'as3/source_tools'

#Check for custom build files and execute them where they exist.
custom = "#{ENV['TM_PROJECT_DIRECTORY']}/#{ENV['TM_FLEX_BUILD_FILE']}"
if File.file?(custom)
  if File.executable?(custom)
    TextMate::Process.run(custom) do |str|
      STDOUT << str
    end
  else
    puts "WARNING: #{custom} not executable."  
  end
  TextMate.exit_show_html
end
  
if ENV['TM_PROJECT_DIRECTORY'] && (ENV['TM_FLEX_USE_FCSH'] == 'true')
  
  #Requires are needed by FlexMate.required_settings + check_valid_paths
  require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'
  require ENV['TM_SUPPORT_PATH'] + '/lib/tm/htmloutput'

  c = FlexMate::FcshCompiler.new
  c.build
  
  TextMate.exit_discard
  
else
  
  STDOUT.sync = true

  c = FlexMate::Compiler.new
  c.build
{'fraction_non_alphanumeric': 0.13978057700121901, 'fraction_numerical': 0.0016253555465258025, 'mean_word_length': 4.595454545454546, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6677011', 'n_tokens_mistral': 929, 'n_tokens_neox': 911, 'n_words': 186}