Minor fixes.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user