<commit_before>require "jasmine-jstd-conf/version"
require 'rubygems'
require 'jasmine'
require 'mustache'

module Jasmine
  module JSTD
    module Conf
      # This looks like YAML, but it's hard to be sure...
      TEMPLATE = <<EOF
server: {{server}}

load:
  {{#paths}}
  - {{.}}
  {{/paths}}
EOF
    
      def self.map(doc)
        paths = [
          '../jasmine/lib/jasmine.js',
          'spec/javascripts/support/JasmineAdapter.js',
        ]
    
        paths.concat(doc.js_files)
    
        paths.map! do |path|
          path.
            gsub(%r{^/}, '').
            gsub('__spec__', 'spec/javascripts')
        end
    
        {
          server: 'http://localhost:9876',
          paths: paths,
        }
      end
    
      def self.render
        Mustache.render(TEMPLATE, map(Jasmine::Config.new))
      end<commit_msg>Fix for Ruby 1.8 (thanks @oldfartdeveloper)<commit_after>require "jasmine-jstd-conf/version"
require 'rubygems'
require 'jasmine'
require 'mustache'

module Jasmine
  module JSTD
    module Conf
      # This looks like YAML, but it's hard to be sure...
      TEMPLATE = <<EOF
server: {{server}}

load:
  {{#paths}}
  - {{.}}
  {{/paths}}
EOF
    
      def self.map(doc)
        paths = [
          '../jasmine/lib/jasmine.js',
          'spec/javascripts/support/JasmineAdapter.js',
        ]
    
        paths.concat(doc.js_files)
    
        paths.map! do |path|
          path.
            gsub(%r{^/}, '').
            gsub('__spec__', 'spec/javascripts')
        end
    
        {
          :server => 'http://localhost:9876',
          :paths => paths,
        }
      end
    
      def self.render
        Mustache.render(TEMPLATE, map(Jasmine::Config.new))
      end
{'fraction_non_alphanumeric': 0.140534262485482, 'fraction_numerical': 0.005807200929152149, 'mean_word_length': 1.739268680445151, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3273869', 'n_tokens_mistral': 597, 'n_tokens_neox': 566, 'n_words': 116}