cinch 2.3.0 → 2.3.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ac4a050d9a9f362b75b427a6895afee67abccef3
4
+ data.tar.gz: 5f8f25b58f27e9dc39a160f83e7a5eca8794731b
5
+ SHA512:
6
+ metadata.gz: aec921ef088056e3ccd741e29f6a0e8c89af617a54a8ea3fdc6757a301fe4c510ee296789714a797a1c02f5204336d1fbed6363081b7c7814ea54677500a25db
7
+ data.tar.gz: 8903f3821c3d2dc9de86bbbf42bce1f7d2186542dee826d7333c6fb024f1c926e66719743eedd279cc943a4d90bcac62b803eb1938c86b56719a29ec87be960d
@@ -27,64 +27,59 @@ module Cinch
27
27
 
28
28
  # (see Logger#log)
29
29
  def log(messages, event = :debug, level = event)
30
- do_log(messages, event, level)
30
+ messages = Array(messages).map {|m| filter(m, event)}.compact
31
+ each {|l| l.log(messages, event, level)}
31
32
  end
32
33
 
33
34
  # (see Logger#debug)
34
35
  def debug(message)
35
- do_log(message, :debug)
36
+ (m = filter(message, :debug)) && each {|l| l.debug(m)}
36
37
  end
37
38
 
38
39
  # (see Logger#error)
39
40
  def error(message)
40
- do_log(message, :error)
41
+ (m = filter(message, :error)) && each {|l| l.error(m)}
41
42
  end
42
43
 
43
44
  # (see Logger#error)
44
45
  def fatal(message)
45
- do_log(message, :fatal)
46
+ (m = filter(message, :fatal)) && each {|l| l.fatal(m)}
46
47
  end
47
48
 
48
49
  # (see Logger#info)
49
50
  def info(message)
50
- do_log(message, :info)
51
+ (m = filter(message, :info)) && each {|l| l.info(m)}
51
52
  end
52
53
 
53
54
  # (see Logger#warn)
54
55
  def warn(message)
55
- do_log(message, :warn)
56
+ (m = filter(message, :warn)) && each {|l| l.warn(m)}
56
57
  end
57
58
 
58
59
  # (see Logger#incoming)
59
60
  def incoming(message)
60
- do_log(message, :incoming, :log)
61
+ (m = filter(message, :incoming)) && each {|l| l.incoming(m)}
61
62
  end
62
63
 
63
64
  # (see Logger#outgoing)
64
65
  def outgoing(message)
65
- do_log(message, :outgoing, :log)
66
+ (m = filter(message, :outgoing)) && each {|l| l.outgoing(m)}
66
67
  end
67
68
 
68
69
  # (see Logger#exception)
69
70
  def exception(e)
70
- do_log(e, :exception, :error)
71
+ each {|l| l.exception(e)}
71
72
  end
72
73
 
73
74
  private
74
- def do_log(messages, event, level = event)
75
- messages = Array(messages)
76
- if event != :exception
77
- messages.map! { |m|
78
- @filters.each do |f|
79
- m = f.filter(m, event)
80
- if m.nil?
81
- break
82
- end
83
- end
84
- m
85
- }.compact
75
+ def filter(m, ev)
76
+ @filters.each do |f|
77
+ m = f.filter(m, ev)
78
+ if m.nil?
79
+ break
80
+ end
86
81
  end
87
- each {|l| l.log(messages, event, level)}
82
+ m
88
83
  end
89
84
  end
90
85
  end
@@ -310,7 +310,7 @@ module Cinch
310
310
  if hooks.is_a?(Hash)
311
311
  hooks = hooks.map { |k, v| v }
312
312
  end
313
- hooks.select! { |hook| (events & hook.for).size > 0 }
313
+ hooks = hooks.select { |hook| (events & hook.for).size > 0 }
314
314
  end
315
315
 
316
316
  return hooks.select { |hook| hook.group.nil? || hook.group == group }
@@ -1,4 +1,4 @@
1
1
  module Cinch
2
2
  # Version of the library
3
- VERSION = '2.3.0'
3
+ VERSION = '2.3.1'
4
4
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
5
- prerelease:
4
+ version: 2.3.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dominik Honnef
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-11-01 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A simple, friendly DSL for creating IRC bots
15
14
  email:
@@ -18,127 +17,126 @@ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
20
+ - ".yardopts"
21
21
  - LICENSE
22
22
  - README.md
23
- - .yardopts
24
- - docs/changes.md
25
- - docs/getting_started.md
26
- - docs/readme.md
27
23
  - docs/bot_options.md
24
+ - docs/changes.md
28
25
  - docs/common_mistakes.md
