mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-29 00:00:45 -04:00
Use singleton in various classes
This commit is contained in:
+3
-14
@@ -1,5 +1,5 @@
|
||||
require "./config"
|
||||
require "./server"
|
||||
require "./context"
|
||||
require "./mangadex/*"
|
||||
require "option_parser"
|
||||
|
||||
@@ -24,18 +24,7 @@ OptionParser.parse do |parser|
|
||||
end
|
||||
end
|
||||
|
||||
config = Config.load config_path
|
||||
logger = Logger.new config.log_level
|
||||
storage = Storage.new config.db_path, logger
|
||||
library = Library.new config.library_path, config.scan_interval, logger, storage
|
||||
queue = MangaDex::Queue.new config.mangadex["download_queue_db_path"].to_s,
|
||||
logger
|
||||
api = MangaDex::API.new config.mangadex["api_url"].to_s
|
||||
MangaDex::Downloader.new queue, api, config.library_path,
|
||||
config.mangadex["download_wait_seconds"].to_i,
|
||||
config.mangadex["download_retries"].to_i, logger
|
||||
Config.load(config_path).set_current
|
||||
|
||||
context = Context.new config, logger, library, storage, queue
|
||||
|
||||
server = Server.new context
|
||||
server = Server.new
|
||||
server.start
|
||||
|
||||
Reference in New Issue
Block a user