<commit_before>namespace :db do
  desc "Fill database with sample data"
  task :populate => :environment do
    make_users
  end
end

def make_users
  20.times do |n|
    provider = "Github"
    uid = "1234abd"
    name = Faker::Name.name
    email = "<EMAIL>"
    nickname = "test#{n}"

    user = User.new(
      :provider => provider,
      :uid => uid,
      :name => name,
      :email => email,
      :nickname => nickname
    )
    user.save
  end
end<commit_msg>Create jobs with other sample data<commit_after>namespace :db do
  desc "Fill database with sample data"
  task :populate => :environment do
    make_users
    make_jobs
  end
end

def make_users
  20.times do |n|
    provider = "Github"
    uid = "1234abd"
    name = Faker::Name.name
    email = "<EMAIL>"
    nickname = "test#{n}"

    user = User.new(
      :provider => provider,
      :uid => uid,
      :name => name,
      :email => email,
      :nickname => nickname
    )
    user.save
  end
end

def make_jobs
  positions = [
    "Senior Developer",
    "Junior Developer",
    "Code Ninja",
    "Code Surfer",
    "Pro Hacker",
    "Programmer"
  ]
  20.times do |n|
    job = Job.new(
      title: positions.sample,
      description: Faker::Company.bs,
      company_name: Faker::Company.name,
      company_website: Faker::Internet.domain_name,
      how_to_apply: "Send an email to #{Faker::Internet.email}"
    ).save
  end
end
{'fraction_non_alphanumeric': 0.12093352192362093, 'fraction_numerical': 0.009900990099009901, 'mean_word_length': 2.451219512195122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6688261', 'n_tokens_mistral': 498, 'n_tokens_neox': 477, 'n_words': 133}