Module: Blur

Defined in:
library/blur.rb,
library/blur/user.rb,
library/blur/client.rb,
library/blur/script.rb,
library/blur/channel.rb,
library/blur/network.rb,
library/blur/version.rb,
library/blur/handling.rb,
library/blur/callbacks.rb,
library/blur/script_cache.rb,
library/blur/network/isupport.rb,
library/blur/network/connection.rb

Overview

Blur is a very modular IRC-framework for ruby.

It allows the developer to extend it in multiple ways. It can be by handlers, scripts, communications, and what have you.

Defined Under Namespace

Modules: Callbacks, Commands Classes: Channel, Client, ClientError, ConfigError, Network, ScriptCache, SuperScript, User

Constant Summary collapse

VERSION =

The current version of Blur.

'2.1.6'

Class Method Summary collapse

Class Method Details

.connect(options = {}, &block) ⇒ Object

Note:

The idea is that this should never stop or return anything.

Instantiates a client with given options and then makes the client instance evaluate the given block to form a DSL.

Parameters:

  • options (Hash) (defaults to: {})

    the options for the client.

Options Hash (options):

  • networks (Array)

    list of hashes that contain network options.



68
69
70
71
72
# File 'library/blur.rb', line 68

def self.connect options = {}, &block
  Client.new(options).tap do |client|
    client.instance_eval &block
  end.connect
end

.reset_scripts!Object

Resets all scripts.

This method will call ‘deinit` on each script class before removing them to give them a chance to clean up.



56
57
58
59
# File 'library/blur.rb', line 56

def self.reset_scripts!
  scripts.each_value &:deinit
  scripts.clear
end

.Script(name, *_args, &block) ⇒ Object

Creates a new superscript class and inserts it into the list of scripts.



37
38
39
40
41
42
43
44
45
# File 'library/blur.rb', line 37

def self.Script name, *_args, &block
  klass = Class.new SuperScript
  klass.name = name
  klass.events = {}
  klass.class_exec &block
  klass.init

  scripts[name] = klass
end

.scriptsObject

Gets all superscript classes.



48
49
50
# File 'library/blur.rb', line 48

def self.scripts
  @scripts ||= {}
end

.versionString

Get the current version.

Returns:

  • (String)

    The current version of Blur.



10
11
12
# File 'library/blur/version.rb', line 10

def self.version
  VERSION
end