Minor fixes.

This commit is contained in:
2026-09-24 16:45:18 +01:00
parent cefa98cdec
commit 1e27d7629f
7 changed files with 41 additions and 39 deletions
+3 -4
View File
@@ -10,17 +10,16 @@ require "zlib"
ALPHANUM = [*"0".."9", *"A".."Z", *"a".."z", "-", "_"].freeze
env_data = File.exist?(".env") ? File.read(".env") : ""
ENV_HASH = {}
env_data.each_line do |line|
next unless (match = line.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/))
ENV_HASH[match[1]] = match[2]
ENV[match[1]] = match[2]
end
load "logman.rb"
# Logman.log ENV_HASH.inspect
# Logman.log ENV.inspect
db_file = File.expand_path("infinsweeper.db", __dir__)
db_file = ENV.fetch("INFINSWEEPER_DB", File.expand_path("infinsweeper.db", __dir__))
DB = Sequel.connect("sqlite:///#{db_file}", single_threaded: false)
DB.run("PRAGMA foreign_keys = ON;")
DB.create_table? :Players do