<commit_before># Encoding: UTF-8

require 'sequel'
require 'json'

Sequel.migration do
  up do
    projects = JSON.parse(IO.read('migration/data/002/initial_projects.json'))
    projects.each do |project|
      from(:projects).insert(title: project['title'],
                             description: project['description'],
                             contact_name: project['contact_name'],
                             email: project['email'])
    end
  end

  down do
    from(:projects).delete_all
  end
end
<commit_msg>fix(migrations): make path for data more robust<commit_after># Encoding: UTF-8

require 'sequel'
require 'json'

Sequel.migration do
  up do
    projects_file = File.dirname(__FILE__) +
      '/data/002/initial_projects.json'
    projects = JSON.parse(IO.read(projects_file))
    projects.each do |project|
      from(:projects).insert(title: project['title'],
                             description: project['description'],
                             contact_name: project['contact_name'],
                             email: project['email'])
    end
  end

  down do
    from(:projects).delete_all
  end
end

{'fraction_non_alphanumeric': 0.11228070175438597, 'fraction_numerical': 0.007017543859649123, 'mean_word_length': 2.2693409742120343, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7125127', 'n_tokens_mistral': 322, 'n_tokens_neox': 314, 'n_words': 71}