29
- - docs/events.md
30
- - docs/plugins.md
26
+ - docs/common_tasks.md
31
27
  - docs/encodings.md
28
+ - docs/events.md
29
+ - docs/getting_started.md
32
30
  - docs/logging.md
33
- - docs/common_tasks.md
34
31
  - docs/migrating.md
35
- - lib/cinch/formatting.rb
36
- - lib/cinch/channel.rb
37
- - lib/cinch/timer.rb
38
- - lib/cinch/log_filter.rb
39
- - lib/cinch/sasl/diffie_hellman.rb
40
- - lib/cinch/sasl/plain.rb
41
- - lib/cinch/sasl/dh_blowfish.rb
42
- - lib/cinch/sasl/mechanism.rb
43
- - lib/cinch/network.rb
44
- - lib/cinch/sasl.rb
45
- - lib/cinch/cached_list.rb
32
+ - docs/plugins.md
33
+ - docs/readme.md
34
+ - examples/basic/autovoice.rb
35
+ - examples/basic/google.rb
36
+ - examples/basic/hello.rb
37
+ - examples/basic/join_part.rb
38
+ - examples/basic/memo.rb
39
+ - examples/basic/msg.rb
40
+ - examples/basic/seen.rb
41
+ - examples/basic/urban_dict.rb
42
+ - examples/basic/url_shorten.rb
43
+ - examples/plugins/autovoice.rb
44
+ - examples/plugins/custom_prefix.rb
45
+ - examples/plugins/dice_roll.rb
46
+ - examples/plugins/google.rb
47
+ - examples/plugins/hello.rb
48
+ - examples/plugins/hooks.rb
49
+ - examples/plugins/join_part.rb
50
+ - examples/plugins/lambdas.rb
51
+ - examples/plugins/last_nick.rb
52
+ - examples/plugins/msg.rb
53
+ - examples/plugins/multiple_matches.rb
54
+ - examples/plugins/own_events.rb
55
+ - examples/plugins/seen.rb
56
+ - examples/plugins/timer.rb
57
+ - examples/plugins/url_shorten.rb
58
+ - lib/cinch.rb
59
+ - lib/cinch/ban.rb
46
60
  - lib/cinch/bot.rb
47
- - lib/cinch/isupport.rb
48
- - lib/cinch/helpers.rb
49
- - lib/cinch/handler.rb
50
- - lib/cinch/handler_list.rb
51
- - lib/cinch/rubyext/module.rb
52
- - lib/cinch/rubyext/float.rb
53
- - lib/cinch/rubyext/string.rb
54
- - lib/cinch/syncable.rb
55
- - lib/cinch/plugin_list.rb
56
- - lib/cinch/message.rb
57
- - lib/cinch/target.rb
58
- - lib/cinch/mask.rb
59
- - lib/cinch/configuration/sasl.rb
61
+ - lib/cinch/cached_list.rb
62
+ - lib/cinch/callback.rb
63
+ - lib/cinch/channel.rb
64
+ - lib/cinch/channel_list.rb
65
+ - lib/cinch/configuration.rb
60
66
  - lib/cinch/configuration/bot.rb
67
+ - lib/cinch/configuration/dcc.rb
61
68
  - lib/cinch/configuration/plugins.rb
69
+ - lib/cinch/configuration/sasl.rb
62
70
  - lib/cinch/configuration/ssl.rb
63
- - lib/cinch/configuration/dcc.rb
64
71
  - lib/cinch/configuration/timeouts.rb
65
- - lib/cinch/pattern.rb
66
- - lib/cinch/open_ended_queue.rb
67
- - lib/cinch/logger_list.rb
68
- - lib/cinch/callback.rb
69
- - lib/cinch/dcc.rb
70
- - lib/cinch/version.rb
71
- - lib/cinch/utilities/deprecation.rb
72
- - lib/cinch/utilities/kernel.rb
73
- - lib/cinch/utilities/encoding.rb
74
72
  - lib/cinch/constants.rb
75
- - lib/cinch/mode_parser.rb
76
- - lib/cinch/user.rb
77
- - lib/cinch/logger/formatted_logger.rb
78
- - lib/cinch/logger/zcbot_logger.rb
79
- - lib/cinch/exceptions.rb
80
- - lib/cinch/logger.rb
81
- - lib/cinch/plugin.rb
82
- - lib/cinch/user_list.rb
83
- - lib/cinch/dcc/incoming/send.rb
73
+ - lib/cinch/dcc.rb
84
74
  - lib/cinch/dcc/dccable_object.rb
