<commit_before>require "rss"

class Rebuild
  def initialize
    @rss = RSS::Parser.parse("http://feeds.rebuild.fm/rebuildfm")
    @home = Dir.home
  end

  def download
    puts "------ Start downloading ------"
    @rss.items.each do |item|
      puts "Now download -> #{item.title}"
      system("cd",
	     "#{download_directory}")
      system("curl",
	     "--location",
	     "--output",
	     "#{item.title}.mp3",
	     "#{item.enclosure.url}")
    end
    puts "****** Finished downloading ******"
  end

  private
  def download_directory
    "#{@home}/rebuild"
  end

  def create_directory
    begin
      Dir.chdir(download_directory)
    rescue Errno::ENOENT
      Dir.mkdir(download_directory)
    end
  end
end

rebuild = Rebuild.new
rebuild.download
<commit_msg>Add missing create_directory<commit_after>require "rss"

class Rebuild
  def initialize
    @rss = RSS::Parser.parse("http://feeds.rebuild.fm/rebuildfm")
    @home = Dir.home
  end

  def download
    create_directory
    puts "------ Start downloading ------"
    @rss.items.each do |item|
      puts "Now download -> #{item.title}"
      system("cd",
	     "#{download_directory}")
      system("curl",
	     "--location",
	     "--output",
	     "#{item.title}.mp3",
	     "#{item.enclosure.url}")
    end
    puts "****** Finished downloading ******"
  end

  private
  def download_directory
    "#{@home}/rebuild"
  end

  def create_directory
    begin
      Dir.chdir(download_directory)
    rescue Errno::ENOENT
      Dir.mkdir(download_directory)
    end
  end
end

rebuild = Rebuild.new
rebuild.download

{'fraction_non_alphanumeric': 0.15307402760351319, 'fraction_numerical': 0.0012547051442910915, 'mean_word_length': 2.560267857142857, 'pattern_counts': {'":': 0, '<': 3, '<?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': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2672821', 'n_tokens_mistral': 530, 'n_tokens_neox': 521, 'n_words': 109}