<commit_before>require 'data_mapper'
require 'dm-types'

module ErnieBrodeur
  module DM
  	def self.db_path
  		# TODO not hardcode this.
  		"/home/ebrodeur/.config/erniebrodeur/#{App.name}.db"
  	end

  	def self.initialize
  		DataMapper::Logger.new($stdout, :debug)
   		DataMapper.setup(:default, "sqlite://#{db_path}")

			%w{file}.each do |f|
			  require "models/dm/#{f}"
			end

			DataMapper.auto_upgrade!
   	end

   	self.initialize
  end
  App.plugins.push 'dm'
end<commit_msg>Moved around where models are loaded from, added a rand to DataMapper::Collection.<commit_after>require 'data_mapper'

module ErnieBrodeur
  module DM
  	def self.db_path
  		# TODO not hardcode this.
  		"/home/ebrodeur/.config/erniebrodeur/#{App.name}.db"
  	end

  	def self.initialize
  		DataMapper::Logger.new($stdout, :debug)
   		DataMapper.setup(:default, "sqlite://#{db_path}")

			%w{file image}.each do |f|
			  require "/home/ebrodeur/Projects/bin_snippets/lib/models/dm/#{f}.rb"
			end

			DataMapper.auto_upgrade!
   	end

   	self.initialize
  end
  App.plugins.push 'dm'
end

module DataMapper
	class Collection
		def rand
			all[Random.rand(all.count)]
		end
	end
end
{'fraction_non_alphanumeric': 0.12414965986394558, 'fraction_numerical': 0.0, 'mean_word_length': 3.295620437956204, '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': '5138720', 'n_tokens_mistral': 474, 'n_tokens_neox': 442, 'n_words': 89}