mod_spox 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,10 +6,12 @@ module ModSpox
6
6
  # Create a new Pipeline
7
7
  def initialize(procs=3)
8
8
  super(procs)
9
+ @timeout = 20 # Anything over 20 seconds and we assume a plugin locked up the thread
9
10
  @messageq = Queue.new
10
11
  Logger.log("Created queue #{@messageq} in pipeline", 10)
11
12
  @hooks = Hash.new
12
13
  @plugins = Hash.new
14
+ @admin = Models::Group.filter(:name => 'admin').first
13
15
  populate_triggers
14
16
  populate_signatures
15
17
  hook(self, :populate_triggers, :Internal_TriggersUpdate)
@@ -80,11 +82,13 @@ module ModSpox
80
82
  @plugins.clear
81
83
  end
82
84
 
85
+ # Repopulate the active trigger list
83
86
  def populate_triggers(m=nil)
84
87
  @triggers = []
85
88
  Models::Trigger.filter(:active => true).each{|t|@triggers << t.trigger}
86
89
  end
87
90
 
91
+ # Repopulate the active signatures list
88
92
  def populate_signatures(m=nil)
89
93
  @signatures = []
90
94
  Models::Signature.all.each{|s|@signatures << s}
@@ -101,13 +105,21 @@ module ModSpox
101
105
  type = message.class.to_s.gsub(/^ModSpox::Messages::/, '').gsub(/::/, '_').to_sym
102
106
  mod = type.to_s.gsub(/_.+$/, '').to_sym
103
107
  Logger.log("Pipeline determines that #{message} is of type: #{type}", 10)
104
- [type, mod, :all].each{|type|
108
+ [type, mod, :all].each do |type|
105
109
  if(@hooks.has_key?(type))
106
- @hooks[type].each_value{|objects|
107
- objects.each{|v| v[:object].send(v[:method].to_s, message) }
108
- }
110
+ @hooks[type].each_value do |objects|
111
+ begin
112
+ Timeout::timeout(@timeout) do
113
+ objects.each{|v| v[:object].send(v[:method].to_s, message) }
114
+ end
115
+ rescue Timeout::Error => boom
116
+ Logger.log('Timeout reached while waiting for plugin to complete task')
117
+ rescue Object => boom
118
+ Logger.log("Plugin threw exception while attempting to process message: #{boom}\n#{boom.backtrace.join("\n")}")
119
+ end
120
+ end
109
121
  end
110
- }
122
+ end
111
123
  rescue Object => boom
112
124
  Logger.log("Pipeline encountered an exception while processing a message: #{boom}\n#{boom.backtrace.join("\n")}", 10)
113
125
  end