85
- - lib/cinch/dcc/outgoing.rb
86
75
  - lib/cinch/dcc/incoming.rb
76
+ - lib/cinch/dcc/incoming/send.rb
77
+ - lib/cinch/dcc/outgoing.rb
87
78
  - lib/cinch/dcc/outgoing/send.rb
79
+ - lib/cinch/exceptions.rb
80
+ - lib/cinch/formatting.rb
81
+ - lib/cinch/handler.rb
82
+ - lib/cinch/handler_list.rb
83
+ - lib/cinch/helpers.rb
88
84
  - lib/cinch/irc.rb
89
- - lib/cinch/channel_list.rb
90
- - lib/cinch/ban.rb
85
+ - lib/cinch/isupport.rb
86
+ - lib/cinch/log_filter.rb
87
+ - lib/cinch/logger.rb
88
+ - lib/cinch/logger/formatted_logger.rb
89
+ - lib/cinch/logger/zcbot_logger.rb
90
+ - lib/cinch/logger_list.rb
91
+ - lib/cinch/mask.rb
92
+ - lib/cinch/message.rb
91
93
  - lib/cinch/message_queue.rb
92
- - lib/cinch/configuration.rb
93
- - lib/cinch.rb
94
- - examples/plugins/timer.rb
95
- - examples/plugins/msg.rb
96
- - examples/plugins/dice_roll.rb
97
- - examples/plugins/lambdas.rb
98
- - examples/plugins/join_part.rb
99
- - examples/plugins/google.rb
100
- - examples/plugins/autovoice.rb
101
- - examples/plugins/multiple_matches.rb
102
- - examples/plugins/url_shorten.rb
103
- - examples/plugins/own_events.rb
104
- - examples/plugins/seen.rb
105
- - examples/plugins/last_nick.rb
106
- - examples/plugins/hooks.rb
107
- - examples/plugins/hello.rb
108
- - examples/plugins/custom_prefix.rb
109
- - examples/basic/msg.rb
110
- - examples/basic/join_part.rb
111
- - examples/basic/google.rb
112
- - examples/basic/autovoice.rb
113
- - examples/basic/url_shorten.rb
114
- - examples/basic/memo.rb
115
- - examples/basic/seen.rb
116
- - examples/basic/urban_dict.rb
117
- - examples/basic/hello.rb
94
+ - lib/cinch/mode_parser.rb
95
+ - lib/cinch/network.rb
96
+ - lib/cinch/open_ended_queue.rb
97
+ - lib/cinch/pattern.rb
98
+ - lib/cinch/plugin.rb
99
+ - lib/cinch/plugin_list.rb
100
+ - lib/cinch/rubyext/float.rb
101
+ - lib/cinch/rubyext/module.rb
102
+ - lib/cinch/rubyext/string.rb
103
+ - lib/cinch/sasl.rb
104
+ - lib/cinch/sasl/dh_blowfish.rb
105
+ - lib/cinch/sasl/diffie_hellman.rb
106
+ - lib/cinch/sasl/mechanism.rb
107
+ - lib/cinch/sasl/plain.rb
108
+ - lib/cinch/syncable.rb
109
+ - lib/cinch/target.rb
110
+ - lib/cinch/timer.rb
111
+ - lib/cinch/user.rb
112
+ - lib/cinch/user_list.rb
113
+ - lib/cinch/utilities/deprecation.rb
114
+ - lib/cinch/utilities/encoding.rb
115
+ - lib/cinch/utilities/kernel.rb
116
+ - lib/cinch/version.rb
118
117
  homepage: http://cinchrb.org
119
118
  licenses:
120
119
  - MIT
120
+ metadata: {}
121
121
  post_install_message:
122
122
  rdoc_options: []
123
123
  require_paths:
124
124
  - lib
125
125
  required_ruby_version: !ruby/object:Gem::Requirement
126
- none: false
127
126
  requirements:
128
- - - ! '>='
127
+ - - ">="
129
128
  - !ruby/object:Gem::Version
130
129
  version: 1.9.1
131
130
  required_rubygems_version: !ruby/object:Gem::Requirement
132
- none: false
133
131
  requirements:
134
- - - ! '>='
132
+ - - ">="
135
133
  - !ruby/object:Gem::Version
136
134
  version: '0'
137
135
  requirements: []
138
136
  rubyforge_project:
139
- rubygems_version: 1.8.23.2
137
+ rubygems_version: 2.4.5.1
140
138
  signing_key:
141
- specification_version: 3
139
+ specification_version: 4
142
140
  summary: An IRC Bot Building Framework
143
141
  test_files: []
144
142
  has_rdoc: yard