cinch 2.0.0.pre.5 → 2.0.0.pre.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cinch/configuration/storage.rb +2 -8
- data/lib/cinch/irc.rb +2 -2
- data/lib/cinch/plugin.rb +4 -1
- data/lib/cinch/version.rb +1 -1
- metadata +2 -2
@@ -5,20 +5,14 @@ module Cinch
|
|
5
5
|
class Configuration
|
6
6
|
# @since 2.0.0
|
7
7
|
class Storage < Configuration
|
8
|
+
KnownOptions = [:backend]
|
9
|
+
|
8
10
|
def self.default_config
|
9
11
|
{
|
10
12
|
:backend => Cinch::Storage::Null
|
11
13
|
}
|
12
14
|
end
|
13
15
|
|
14
|
-
def [](key)
|
15
|
-
@table[key]
|
16
|
-
end
|
17
|
-
|
18
|
-
def []=(key, value)
|
19
|
-
modifiable[new_ostruct_member(key)] = value
|
20
|
-
end
|
21
|
-
|
22
16
|
def load(new_config, from_default)
|
23
17
|
_new_config = {}
|
24
18
|
new_config.each do |option, value|
|
data/lib/cinch/irc.rb
CHANGED
@@ -257,10 +257,10 @@ module Cinch
|
|
257
257
|
|
258
258
|
if msg.error?
|
259
259
|
events << [:error]
|
260
|
-
else
|
261
|
-
events << [msg.command.downcase.to_sym]
|
262
260
|
end
|
263
261
|
|
262
|
+
events << [msg.command.downcase.to_sym]
|
263
|
+
|
264
264
|
msg.events = events.map(&:first)
|
265
265
|
events.each do |event, *args|
|
266
266
|
@bot.handlers.dispatch(event, msg, *args)
|
data/lib/cinch/plugin.rb
CHANGED
@@ -178,6 +178,9 @@ module Cinch
|
|
178
178
|
# @todo document new options
|
179
179
|
def match(pattern, options = {})
|
180
180
|
options = {:use_prefix => true, :use_suffix => true, :method => :execute, :group => nil, :prefix => nil, :suffix => nil, :react_on => nil}.merge(options)
|
181
|
+
if options[:react_on]
|
182
|
+
options[:react_on] = options[:react_on].to_s.to_sym
|
183
|
+
end
|
181
184
|
matcher = Matcher.new(pattern, *options.values_at(:use_prefix, :use_suffix, :method, :group, :prefix, :suffix, :react_on))
|
182
185
|
@matchers << matcher
|
183
186
|
|
@@ -207,7 +210,7 @@ module Cinch
|
|
207
210
|
options.merge!(types.pop)
|
208
211
|
end
|
209
212
|
|
210
|
-
listeners = types.map {|type| Listener.new(type, options[:method])}
|
213
|
+
listeners = types.map {|type| Listener.new(type.to_s.to_sym, options[:method])}
|
211
214
|
@listeners.concat listeners
|
212
215
|
|
213
216
|
listeners
|
data/lib/cinch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.pre.
|
4
|
+
version: 2.0.0.pre.6
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A simple, friendly DSL for creating IRC bots
|
15
15
|
email:
|