@@ -123,21 +135,29 @@ module ModSpox
123
135
  @triggers.each{|t| trigger = t if message.message =~ /^#{t}/}
124
136
  if(!trigger.nil? || message.addressed?)
125
137
  Logger.log("Message has matched against a known trigger", 15)
126
- @signatures.each{|sig|
138
+ @signatures.each do |sig|
127
139
  Logger.log("Matching against: #{trigger}#{sig.signature}")
128
140
  res = message.message.scan(/^#{trigger}#{sig.signature}$/)
129
141
  if(res.size > 0)
130
- next unless message.source.auth_groups.include?(sig.group) || sig.group.nil?
142
+ next unless message.source.auth_groups.include?(sig.group) || message.source.auth_groups.include?(@admin) ||sig.group.nil?
131
143
  params = Hash.new
132
144
  sig.params.size.times do |i|
133
145
  params[sig.params[i - 1].to_sym] = res[0][i]
134
146
  Logger.log("Signature params: #{sig.params[i - 1].to_sym} = #{res[0][i]}")
135
147
  end
136
148
  if(@plugins.has_key?(sig.plugin.to_sym))
137
- @plugins[sig.plugin.to_sym].send(sig.values[:method], message, params)
149
+ begin
150
+ Timeout::timeout(@timeout) do
151
+ @plugins[sig.plugin.to_sym].send(sig.values[:method], message, params)
152
+ end
153
+ rescue Timeout::Error => boom
154
+ Logger.log('Timeout reached while waiting for plugin to complete task')
155
+ rescue Object => boom
156
+ Logger.log("Plugin threw exception while attempting to process message: #{boom}\n#{boom.backtrace.join("\n")}")
157
+ end
138
158
  end
139
159
  end
140
- }
160
+ end
141
161
  else
142
162
  Logger.log("Message failed to match any known trigger", 15)
143
163
  end
@@ -1,6 +1,7 @@
1
1
  module ModSpox
2
2
  class Plugin
3
3
  def initialize(pipeline)
4
+ raise Exceptions::BotException.new('Plugin creation failed to supply message pipeline') unless pipeline.is_a?(Pipeline)
4
5
  @pipeline = pipeline
5
6
  @pipeline.hook_plugin(self)
6
7
  end
@@ -14,5 +15,24 @@ module ModSpox
14
15
  def name
15
16
  self.class.name.to_s.gsub(/^.+:/, '')
16
17
  end
18
+
19
+ # target:: target for message
20
+ # message:: string message
21
+ # This is a helper method that will send an outgoing Privmsg
22
+ # to the given target
23
+ def reply(target, message)
24
+ @pipeline << Messages::Outgoing::Privmsg.new(target, message)
25
+ end
26
+
27
+ # Returns the nick model of the bot
28
+ def me
29
+ nick = Models::Nick.filter(:botnick => true).first
30
+ if(nick)
31
+ return nick
32
+ else
33
+ raise Exception.new("Fatal Error: I don't know who I am.")
34
+ end
35
+ end
36
+
17
37
  end
18
38
  end
@@ -35,13 +35,13 @@ module ModSpox
35
35
  def load_plugin(message)
36
36
  begin
37
37
  Logger.log("THE MESSAGE NAME IS: #{message.name}")
38
- path = message.name.nil? ? BotConfig[:userpluginpath] : "#{BotConfig[:userpluginpath]}/#{message.name}"
39
- File.copy(message.path, path)
38
+ path = !message.name ? BotConfig[:userpluginpath] : "#{BotConfig[:userpluginpath]}/#{message.name}"
39
+ FileUtils.copy(message.path, path)
40
40
  reload_plugins
41
41
  @pipeline << Messages::Internal::PluginLoadResponse.new(message.requester, true)
42
42
  Logger.log("Loaded new plugin: #{message.path}", 10)
43
43
  rescue Object => boom
44
- Logger.log("Failed to load plugin: #{message.path}", 10)
44
+ Logger.log("Failed to load plugin: #{message.path} Reason: #{boom}", 10)
45
45
  @pipeline << Messages::Internal::PluginLoadResponse.new(message.requester, false)
46
46
  end
47
47
  end
@@ -51,9 +51,9 @@ module ModSpox
51
51
  def unload_plugin(message)
52
52
  begin
53
53
  unless(message.name.nil?)
54
- File.copy(message.path, "#{BotConfig[:userpluginpath]}/#{message.name}")
54
+ FileUtils.copy(message.path, "#{BotConfig[:userpluginpath]}/#{message.name}")
55
55
  end
56
- File.unlink(message.path)
56
+ FileUtils.remove_file(message.path)
57
57
  reload_plugins
58
58
  @pipeline << Messages::Internal::PluginUnloadResponse.new(message.requester, true)
59
59
  Logger.log("Unloaded plugin: #{message.path}", 10)
@@ -77,15 +77,23 @@ module ModSpox
77
77
  [BotConfig[:pluginpath], BotConfig[:userpluginpath]].each{|path|
78
78
  Dir.new(path).each{|file|
79
79
  if(file =~ /^[^\.].+\.rb$/)
80
- @plugins_module.module_eval(IO.readlines("#{path}/#{file}").join("\n"))
80
+ begin
81
+ @plugins_module.module_eval(IO.readlines("#{path}/#{file}").join("\n"))
82
+ rescue Object => boom
83
+ Logger.log("Failed to load file: #{path}/#{file}. Reason: #{boom}")
84
+ end
81
85
  end
82
86
  }
83
87
  }
84
88
  @plugins_module.constants.each{|const|
85
89
  klass = @plugins_module.const_get(const)
86
90
  if(klass < Plugin)
87
- @plugins[const.to_sym] = klass.new(@pipeline)
88
- Logger.log("Initialized new plugin: #{const}", 15)
91
+ begin
92
+ @plugins[const.to_sym] = klass.new(@pipeline)
93
+ Logger.log("Initialized new plugin: #{const}", 15)
94
+ rescue Object => boom
95
+ Logger.log("Failed to initialize plugin #{const}. Reason: #{boom}")
96
+ end
89
97
  end
90
98
  }
91
99
  @pipeline << Messages::Internal::SignaturesUpdate.new
data/lib/mod_spox/Pool.rb CHANGED
@@ -2,7 +2,7 @@ module ModSpox
2
2
 
3
3
  # The Pool class is used to reduce thread creation. When
4
4
  # used in conjuntion with a PoolQueue, it provides an easy
5
- # way to process many objects in an asynchronise manner
5
+ # way to process many objects in an asynchronous manner
6
6
  class Pool
7
7
 
8
8
  # num_procs:: Number of threads to use
@@ -10,7 +10,7 @@ module ModSpox
10
10
  protected
11
11
 
12
12
  def find_model(string)
13
- if(string =~ /^[A-Za-z\|\\\{\}\[\]\^`~_\-]+$/)
13
+ if(string =~ /^[A-Za-z\|\\\{\}\[\]\^\`~\_\-]+$/)
14
14
  Logger.log("Model: #{string} -> Nick")
15
15
  return Models::Nick.find_or_create(:nick => string)
16
16
  elsif(string =~ /^[&#+!]/)
@@ -14,7 +14,7 @@ module ModSpox
14
14
  channel = find_model(chan)
15
15
  kickee = find_model(kicked)
16
16
  channel.nick_remove(kickee)
17
- return Messages::Incoming::Kick(string, channel, kicker, kickee, reason)
17
+ return Messages::Incoming::Kick.new(string, channel, kicker, kickee, reason)
18
18
  else
19
19
  Logger.log('Failed to process KICK message')
20
20
  end
@@ -6,40 +6,46 @@ module ModSpox
6
6
  end
7
7
 
8
8
  def process(string)
9
- if(string =~ /^:([^!]+)!.+?MODE\s(\S+)\s(\S+)$/) # this is for modes applied to the channel
10
- source = find_model($1)
11
- channel = find_model($2)
12
- full_mode = $3
13
- action = full_mode[0].chr
14
- full_mode.slice(0).each_char{|c|
15
- Models::ChannelMode.find_or_create(:channel_id => channel.pk, :mode => c) if action == '+'
16
- if(action == '-' && model = Models::ChannelMode.filter(:channel_id => channel.pk, :mode => c).first)
17
- model.destroy!
9
+ begin
10
+ if(string =~ /^:([^!]+)!.+?MODE\s(\S+)\s(\S+)$/) # this is for modes applied to the channel
11
+ source = find_model($1)
12
+ channel = find_model($2)
13
+ full_mode = $3
14
+ action = full_mode[0].chr
15
+ full_mode.slice(0).each_char{|c|
16
+ Models::ChannelMode.find_or_create(:channel_id => channel.pk, :mode => c) if action == '+'
17
+ if(action == '-' && model = Models::ChannelMode.filter(:channel_id => channel.pk, :mode => c).first)
18
+ model.destroy
19
+ end
20
+ }
21
+ return Messages::Incoming::Mode.new(string, full_mode, source, nil, channel)
22
+ #elsif(string =~ /^:([^!]+)!.+MODE\s(\S+)\s(.+)$/) # this is for modes applied to nick
23
+ # raise Exceptions::BotException.new("Matched unimplemented mode string")
24
+ elsif(string =~ /^:([^!]+)!.+MODE\s(\S+)\s(\S+)\s(.+)$/)
25
+ source = find_model($1)
26
+ channel = find_model($2)
27
+ full_modes = $3
28
+ targets = $4
29
+ action = full_modes[0].chr
30
+ nicks = Array.new
31
+ full_modes.sub(/^./, '').length.times do |i|
32
+ nick = find_model(targets.scan(/\S+/)[i])
33
+ nicks << nick
34
+ if(nick.is_a?(Models::Nick))
35
+ mode = full_modes[i + 1].chr
36
+ Models::NickMode.find_or_create(:channel_id => channel.pk, :nick_id => nick.pk, :mode => mode) if action == '+'
37
+ if(action == '-' && model = Models::NickMode.filter(:channel_id => channel.pk, :nick_id => nick.pk, :mode => mode).first)
38
+ model.destroy
39
+ end
40
+ end
18
41
  end
19
- }
20
- return Messages::Incoming::Mode.new(string, full_mode, source, nil, channel)
21
- elsif(string =~ /^:([^!]+)!.+MODE\s(\S+)\s(.+)$/) # this is for modes applied to nick
22
- # implement later #
23
- elsif(string =~ /^:([^!]+)!.+MODE\s(\S+)\s(\S+)\s(.+)$/)
24
- source = find_model($1)
25
- channel = find_model($2)
26
- full_modes = $3
27
- targets = $4
28
- action = full_mode[0].chr
29
- nicks = Array.new
30
- full_mode.slice(0).length.times{|i|
31
- nick = find_model(targets.scan(/\S+/)[i])
32
- nicks << nick
33
- mode = full_mode[i + 1].chr
34
- Models::NickMode.find_or_create(:channel_id => channel.pk, :nick_id => nick.pk, :mode => mode) if action == '+'
35
- if(action == '-' && model = Models::NickMode.filter(:channel_id => channel.pk, :nick_id => nick.pk, :mode => mode).first)
36
- model.destroy!
37
- end
38
- }
39
- nicks = nicks[0] if nicks.size == 1
40
- return Messages::Incoming::Mode.new(string, full_mode, source, nicks, channel)
41
- else
42
- Logger.log('Failed to parse MODE message')
42
+ nicks = nicks[0] if nicks.size == 1
43
+ return Messages::Incoming::Mode.new(string, full_modes, source, nicks, channel)
44
+ else
45
+ Logger.log('Failed to parse MODE message')
46
+ end
47
+ rescue Object => boom
48
+ Logger.log("Failed to process MODE message. Reason: #{boom}")
43
49
  end
44
50
  end
45
51
  end
@@ -5,7 +5,7 @@ module ModSpox
5
5
  handlers[:PART] = self
6
6
  end
7
7
  def process(string)
8
- if(string =~ /^:(\S+) PART (\S+) :(.*)$/)
8
+ if(string =~ /^:(\S+) PART (\S+) (.*)$/)
9
9
  channel = find_model($2)
10
10
  nick = find_model($1.gsub(/!.+$/, ''))
11
11
  channel.nick_remove(nick)
@@ -18,8 +18,8 @@ module ModSpox
18
18
  # 6: info
19
19
  # 7: hops
20
20
  # 8: realname
21
- location = $1 unless location.include?('*')
22
- location = $5 if location == '*'
21
+ location = $1 unless $1.include?('*')
22
+ location = $5 if $5 == '*'
23
23
  location = $1.gsub(/\*\s/, '') if location.include?('* ')
24
24
  info = $6
25
25
  nick = find_model($5)
@@ -43,17 +43,18 @@ module ModSpox
43
43
  Models::NickMode.filter(:channel_id => channel.pk, :nick_id => nick.pk).each{|m| m.destroy}
44
44
  end
45
45
  end
46
- elsif(string =~ /#{RPL_ENDWHO}\s\S+\s(\S+)\s/)
46
+ elsif(string =~ /#{RPL_ENDOFWHO}\s\S+\s(\S+)\s/)
47
47
  location = $1
48
48
  loc = find_model(location)
49
49
  @raw_cache[location] << string
50
- message = Messages::Incoming::Who.new(@raw_cache.join("\n"), loc, @cache[location])
50
+ message = Messages::Incoming::Who.new(@raw_cache[location].join("\n"), loc, @cache[location])
51
51
  @raw_cache.delete(location)
52
52
  @cache.delete(location)
53
53
  return message
54
54
  else
55
55
  Logger.log('Failed to match RPL_WHO type message')
56
56
  end
57
+ return nil
57
58
  end
58
59
  end
59
60
  end
@@ -40,7 +40,7 @@ module ModSpox
40
40
 
41
41
  # Is this a public message
42
42
  def is_public?
43
- return @target.is_a?(Model::Channel)
43
+ return @target.is_a?(Models::Channel)
44
44
  end
45
45
 
46
46
  # Does the message contain colors
@@ -57,6 +57,12 @@ module ModSpox
57
57
  def is_action?
58
58
  @action
59
59
  end
60
+
61
+ # Convinence method for replying to the correct place
62
+ def replyto
63
+ return @source if is_private?
64
+ return @target if is_public?
65
+ end
60
66
 
61
67
  end
62
68
  end
@@ -1,7 +1,7 @@
1
1
  module ModSpox
2
2
  module Messages
3
3
  module Outgoing
4
- class Names
4
+ class Invite
5
5
  # nick to invite
6
6
  attr_reader :nick
7
7
  # channel to invite nick to
@@ -13,6 +13,10 @@ module ModSpox
13
13
  @mask = mask
14
14
  @op_only = op_only
15
15
  end
16
+
17
+ def only_ops?
18
+ return op_only
19
+ end
16
20
  end
17
21
  end
18
22
  end
@@ -17,7 +17,11 @@ module ModSpox
17
17
 
18
18
  # Nicks residing within this channel
19
19
  def nicks
20
- NickChannel.filter(:channel_id => pk)
20
+ all_nicks = []
21
+ NickChannel.filter(:channel_id => pk).each do |nc|
22
+ all_nicks << nc.nick
23
+ end
24
+ return all_nicks
21
25
  end
22
26
 
23
27
  # Adds a nick to this channel
@@ -45,7 +45,7 @@ module ModSpox
45
45
  groups = []
46
46
  auth_ids = []
47
47
  group_ids = []
48
- auth = Auth.filter(:nick_id => pk, :authed => true).first
48
+ auth = Auth.filter{:nick_id == pk && :authed == true}.first
49
49
  if(auth)
50
50
  groups = auth.groups
51
51
  end
@@ -93,7 +93,20 @@ module ModSpox
93
93
 
94
94
  # Channels nick is currently in
95
95
  def channels
96
- NickChannel.filter(:nick_id => pk)
96
+ chans = []
97
+ NickChannel.filter(:nick_id => pk).each do |nc|
98
+ chans << nc.channel
99
+ end
100
+ return chans
101
+ end
102
+
103
+ # channel:: Models::Channel
104
+ # Return if nick is operator in given channel
105
+ def is_op?(channel)
106
+ NickMode.filter(:channel_id => channel.pk, :nick_id => pk).each do |mode|
107
+ return true if mode.mode == 'o'
108
+ end
109
+ return false
97
110
  end
98
111
 
99
112
  # Purge all nick information
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: mod_spox
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2008-03-28 00:00:00 -07:00
6
+ version: 0.0.2
7
+ date: 2008-04-11 00:00:00 -07:00
8
8
  summary: The mod_spox IRC robot
9
9
  require_paths:
10
10
  - lib
@@ -35,6 +35,7 @@ files:
35
35
  - lib/mod_spox/models/ChannelMode.rb
36
36
  - lib/mod_spox/models/NickChannel.rb
37
37
  - lib/mod_spox/models/Setting.rb
38
+ - lib/mod_spox/models/AuthGroup.rb
38
39
  - lib/mod_spox/models/Auth.rb
39
40
  - lib/mod_spox/models/Signature.rb
40
41
  - lib/mod_spox/models/Trigger.rb
@@ -43,10 +44,9 @@ files:
43
44
  - lib/mod_spox/models/Server.rb
44
45
  - lib/mod_spox/models/Channel.rb
45
46
  - lib/mod_spox/models/NickMode.rb
46
- - lib/mod_spox/models/AuthGroup.rb
47
47
  - lib/mod_spox/models/Group.rb
48
- - lib/mod_spox/migration/001_create_nick_modes.rb
49
48
  - lib/mod_spox/migration/001_create_channel_modes.rb
49
+ - lib/mod_spox/migration/001_create_nick_modes.rb
50
50
  - lib/mod_spox/migration/001_create_nick_channels.rb
51
51
  - lib/mod_spox/migration/001_create_settings.rb
52
52
  - lib/mod_spox/migration/001_create_auths.rb
@@ -56,6 +56,7 @@ files:
56
56
  - lib/mod_spox/migration/001_create_nicks.rb
57
57
  - lib/mod_spox/migration/001_create_channel.rb
58
58
  - lib/mod_spox/migration/001_create_servers.rb
59
+ - lib/mod_spox/handlers/LuserClient.rb
59
60
  - lib/mod_spox/handlers/Handler.rb
60
61
  - lib/mod_spox/handlers/Topic.rb
61
62
  - lib/mod_spox/handlers/Kick.rb
@@ -66,9 +67,9 @@ files:
66
67
  - lib/mod_spox/handlers/Privmsg.rb
67
68
  - lib/mod_spox/handlers/NickInUse.rb
68
69
  - lib/mod_spox/handlers/LuserOp.rb
69
- - lib/mod_spox/handlers/LuserClient.rb
70
- - lib/mod_spox/handlers/Whois.rb
71
70
  - lib/mod_spox/handlers/BadNick.rb
71
+ - lib/mod_spox/handlers/Whois.rb
72
+ - lib/mod_spox/handlers/LuserChannels.rb
72
73
  - lib/mod_spox/handlers/Welcome.rb
73
74
  - lib/mod_spox/handlers/YourHost.rb
74
75
  - lib/mod_spox/handlers/Ping.rb
@@ -79,25 +80,25 @@ files:
79
80
  - lib/mod_spox/handlers/Names.rb
80
81
  - lib/mod_spox/handlers/Motd.rb
81
82
  - lib/mod_spox/handlers/Pong.rb
82
- - lib/mod_spox/handlers/LuserChannels.rb
83
- - lib/mod_spox/handlers/Part.rb
84
83
  - lib/mod_spox/handlers/Created.rb
84
+ - lib/mod_spox/handlers/Part.rb
85
85
  - lib/mod_spox/handlers/LuserUnknown.rb
86
86
  - lib/mod_spox/handlers/Bounce.rb
87
87
  - lib/mod_spox/handlers/LuserMe.rb
88
+ - lib/mod_spox/messages/incoming/Notice.rb
88
89
  - lib/mod_spox/messages/incoming/Topic.rb
89
90
  - lib/mod_spox/messages/incoming/Kick.rb
90
- - lib/mod_spox/messages/incoming/Notice.rb
91
+ - lib/mod_spox/messages/incoming/Message.rb
91
92
  - lib/mod_spox/messages/incoming/Quit.rb
92
93
  - lib/mod_spox/messages/incoming/Mode.rb
93
- - lib/mod_spox/messages/incoming/Message.rb
94
- - lib/mod_spox/messages/incoming/Nick.rb
95
94
  - lib/mod_spox/messages/incoming/Privmsg.rb
95
+ - lib/mod_spox/messages/incoming/Nick.rb
96
+ - lib/mod_spox/messages/incoming/LuserClient.rb
96
97
  - lib/mod_spox/messages/incoming/NickInUse.rb
97
98
  - lib/mod_spox/messages/incoming/LuserOp.rb
98
- - lib/mod_spox/messages/incoming/LuserClient.rb
99
- - lib/mod_spox/messages/incoming/Whois.rb
100
99
  - lib/mod_spox/messages/incoming/TopicInfo.rb
100
+ - lib/mod_spox/messages/incoming/Whois.rb
101
+ - lib/mod_spox/messages/incoming/LuserChannels.rb
101
102
  - lib/mod_spox/messages/incoming/BadNick.rb
102
103
  - lib/mod_spox/messages/incoming/Welcome.rb
103
104
  - lib/mod_spox/messages/incoming/YourHost.rb
@@ -109,9 +110,8 @@ files:
109
110
  - lib/mod_spox/messages/incoming/Names.rb
110
111
  - lib/mod_spox/messages/incoming/Motd.rb
111
112
  - lib/mod_spox/messages/incoming/Pong.rb
112
- - lib/mod_spox/messages/incoming/LuserChannels.rb
113
- - lib/mod_spox/messages/incoming/Part.rb
114
113
  - lib/mod_spox/messages/incoming/Created.rb
114
+ - lib/mod_spox/messages/incoming/Part.rb
115
115
  - lib/mod_spox/messages/incoming/LuserUnknown.rb
116
116
  - lib/mod_spox/messages/incoming/Bounce.rb
117
117
  - lib/mod_spox/messages/incoming/LuserMe.rb
@@ -160,17 +160,24 @@ files:
160
160
  - lib/mod_spox/messages/outgoing/ServList.rb
161
161
  - lib/mod_spox/messages/outgoing/List.rb
162
162
  - lib/mod_spox/messages/outgoing/UserHost.rb
163
+ - lib/mod_spox/messages/internal/PluginModuleRequest.rb
164
+ - lib/mod_spox/messages/internal/PluginLoadResponse.rb
163
165
  - lib/mod_spox/messages/internal/PluginResponse.rb
166
+ - lib/mod_spox/messages/internal/PluginUnloadResponse.rb
167
+ - lib/mod_spox/messages/internal/PluginModuleResponse.rb
168
+ - lib/mod_spox/messages/internal/PluginReload.rb
164
169
  - lib/mod_spox/messages/internal/Disconnecting.rb
170
+ - lib/mod_spox/messages/internal/SignaturesUpdate.rb
165
171
  - lib/mod_spox/messages/internal/TimerClear.rb
166
172
  - lib/mod_spox/messages/internal/Request.rb
167
173
  - lib/mod_spox/messages/internal/TimerAdd.rb
174
+ - lib/mod_spox/messages/internal/TriggersUpdate.rb
168
175
  - lib/mod_spox/messages/internal/ChangeNick.rb
169
176
  - lib/mod_spox/messages/internal/StatusRequest.rb
170
177
  - lib/mod_spox/messages/internal/NickRequest.rb
171
178
  - lib/mod_spox/messages/internal/HaltBot.rb
172
- - lib/mod_spox/messages/internal/Response.rb
173
179
  - lib/mod_spox/messages/internal/EstablishConnection.rb
180
+ - lib/mod_spox/messages/internal/Response.rb
174
181
  - lib/mod_spox/messages/internal/TimerRemove.rb
175
182
  - lib/mod_spox/messages/internal/TimerResponse.rb
176
183
  - lib/mod_spox/messages/internal/Disconnected.rb
@@ -179,23 +186,18 @@ files:
179
186
  - lib/mod_spox/messages/internal/NickResponse.rb
180
187
  - lib/mod_spox/messages/internal/ConnectionFailed.rb
181
188
  - lib/mod_spox/messages/internal/PluginRequest.rb
182
- - lib/mod_spox/messages/internal/BotInitialized.rb
183
- - lib/mod_spox/messages/internal/Shutdown.rb
184
- - lib/mod_spox/messages/internal/PluginReload.rb
185
- - lib/mod_spox/messages/internal/PluginLoadResponse.rb
186
- - lib/mod_spox/messages/internal/PluginModuleRequest.rb
187
189
  - lib/mod_spox/messages/internal/PluginLoadRequest.rb
190
+ - lib/mod_spox/messages/internal/BotInitialized.rb
188
191
  - lib/mod_spox/messages/internal/PluginUnloadRequest.rb
189
- - lib/mod_spox/messages/internal/PluginUnloadResponse.rb
190
- - lib/mod_spox/messages/internal/PluginModuleResponse.rb
191
- - lib/mod_spox/messages/internal/TriggersUpdate.rb
192
- - lib/mod_spox/messages/internal/SignaturesUpdate.rb
192
+ - lib/mod_spox/messages/internal/Shutdown.rb
193
+ - lib/mod_spox/Exceptions.rb
193
194
  - lib/mod_spox/Action.rb
194
195
  - lib/mod_spox/Logger.rb
195
196
  - lib/mod_spox/Timer.rb
196
- - lib/mod_spox/Exceptions.rb
197
- - lib/mod_spox/Bot.rb
198
197
  - lib/mod_spox/rfc2812.rb
198
+ - lib/mod_spox/Bot.rb
199
+ - lib/mod_spox/Monitors.rb
200
+ - lib/mod_spox/Pool.rb
199
201
  - lib/mod_spox/ConfigurationWizard.rb
200
202
  - lib/mod_spox/Socket.rb
201
203
  - lib/mod_spox/PluginManager.rb
@@ -205,20 +207,24 @@ files:
205
207
  - lib/mod_spox/Database.rb
206
208
  - lib/mod_spox/Pipeline.rb
207
209
  - lib/mod_spox/Loader.rb
208
- - lib/mod_spox/Pool.rb
209
- - lib/mod_spox/Monitors.rb
210
210
  - lib/mod_spox/BotConfig.rb
211
211
  - lib/mod_spox/MessageFactory.rb
212
212
  - bin/mod_spox
213
+ - data/mod_spox/plugins/Initializer.rb
213
214
  - data/mod_spox/plugins/Parter.rb
214
215
  - data/mod_spox/plugins/Quitter.rb
215
- - data/mod_spox/plugins/Initializer.rb
216
+ - data/mod_spox/plugins/Triggers.rb
217
+ - data/mod_spox/plugins/PluginLoader.rb
216
218
  - data/mod_spox/plugins/Joiner.rb
217
219
  - data/mod_spox/plugins/BotNick.rb
218
220
  - data/mod_spox/plugins/Authenticator.rb
219
221
  - data/mod_spox/plugins/Ponger.rb
220
- - data/mod_spox/plugins/PluginLoader.rb
221
- - data/mod_spox/extras/Tester.rb
222
+ - data/mod_spox/plugins/Banner.rb
223
+ - data/mod_spox/extras/Pinger.rb
224
+ - data/mod_spox/extras/Search.rb
225
+ - data/mod_spox/extras/Karma.rb
226
+ - data/mod_spox/extras/UrbanDictionary.rb
227
+ - data/mod_spox/extras/Roulette.rb
222
228
  test_files: []
223
229
 
224
230
  rdoc_options: []
@@ -1,14 +0,0 @@
1
- class Tester < Plugin
2
-
3
- def initialize(pipeline)
4
- super(pipeline)
5
- Models::Signature.find_or_create(:signature => 'tester', :plugin => name, :method => 'test',
6
- :description => 'List all available plugins')
7
- Models::Group.find_or_create(:name => 'testgroup')
8
- Models::Group.find_or_create(:name => 'anonymous')
9
- end
10
-
11
- def test(message, params)
12
- @pipeline << Messages::Outgoing::Privmsg.new(message.source.nick, 'This is a test')
13
- end
14
- end