<commit_before>﻿using System;
using System.IO;
using System.Linq;

namespace CslaGenerator
{
    internal static class VersionHelper
    {
        internal const string CurrentFileVersion = "4.0.4";
        private static string[] FileLines { get; set; }
        private static string _fileVersionFound;

        public static void WriteAllLinesBetter(string path, params string[] lines)
        {
            if (path == null)
                throw new ArgumentNullException("path");
            if (lines == null)
                throw new ArgumentNullException("lines");

            using (var stream = File.OpenWrite(path))
            {
                using (var writer = new StreamWriter(stream))
                {
                    if (lines.Length > 0)
                    {
                        for (var i = 0; i < lines.Length - 1; i++)
                        {
                            writer.WriteLine(lines[i]);
                        }
                        writer.Write(lines[lines.Length - 1]);
                    }
                }
            }
        }<commit_msg>Version Helpers - fix WriteAllLinesBetter. Work Item #2043<commit_after>﻿using System;
using System.IO;
using System.Linq;

namespace CslaGenerator
{
    internal static class VersionHelper
    {
        internal const string CurrentFileVersion = "4.0.4";
        private static string[] FileLines { get; set; }
        private static string _fileVersionFound;

        public static void WriteAllLinesBetter(string path, params string[] lines)
        {
            if (path == null)
                throw new ArgumentNullException("path");
            if (lines == null)
                throw new ArgumentNullException("lines");

            using (var stream = File.OpenWrite(path))
            {
                stream.SetLength(0);
                using (var writer = new StreamWriter(stream))
                {
                    if (lines.Length > 0)
                    {
                        for (var i = 0; i < lines.Length - 1; i++)
                        {
                            writer.WriteLine(lines[i]);
                        }
                        writer.Write(lines[lines.Length - 1]);
                    }
                }
            }
        }
{'fraction_non_alphanumeric': 0.08720420683610867, 'fraction_numerical': 0.008326029798422436, 'mean_word_length': 1.2739043824701195, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2392387', 'n_tokens_mistral': 562, 'n_tokens_neox': 520, 'n_words': 147}