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/logging.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, Logging Classes: Channel, Client, Network, ScriptCache, SuperScript, User

Constant Summary collapse

Version =

The current version of Blur.

'2.1.2'.freeze
@@scripts =

Contains all superscript classes for scripts that may be used.

{}

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.


66
67
68
69
70
# File 'library/blur.rb', line 66

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.


54
55
56
57
# File 'library/blur.rb', line 54

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.


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

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.


46
47
48
# File 'library/blur.rb', line 46

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