<commit_before>module StackMaster::TemplateCompilers
  class Cfndsl
    def self.require_dependencies
      require 'cfndsl'
    end

    def self.compile(config, template_file_path, cfndsl_external_parameters)
      params = []
      if cfndsl_external_parameters.is_a?(Array)
        cfndsl_external_parameters.each do |cfndsl_param|
          params.push([:yaml, File.join(config.base_dir, 'external_parameters',
                 cfndsl_param)])      
          end
      else
      params.push([:yaml, File.join(config.base_dir, 'external_parameters', 
                  cfndsl_external_parameters)]) if cfndsl_external_parameters.length > 0
      ::CfnDsl.eval_file_with_extras(template_file_path, params).to_json
      end
    end

    StackMaster::TemplateCompiler.register(:cfndsl, self)
  end
end<commit_msg>fix for cfndsl when a list of files<commit_after>module StackMaster::TemplateCompilers
  class Cfndsl
    def self.require_dependencies
      require 'cfndsl'
    end

    def self.compile(config, template_file_path, cfndsl_external_parameters)
      params = []
      if cfndsl_external_parameters.is_a?(Array)
        cfndsl_external_parameters.each do |cfndsl_param|
          params.push([:yaml, File.join(config.base_dir, 'external_parameters',
                 cfndsl_param)])      
          end
      else
        params.push([:yaml, File.join(config.base_dir, 'external_parameters',
                  cfndsl_external_parameters)]) if cfndsl_external_parameters.length > 0
      end
      ::CfnDsl.eval_file_with_extras(template_file_path, params).to_json
    end

    StackMaster::TemplateCompiler.register(:cfndsl, self)
  end
end
{'fraction_non_alphanumeric': 0.08328304164152082, 'fraction_numerical': 0.0012070006035003018, 'mean_word_length': 3.1763224181360203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3511555', 'n_tokens_mistral': 515, 'n_tokens_neox': 524, 'n_words': 86}