<commit_before>require 'opal'

module Jekyll
  module Generators
    class Opal < Generator

      def generate(site)
        write_file output_location(site)
        keep_the_file(site)
        save_lib_file_location_to_config(site)
      end

      def write_file(location)
        ensure_directory(location)
        File.open(location, 'wb') do |f|
          f.puts(opal_stdlib)
        end
        location
      end

      def opal_stdlib
        ::Opal::Builder.build('opal')
      end

      def ensure_directory(location)
        dir = File.dirname(location)
        unless File.directory?(dir)
          require 'fileutils'
          FileUtils.mkdir_p(dir)<commit_msg>Only output library file if it's not already there<commit_after>require 'opal'

module Jekyll
  module Generators
    class Opal < Generator

      def generate(site)
        write_file(output_location(site)) unless File.file?(output_location(site))
        keep_the_file(site)
        save_lib_file_location_to_config(site)
      end

      def write_file(location)
        ensure_directory(location)
        File.open(location, 'wb') do |f|
          f.puts(opal_stdlib)
        end
        location
      end

      def opal_stdlib
        ::Opal::Builder.build('opal')
      end

      def ensure_directory(location)
        dir = File.dirname(location)
        unless File.directory?(dir)
          require 'fileutils'
          FileUtils.mkdir_p(dir)
{'fraction_non_alphanumeric': 0.08025122121423586, 'fraction_numerical': 0.0, 'mean_word_length': 2.3271461716937356, 'pattern_counts': {'":': 0, '<': 5, '<?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': '640407', 'n_tokens_mistral': 439, 'n_tokens_neox': 419, 'n_words': 88}