<commit_before>part of bot_io;

class TempDir extends DisposableImpl {
  final Directory _dir;

  factory TempDir() {

    final startDir = new Directory('');
    return new TempDir._internal(startDir.createTempSync());
  }

  TempDir._internal(this._dir);

  String get path => _dir.path;

  Future populate(DirectoryPopulater populater) {
    return populater.populate(_dir);
  }

  Future<bool> verifyContents(Map<String, dynamic> content) {
    return IoHelpers.verifyContents(_dir, content);
  }

  Future<bool> isEmpty() {
    return IoHelpers.isEmpty(_dir);
  }

  String toString() => "TempDir: $path";

  @protected
  void disposeInternal() {
    assert(_dir.existsSync());
    _dir.deleteSync(recursive: true);
    assert(!_dir.existsSync());<commit_msg>TempDir: expose the dir object<commit_after>part of bot_io;

class TempDir extends DisposableImpl {
  final Directory dir;

  factory TempDir() {

    final startDir = new Directory('');
    return new TempDir._internal(startDir.createTempSync());
  }

  TempDir._internal(this.dir);

  String get path => dir.path;

  Future populate(DirectoryPopulater populater) {
    return populater.populate(dir);
  }

  Future<bool> verifyContents(Map<String, dynamic> content) {
    return IoHelpers.verifyContents(dir, content);
  }

  Future<bool> isEmpty() {
    return IoHelpers.isEmpty(dir);
  }

  String toString() => "TempDir: $path";

  @protected
  void disposeInternal() {
    assert(dir.existsSync());
    dir.deleteSync(recursive: true);
    assert(!dir.existsSync());
{'fraction_non_alphanumeric': 0.12434895833333333, 'fraction_numerical': 0.0, 'mean_word_length': 4.2457337883959045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '7459351', 'n_tokens_mistral': 491, 'n_tokens_neox': 466, 'n_words': 105}