Skip to content

Instantly share code, notes, and snippets.

@marzdgzmn
Created December 12, 2017 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marzdgzmn/7e96cbdcda6fc52fe559026cbc2b4cc8 to your computer and use it in GitHub Desktop.
Save marzdgzmn/7e96cbdcda6fc52fe559026cbc2b4cc8 to your computer and use it in GitHub Desktop.
DATABASE_FILE = "#{MirrorFileUtils::DATA_DIR}/mirror.db"
UPSERT = "INSERT OR REPLACE INTO mirror "
attr_accessor :database_file
public_class_method :new
def initialize(params = {})
@database_file = params.fetch(:database_file, DATABASE_FILE)
@mutex = Mutex.new
puts "DATABASE_FILE : #{DATABASE_FILE}"
MirrorFileUtils::create_file(@database_file)
initialize_db
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment