mod_spox 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +16 -0
- data/INSTALL +4 -1
- data/bin/mod_spox +3 -1
- data/data/mod_spox/extras/AOLSpeak.rb +2 -2
- data/data/mod_spox/extras/AutoKick.rb +3 -8
- data/data/mod_spox/extras/AutoMode.rb +135 -0
- data/data/mod_spox/extras/EightBall.rb +1 -0
- data/data/mod_spox/extras/Headers.rb +4 -3
- data/data/mod_spox/extras/PhpFuncLookup.rb +14 -11
- data/data/mod_spox/extras/Roulette.rb +3 -3
- data/data/mod_spox/extras/Search.rb +3 -2
- data/data/mod_spox/extras/Talk.rb +1 -9
- data/data/mod_spox/extras/Translate.rb +3 -3
- data/data/mod_spox/extras/UrbanDictionary.rb +5 -3
- data/data/mod_spox/extras/Weather.rb +5 -4
- data/data/mod_spox/plugins/Authenticator.rb +2 -2
- data/data/mod_spox/plugins/Banner.rb +207 -2
- data/data/mod_spox/plugins/Helper.rb +1 -1
- data/data/mod_spox/plugins/PluginLoader.rb +22 -6
- data/data/mod_spox/plugins/Triggers.rb +6 -4
- data/lib/mod_spox/Action.rb +2 -0
- data/lib/mod_spox/BaseConfig.rb +2 -0
- data/lib/mod_spox/Bot.rb +32 -6
- data/lib/mod_spox/BotConfig.rb +3 -0
- data/lib/mod_spox/Cache.rb +57 -0
- data/lib/mod_spox/ConfigurationWizard.rb +6 -2
- data/lib/mod_spox/Helpers.rb +36 -18
- data/lib/mod_spox/Loader.rb +5 -54
- data/lib/mod_spox/Logger.rb +49 -3
- data/lib/mod_spox/MessageFactory.rb +5 -0
- data/lib/mod_spox/Monitors.rb +14 -12
- data/lib/mod_spox/Pipeline.rb +38 -6
- data/lib/mod_spox/Plugin.rb +3 -0
- data/lib/mod_spox/PluginHolder.rb +22 -0
- data/lib/mod_spox/PluginManager.rb +123 -25
- data/lib/mod_spox/Pool.rb +52 -23
- data/lib/mod_spox/Socket.rb +21 -10
- data/lib/mod_spox/Timer.rb +32 -6
- data/lib/mod_spox/handlers/BadNick.rb +2 -0
- data/lib/mod_spox/handlers/Bounce.rb +3 -0
- data/lib/mod_spox/handlers/Created.rb +2 -0
- data/lib/mod_spox/handlers/Handler.rb +5 -0
- data/lib/mod_spox/handlers/Invite.rb +2 -0
- data/lib/mod_spox/handlers/Join.rb +21 -5
- data/lib/mod_spox/handlers/Kick.rb +2 -0
- data/lib/mod_spox/handlers/LuserChannels.rb +2 -0
- data/lib/mod_spox/handlers/LuserClient.rb +1 -0
- data/lib/mod_spox/handlers/LuserMe.rb +1 -0
- data/lib/mod_spox/handlers/LuserOp.rb +2 -0
- data/lib/mod_spox/handlers/LuserUnknown.rb +2 -0
- data/lib/mod_spox/handlers/Mode.rb +2 -0
- data/lib/mod_spox/handlers/Motd.rb +5 -2
- data/lib/mod_spox/handlers/MyInfo.rb +2 -0
- data/lib/mod_spox/handlers/Names.rb +5 -1
- data/lib/mod_spox/handlers/Nick.rb +2 -0
- data/lib/mod_spox/handlers/NickInUse.rb +2 -0
- data/lib/mod_spox/handlers/Notice.rb +16 -4
- data/lib/mod_spox/handlers/Part.rb +2 -0
- data/lib/mod_spox/handlers/Ping.rb +2 -0
- data/lib/mod_spox/handlers/Pong.rb +2 -0
- data/lib/mod_spox/handlers/Privmsg.rb +16 -4
- data/lib/mod_spox/handlers/Quit.rb +2 -0
- data/lib/mod_spox/handlers/Topic.rb +2 -0
- data/lib/mod_spox/handlers/Welcome.rb +3 -0
- data/lib/mod_spox/handlers/Who.rb +3 -1
- data/lib/mod_spox/handlers/Whois.rb +8 -0
- data/lib/mod_spox/handlers/YourHost.rb +2 -0
- data/lib/mod_spox/messages/Messages.rb +6 -0
- data/lib/mod_spox/messages/incoming/BadNick.rb +1 -0
- data/lib/mod_spox/messages/incoming/Bounce.rb +1 -0
- data/lib/mod_spox/messages/incoming/Created.rb +1 -0
- data/lib/mod_spox/messages/incoming/Invite.rb +1 -0
- data/lib/mod_spox/messages/incoming/Join.rb +1 -0
- data/lib/mod_spox/messages/incoming/Kick.rb +1 -0
- data/lib/mod_spox/messages/incoming/LuserChannels.rb +1 -0
- data/lib/mod_spox/messages/incoming/LuserClient.rb +1 -0
- data/lib/mod_spox/messages/incoming/LuserMe.rb +1 -0
- data/lib/mod_spox/messages/incoming/LuserOp.rb +1 -0
- data/lib/mod_spox/messages/incoming/LuserUnknown.rb +1 -0
- data/lib/mod_spox/messages/incoming/Mode.rb +1 -0
- data/lib/mod_spox/messages/incoming/Motd.rb +1 -0
- data/lib/mod_spox/messages/incoming/MyInfo.rb +1 -0
- data/lib/mod_spox/messages/incoming/Names.rb +1 -0
- data/lib/mod_spox/messages/incoming/Nick.rb +1 -0
- data/lib/mod_spox/messages/incoming/NickInUse.rb +1 -0
- data/lib/mod_spox/messages/incoming/Notice.rb +1 -0
- data/lib/mod_spox/messages/incoming/Part.rb +1 -0
- data/lib/mod_spox/messages/incoming/Ping.rb +1 -0
- data/lib/mod_spox/messages/incoming/Pong.rb +1 -0
- data/lib/mod_spox/messages/incoming/Privmsg.rb +1 -0
- data/lib/mod_spox/messages/incoming/Quit.rb +1 -0
- data/lib/mod_spox/messages/incoming/Topic.rb +1 -0
- data/lib/mod_spox/messages/incoming/TopicInfo.rb +1 -0
- data/lib/mod_spox/messages/incoming/Welcome.rb +1 -0
- data/lib/mod_spox/messages/incoming/Who.rb +1 -0
- data/lib/mod_spox/messages/incoming/Whois.rb +1 -0
- data/lib/mod_spox/messages/incoming/YourHost.rb +1 -0
- data/lib/mod_spox/messages/internal/NickRequest.rb +1 -0
- data/lib/mod_spox/messages/internal/NickResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginLoadRequest.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginLoadResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginModuleRequest.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginModuleResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginReload.rb +10 -0
- data/lib/mod_spox/messages/internal/PluginRequest.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginUnloadRequest.rb +1 -0
- data/lib/mod_spox/messages/internal/PluginUnloadResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/StatusResponse.rb +1 -0
- data/lib/mod_spox/messages/internal/TimerAdd.rb +1 -0
- data/lib/mod_spox/messages/internal/TimerClear.rb +8 -0
- data/lib/mod_spox/messages/internal/TimerResponse.rb +1 -0
- data/lib/mod_spox/messages/outgoing/Away.rb +1 -0
- data/lib/mod_spox/messages/outgoing/Notice.rb +1 -0
- data/lib/mod_spox/messages/outgoing/Ping.rb +1 -0
- data/lib/mod_spox/messages/outgoing/Quit.rb +1 -0
- data/lib/mod_spox/messages/outgoing/Raw.rb +16 -0
- data/lib/mod_spox/models/Models.rb +4 -0
- data/lib/mod_spox/models/Nick.rb +9 -0
- data/lib/mod_spox/models/Setting.rb +3 -5
- data/lib/mod_spox/models/Signature.rb +2 -3
- metadata +8 -2
@@ -1,7 +1,17 @@
|
|
1
1
|
module ModSpox
|
2
2
|
module Messages
|
3
3
|
module Internal
|
4
|
+
# Sends message to reload plugin. If new and stale
|
5
|
+
# attributes are set, only that plugin will be reloaded
|
4
6
|
class PluginReload
|
7
|
+
# Path to new plugin to load
|
8
|
+
attr_reader :fresh
|
9
|
+
# Path to stale plugin to remove
|
10
|
+
attr_reader :stale
|
11
|
+
def initialize(fresh=nil, stale=nil)
|
12
|
+
@fresh = fresh
|
13
|
+
@stale = stale
|
14
|
+
end
|
5
15
|
end
|
6
16
|
end
|
7
17
|
end
|
@@ -2,6 +2,14 @@ module ModSpox
|
|
2
2
|
module Messages
|
3
3
|
module Internal
|
4
4
|
class TimerClear
|
5
|
+
attr_reader :plugin
|
6
|
+
def initialize(plugin=nil)
|
7
|
+
if(plugin.nil?)
|
8
|
+
@plugin = nil
|
9
|
+
else
|
10
|
+
@plugin = plugin.is_a?(ModSpox::Plugin) ? plugin.name.to_sym : plugin.to_sym
|
11
|
+
end
|
12
|
+
end
|
5
13
|
end
|
6
14
|
end
|
7
15
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module ModSpox
|
2
|
+
module Messages
|
3
|
+
module Outgoing
|
4
|
+
# Sends message to IRC server with no modification
|
5
|
+
class Raw
|
6
|
+
# message to send
|
7
|
+
attr_reader :message
|
8
|
+
# message:: message to send
|
9
|
+
# Creates new Raw message
|
10
|
+
def initialize(message)
|
11
|
+
@message = message
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/mod_spox/models/Nick.rb
CHANGED
@@ -120,6 +120,15 @@ module ModSpox
|
|
120
120
|
return false
|
121
121
|
end
|
122
122
|
|
123
|
+
# channel:: Models::Channel
|
124
|
+
# Return if nick is voiced in given channel
|
125
|
+
def is_voice?(channel)
|
126
|
+
NickMode.filter(:channel_id => channel.pk, :nick_id => pk).each do |mode|
|
127
|
+
return true if mode.mode == 'v'
|
128
|
+
end
|
129
|
+
return false
|
130
|
+
end
|
131
|
+
|
123
132
|
# Purge all nick information
|
124
133
|
def self.clean
|
125
134
|
Nick.set(:username => nil, :real_name => nil, :address => nil,
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'base64'
|
2
|
-
|
3
1
|
module ModSpox
|
4
2
|
module Models
|
5
3
|
# Attributes provided by model:
|
@@ -11,11 +9,11 @@ module ModSpox
|
|
11
9
|
class Setting < Sequel::Model(:settings)
|
12
10
|
|
13
11
|
def value=(val)
|
14
|
-
update_values(:value =>
|
12
|
+
update_values(:value => [Marshal.dump(val)].pack('m'))
|
15
13
|
end
|
16
14
|
|
17
15
|
def value
|
18
|
-
return values[:value] ? Marshal.load(
|
16
|
+
return values[:value] ? Marshal.load(values[:value].unpack('m')[0]) : nil
|
19
17
|
end
|
20
18
|
|
21
19
|
# key:: name of the setting
|
@@ -33,7 +31,7 @@ module ModSpox
|
|
33
31
|
def self.[]=(key, val)
|
34
32
|
key = key.to_s if key.is_a?(Symbol)
|
35
33
|
model = Setting.find_or_create(:name => key)
|
36
|
-
model.update_with_params(:value =>
|
34
|
+
model.update_with_params(:value => [Marshal.dump(val)].pack('m'))
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'base64'
|
2
1
|
module ModSpox
|
3
2
|
module Models
|
4
3
|
# Attributes provided by model:
|
@@ -19,11 +18,11 @@ module ModSpox
|
|
19
18
|
end
|
20
19
|
|
21
20
|
def signature=(sig)
|
22
|
-
update_values(:signature =>
|
21
|
+
update_values(:signature => [Marshal.dump(sig)].pack('m'))
|
23
22
|
end
|
24
23
|
|
25
24
|
def signature
|
26
|
-
return values[:signature] ? Marshal.load(
|
25
|
+
return values[:signature] ? Marshal.load(values[:signature].unpack('m')[0]) : nil
|
27
26
|
end
|
28
27
|
|
29
28
|
def group
|
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.
|
7
|
-
date: 2008-
|
6
|
+
version: 0.0.5
|
7
|
+
date: 2008-06-12 00:00:00 -07:00
|
8
8
|
summary: The mod_spox IRC robot
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- lib/mod_spox/models/Channel.rb
|
46
46
|
- lib/mod_spox/models/NickMode.rb
|
47
47
|
- lib/mod_spox/models/Group.rb
|
48
|
+
- lib/mod_spox/models/Models.rb
|
48
49
|
- lib/mod_spox/migration/001_create_channel_modes.rb
|
49
50
|
- lib/mod_spox/migration/001_create_nick_modes.rb
|
50
51
|
- lib/mod_spox/migration/001_create_nick_channels.rb
|
@@ -160,6 +161,7 @@ files:
|
|
160
161
|
- lib/mod_spox/messages/outgoing/ServList.rb
|
161
162
|
- lib/mod_spox/messages/outgoing/List.rb
|
162
163
|
- lib/mod_spox/messages/outgoing/UserHost.rb
|
164
|
+
- lib/mod_spox/messages/outgoing/Raw.rb
|
163
165
|
- lib/mod_spox/messages/internal/PluginModuleRequest.rb
|
164
166
|
- lib/mod_spox/messages/internal/PluginLoadResponse.rb
|
165
167
|
- lib/mod_spox/messages/internal/PluginResponse.rb
|
@@ -190,6 +192,7 @@ files:
|
|
190
192
|
- lib/mod_spox/messages/internal/BotInitialized.rb
|
191
193
|
- lib/mod_spox/messages/internal/PluginUnloadRequest.rb
|
192
194
|
- lib/mod_spox/messages/internal/Shutdown.rb
|
195
|
+
- lib/mod_spox/messages/Messages.rb
|
193
196
|
- lib/mod_spox/Exceptions.rb
|
194
197
|
- lib/mod_spox/Action.rb
|
195
198
|
- lib/mod_spox/Logger.rb
|
@@ -209,6 +212,8 @@ files:
|
|
209
212
|
- lib/mod_spox/Loader.rb
|
210
213
|
- lib/mod_spox/BotConfig.rb
|
211
214
|
- lib/mod_spox/MessageFactory.rb
|
215
|
+
- lib/mod_spox/PluginHolder.rb
|
216
|
+
- lib/mod_spox/Cache.rb
|
212
217
|
- bin/mod_spox
|
213
218
|
- data/mod_spox/plugins/Initializer.rb
|
214
219
|
- data/mod_spox/plugins/Parter.rb
|
@@ -243,6 +248,7 @@ files:
|
|
243
248
|
- data/mod_spox/extras/AOLSpeak.rb
|
244
249
|
- data/mod_spox/extras/Logger.rb
|
245
250
|
- data/mod_spox/extras/Topten.rb
|
251
|
+
- data/mod_spox/extras/AutoMode.rb
|
246
252
|
test_files: []
|
247
253
|
|
248
254
|
rdoc_options: []
|