lib/tamashii/manager.rb in tamashii-manager-0.1.7 vs lib/tamashii/manager.rb in tamashii-manager-0.2.0
- old
+ new
@@ -1,23 +1,41 @@
-require "tamashii/manager/server"
-require "tamashii/manager/version"
-require "tamashii/manager/config"
-require "tamashii/manager/authorization"
-require "tamashii/manager/handler/broadcaster"
-require "tamashii/manager/clients"
-require "tamashii/common"
+# frozen_string_literal: true
-Tamashii::Resolver.default_handler Tamashii::Manager::Handler::Broadcaster
-Tamashii::Resolver.handle Tamashii::Type::AUTH_TOKEN, Tamashii::Manager::Authorization
+require 'tamashii/server'
+require 'tamashii/common'
+require 'tamashii/manager/version'
+require 'tamashii/manager/subscription'
+require 'tamashii/manager/config'
+require 'tamashii/manager/client_manager'
+require 'tamashii/manager/client'
+require 'tamashii/manager/channel'
+require 'tamashii/manager/channel_pool'
+require 'tamashii/manager/authorization'
+require 'tamashii/manager/authorizator'
+require 'tamashii/manager/handler'
+require 'tamashii/manager/error'
+require 'tamashii/manager/server'
+
module Tamashii
+ # :nodoc:
module Manager
def self.config(&block)
- return Config.class_eval(&block) if block_given?
+ return instance_exec(Config.instance, &block) if block_given?
Config
end
def self.logger
- @logger ||= Tamashii::Logger.new(Config.log_file)
+ @logger ||= ::Logger.new(config.log_file)
end
+
+ def self.server
+ @server ||= Tamashii::Manager::Server.new
+ end
end
end
+
+# TODO: Use block mode to define resolver
+# rubocop:disable Metrics/LineLength
+Tamashii::Resolver.default_handler Tamashii::Manager::Handler::Broadcaster
+Tamashii::Resolver.handle Tamashii::Type::AUTH_TOKEN, Tamashii::Manager::Authorization
+# rubocop:enable Metrics/LineLength