Sha256: 8eccba19b20a3c3664216c73ac3ec22e303fa98448b6aa9283fca623dd9bb76a

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require "dotenv"
require "json"
require "logger"
require "socket"
require "xmpp4r"
require "xmpp4r/muc/helper/mucbrowser"
require "xmpp4r/muc/helper/simplemucclient"
require "xmpp4r/roster/helper/roster"

require "del/configuration"
require "del/connection"
require "del/default_router"
require "del/message"
require "del/repository"
require "del/robot"
require "del/socket_connection"
require "del/socket_server"
require "del/source"
require "del/user"
require "del/version"

module Del
  def self.start(dotenv_file:, startup_file: nil, start_server: true, socket_file: nil)
    puts "Loading... #{dotenv_file}"
    Dotenv.load(dotenv_file.to_s)
    Del.configure do |config|
      config.socket_file = socket_file if socket_file
      config.router.register(/.*/) do |message|
        logger.debug(message.to_s)
      end
      config.load(startup_file)
    end
    del = Robot.new(configuration: configuration)
    del.get_funky!(start_server: start_server)
  end

  def self.configure
    yield configuration
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.logger
    @logger ||= configuration.logger
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
del-0.1.10 lib/del.rb
del-0.1.9 lib/del.rb
del-0.1.8 lib/del.rb