<commit_before>module Jekyll

  # Recover from strange exception when starting server without --auto
  class DataFile < StaticFile
    
    def destination(dest)
      File.join(@base, @dir, @name)
    end

    def modified?
      return false
    end

    def write(dest)
      return true
    end
  end

  class DataGenerator < Generator
    safe true
    priority :lowest
    # Config defaults
    DIR = '/'
    POST_LIST_FILENAME = 'data.html'
    

    # Goes through pages and posts and generates sitemap.xml file
    #
    # Returns nothing
    def generate(site)
      dir = File.join(site.dest, DIR)
      filename = POST_LIST_FILENAME

      # Create destination directory if it doesn't exist yet. Otherwise, we cannot write our file there.
      Dir::mkdir(dir) if !File.directory? dir

      # File I/O: create sitemap.xml file and write out pretty-printed XML
     
      # file = File.new(File.join(dir, filename), "w")
      # file.write('hello wwww')
      # file.close

      File.open(File.join(dir, filename), 'w') do |file|
          file.write('my file')
      end 

      # Keep the sitemap.xml file from being cleaned by Jekyll
      site.static_files << Jekyll::DataFile.new(site, dir, '/', filename)
    end

  end
end<commit_msg>test plugin with github<commit_after>module Jekyll

  # Recover from strange exception when starting server without --auto
  class DataFile < StaticFile
    
    def destination(dest)
      File.join(@base, @dir, @name)
    end

    def modified?
      return false
    end

    def write(dest)
      return true
    end
  end

  class DataGenerator < Generator
    safe true
    priority :high
    # Config defaults
    DIR = '/'
    POST_LIST_FILENAME = 'data.html'
    

    # Goes through pages and posts and generates sitemap.xml file
    #
    # Returns nothing
    def generate(site)
      dir = File.join(site.source, DIR)
      filename = POST_LIST_FILENAME

      # Create destination directory if it doesn't exist yet. Otherwise, we cannot write our file there.
      Dir::mkdir(dir) if !File.directory? dir

      # File I/O: create sitemap.xml file and write out pretty-printed XML
     
      # file = File.new(File.join(dir, filename), "w")
      # file.write('hello wwww')
      # file.close

      File.open(File.join(dir, filename), 'w') do |file|
          file.write('my file xxx')
      end 

      # Keep the sitemap.xml file from being cleaned by Jekyll
      site.static_files << StaticFile.new(site, site.source, '/', filename)
    end

  end
end
{'fraction_non_alphanumeric': 0.08986539984164688, 'fraction_numerical': 0.0, 'mean_word_length': 2.4148648648648647, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '1848292', 'n_tokens_mistral': 791, 'n_tokens_neox': 747, 'n_words': 247}