ircinch 2.4.4 → 2.4.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +1 -1
  3. data/CHANGELOG.md +13 -0
  4. data/CODE_OF_CONDUCT.md +7 -81
  5. data/README.md +39 -30
  6. data/docs/bot_options.md +207 -314
  7. data/docs/changes.md +293 -282
  8. data/docs/common_mistakes.md +50 -41
  9. data/docs/common_tasks.md +63 -42
  10. data/docs/encodings.md +28 -55
  11. data/docs/events.md +123 -131
  12. data/docs/getting_started.md +97 -102
  13. data/docs/logging.md +62 -70
  14. data/docs/migrating.md +145 -131
  15. data/docs/plugins.md +109 -3
  16. data/docs/readme.md +17 -15
  17. data/examples/README.md +78 -0
  18. data/examples/basic/autovoice.rb +14 -18
  19. data/examples/basic/google.rb +9 -22
  20. data/examples/basic/hello.rb +4 -3
  21. data/examples/basic/join_part.rb +8 -23
  22. data/examples/basic/memo.rb +26 -24
  23. data/examples/basic/msg.rb +6 -6
  24. data/examples/basic/seen.rb +17 -24
  25. data/examples/basic/urban_dict.rb +6 -26
  26. data/examples/basic/url_shorten.rb +8 -26
  27. data/examples/plugins/autovoice.rb +17 -16
  28. data/examples/plugins/custom_prefix.rb +4 -3
  29. data/examples/plugins/dice_roll.rb +13 -20
  30. data/examples/plugins/google.rb +7 -21
  31. data/examples/plugins/hello.rb +4 -3
  32. data/examples/plugins/hooks.rb +5 -6
  33. data/examples/plugins/join_part.rb +8 -21
  34. data/examples/plugins/lambdas.rb +5 -6
  35. data/examples/plugins/last_nick.rb +7 -6
  36. data/examples/plugins/msg.rb +6 -6
  37. data/examples/plugins/multiple_matches.rb +10 -11
  38. data/examples/plugins/own_events.rb +14 -19
  39. data/examples/plugins/seen.rb +23 -23
  40. data/examples/plugins/timer.rb +5 -6
  41. data/examples/plugins/url_shorten.rb +15 -19
  42. data/examples/settings.rb +19 -0
  43. data/examples/tiny_url.rb +41 -0
  44. data/ircinch.gemspec +5 -6
  45. data/lib/cinch/bot.rb +2 -3
  46. data/lib/cinch/channel.rb +4 -4
  47. data/lib/cinch/irc.rb +2 -2
  48. data/lib/cinch/message_queue.rb +2 -2
  49. data/lib/cinch/plugin.rb +1 -1
  50. data/lib/cinch/version.rb +1 -1
  51. metadata +270 -249
  52. data/lib/cinch/rubyext/float.rb +0 -5
data/docs/changes.md CHANGED
@@ -1,9 +1,12 @@
1
- # @title What has changed?
2
- # @markup kramdown
1
+ # Historical Cinch Changelog
3
2
 
4
- # What has changed in 2.2?
3
+ These release notes describe the original Cinch 1.1–2.2 releases. See the
4
+ [IRCinch Changelog](../CHANGELOG.md) for later releases and the
5
+ [documentation index](readme.md) for current usage.
5
6
 
6
- ## Getting rid of CP1252 in favour of UTF-8
7
+ ## What has changed in 2.2?
8
+
9
+ ### Getting rid of CP1252 in favour of UTF-8
7
10
 
8
11
  In versions before 2.2, when using the `irc` encoding (the default),
9
12
  Cinch would use CP1252 for outgoing messages, only falling back to
@@ -17,39 +20,40 @@ than there are clients that can deal with this hybrid encoding, or
17
20
  CP1252 itself. That's why, from now on, we will always use UTF-8.
18
21
 
19
22
  If you depend on outgoing messages being encoded in CP1252, please see
20
- {file:docs/encodings.md} on how to change the encoding.
23
+ [Encodings](encodings.md) on how to change the encoding.
21
24
 
22
- ## API improvements
25
+ ### API improvements
23
26
 
24
- ### New methods
27
+ #### New methods
25
28
 
26
- - {Cinch::Channel#remove} has been added to support the non-standard
29
+ - [`Cinch::Channel#remove`](../lib/cinch/channel.rb) has been added to support the non-standard
27
30
  REMOVE command, a friendlier alternative to kicking people.
28
31
 
29
- - {Cinch::Helpers.sanitize} and {Cinch::Formatting.unformat} have been
32
+ - [`Cinch::Helpers.sanitize`](../lib/cinch/helpers.rb) and [`Cinch::Formatting.unformat`](../lib/cinch/formatting.rb) have been
30
33
  added to help with removing unprintable characters and mIRC
31
34
  formatting codes from strings.
32
35
 
33
- ### Deprecated methods
36
+ #### Deprecated methods
34
37
 
35
38
  In order to reduce the amount of aliases, the following ones have been
36
39
  deprecated and will be removed in a future release:
37
40
 
38
- - {Cinch::Channel#msg}
39
- - {Cinch::Channel#privmsg}
40
- - {Cinch::Target#msg}
41
- - {Cinch::Target#privmsg}
42
- - {Cinch::Target#safe_msg}
43
- - {Cinch::Target#safe_privmsg}
44
- - {Cinch::User#whois}
45
- - {Cinch::Helpers#Color}
41
+ - [`Cinch::Channel#msg`](../lib/cinch/channel.rb)
42
+ - [`Cinch::Channel#privmsg`](../lib/cinch/channel.rb)
43
+ - [`Cinch::Target#msg`](../lib/cinch/target.rb)
44
+ - [`Cinch::Target#privmsg`](../lib/cinch/target.rb)
45
+ - [`Cinch::Target#safe_msg`](../lib/cinch/target.rb)
46
+ - [`Cinch::Target#safe_privmsg`](../lib/cinch/target.rb)
47
+ - [`Cinch::User#whois`](../lib/cinch/user.rb)
48
+ - [`Cinch::Helpers#Color`](../lib/cinch/helpers.rb)
46
49
 
47
50
  Additionally, the following method is deprecated and will be removed
48
51
  in the future:
49
52
 
50
- - {Cinch::Channel#to_str}
53
+ - [`Cinch::Channel#to_str`](../lib/cinch/channel.rb)
54
+
55
+ ## What has changed in 2.1?
51
56
 
52
- # What has changed in 2.1?
53
57
  1. Color stripping
54
58
  1. Per group hooks
55
59
  1. API improvements
@@ -57,61 +61,60 @@ in the future:
57
61
  1. Changed methods
58
62
  1. New aliases
59
63
 
60
- ## Color stripping
64
+ ### Color stripping
61
65
 
62
- The new method <del>`Cinch::Utilities::String.strip_colors`</del>
63
- {Cinch::Formatting.unformat} allows removal of mIRC color codes from
64
- messages.
66
+ [`Cinch::Formatting.unformat`](../lib/cinch/formatting.rb) removes mIRC color
67
+ codes from messages. It replaces `Cinch::Utilities::String.strip_colors`.
65
68
 
66
69
  Additionally, a new match option called `strip_colors` makes it
67
70
  possible to automatically and temporarily strip color codes before
68
71
  attempting to match a message.
69
72
 
70
- ## Per group hooks
73
+ ### Per group hooks
71
74
 
72
75
  A new option `group` for hooks allows registering hooks for specific
73
76
  groups.
74
77
 
75
- ## API improvements
78
+ ### API improvements
76
79
 
77
- ### New methods
80
+ #### New methods
78
81
 
79
- #### {Cinch::Bot}
82
+ ##### [`Cinch::Bot`](../lib/cinch/bot.rb)
80
83
 
81
- - {Cinch::Bot#oper}
84
+ - [`Cinch::Bot#oper`](../lib/cinch/bot.rb)
82
85
 
83
- #### {Cinch::User}
86
+ ##### [`Cinch::User`](../lib/cinch/user.rb)
84
87
 
85
- - {Cinch::User#oper?}
88
+ - [`Cinch::User#oper?`](../lib/cinch/user.rb)
86
89
 
87
- #### {Cinch::Message}
90
+ ##### [`Cinch::Message`](../lib/cinch/message.rb)
88
91
 
89
- - {Cinch::Message#action_reply}
90
- - {Cinch::Message#safe_action_reply}
92
+ - [`Cinch::Message#action_reply`](../lib/cinch/message.rb)
93
+ - [`Cinch::Message#safe_action_reply`](../lib/cinch/message.rb)
91
94
 
92
- ### Changed methods
95
+ #### Changed methods
93
96
 
94
- #### {Cinch::Handler}
97
+ ##### [`Cinch::Handler`](../lib/cinch/handler.rb)
95
98
 
96
- - {Cinch::Handler#call} now returns the started thread.
99
+ - [`Cinch::Handler#call`](../lib/cinch/handler.rb) now returns the started thread.
97
100
 
98
- #### {Cinch::HandlerList}
101
+ ##### [`Cinch::HandlerList`](../lib/cinch/handler_list.rb)
99
102
 
100
- - {Cinch::HandlerList#dispatch} now returns the started threads.
103
+ - [`Cinch::HandlerList#dispatch`](../lib/cinch/handler_list.rb) now returns the started threads.
101
104
 
102
- ### New aliases
105
+ #### New aliases
103
106
 
104
107
  Due to some unfortunate naming mistakes in Cinch 2.0, Cinch 2.1 adds
105
108
  several aliases. All of the new aliases deprecate the original method
106
109
  names, which will be removed in Cinch 3.0.
107
110
 
108
- #### {Cinch::User}
109
- - {Cinch::User#monitored?} for {Cinch::User#monitored}
110
- - {Cinch::User#synced?} for {Cinch::User#synced}
111
+ ##### [`Cinch::User`](../lib/cinch/user.rb)
111
112
 
113
+ - [`Cinch::User#monitored?`](../lib/cinch/user.rb) for [`Cinch::User#monitored`](../lib/cinch/user.rb)
114
+ - [`Cinch::User#synced?`](../lib/cinch/user.rb) for [`Cinch::User#synced`](../lib/cinch/user.rb)
112
115
 
116
+ ## What has changed in 2.0?
113
117
 
114
- # What has changed in 2.0?
115
118
  1. Added support for SASL
116
119
  1. Added support for DCC SEND
117
120
  1. Added a fair scheduler for outgoing messages
@@ -126,7 +129,7 @@ names, which will be removed in Cinch 3.0.
126
129
  1. Reworked logging facilities
127
130
  1. API improvements
128
131
  1. Helper changes
129
- 1. Added a Cinch::Target Target class
132
+ 1. Added a `Cinch::Target` class
130
133
  1. Cinch::Constants
131
134
  1. New methods
132
135
  1. Removed/Renamed methods
@@ -136,17 +139,18 @@ names, which will be removed in Cinch 3.0.
136
139
  1. Renamed `*Manager` to `*List`
137
140
  1. New events
138
141
 
139
- ## Added support for SASL
142
+ ### Added support for SASL
140
143
 
141
144
  Cinch now supports authenticating to services via SASL. For more
142
- information check {Cinch::SASL}.
145
+ information check [`Cinch::SASL`](../lib/cinch/sasl.rb).
143
146
 
144
- ## Added support for DCC SEND
147
+ ### Added support for DCC SEND
145
148
 
146
149
  Support for sending and receiving files via DCC has been added to
147
- Cinch. Check {Cinch::DCC} for more information.
150
+ Cinch. Check [`Cinch::DCC`](../lib/cinch/dcc.rb) for more information.
151
+
152
+ ### Added a fair scheduler for outgoing messages
148
153
 
149
- ## Added a fair scheduler for outgoing messages
150
154
  Cinch always provided sophisticated throttling to avoid getting kicked
151
155
  due to _excess flood_. One major flaw, however, was that it used a
152
156
  single FIFO for all messages, thus preferring early message targets
@@ -155,7 +159,7 @@ and penalizing later ones.
155
159
  Now Cinch uses a round-robin approach, having one queue per message
156
160
  target (channels and users) and one for generic commands.
157
161
 
158
- ## Added required plugin options
162
+ ### Added required plugin options
159
163
 
160
164
  Plugins can now require specific options to be set. If any of those
161
165
  options are not set, the plugin will automatically refuse being
@@ -165,49 +169,50 @@ This is useful for example for plugins that require API keys to
165
169
  interact with web services.
166
170
 
167
171
  The new attribute is called
168
- {Cinch::Plugin::ClassMethods#required_options required_options}.
172
+ [`required_options`](../lib/cinch/plugin.rb).
169
173
 
170
174
  Example:
171
175
 
172
- class MyPlugin
173
- include Cinch::Plugin
176
+ ```ruby
177
+ class MyPlugin
178
+ include Cinch::Plugin
174
179
 
175
- set :required_options, [:foo, :bar]
176
- # ...
177
- end
180
+ set :required_options, [:foo, :bar]
181
+ # ...
182
+ end
178
183
 
179
- # ...
184
+ # ...
180
185
 
181
- bot.configure do |c|
182
- c.plugins.plugins = [MyPlugin]
183
- c.plugins.options[MyPlugin] = {:foo => 1}
184
- end
186
+ bot.configure do |c|
187
+ c.plugins.plugins = [MyPlugin]
188
+ c.plugins.options[MyPlugin] = {:foo => 1}
189
+ end
185
190
 
186
- # The plugin won't load because the option :bar is not set.
187
- # Instead it will print a warning.
191
+ # The plugin won't load because the option :bar is not set.
192
+ # Instead it will print a warning.
193
+ ```
188
194
 
189
- ## Added support for colors/formatting
195
+ ### Added support for colors/formatting
190
196
 
191
- A new {Cinch::Formatting module} and {Cinch::Helpers#Format helper}
197
+ A new [module](../lib/cinch/formatting.rb) and [`helper`](../lib/cinch/helpers.rb)
192
198
  for adding colors and formatting to messages has been added. See the
193
- {Cinch::Formatting module's documentation} for more information on
199
+ [module's documentation](../lib/cinch/formatting.rb) for more information on
194
200
  usage.
195
201
 
196
- ## Added support for network discovery
202
+ ### Added support for network discovery
197
203
 
198
204
  Cinch now tries to detect the network it connects to, including the
199
205
  running IRCd. For most parts this is only interesting internally, but
200
206
  if you're writing advanced plugins that hook directly into IRC and
201
207
  needs to be aware of available features/quirks, check out
202
- {Cinch::IRC#network} and {Cinch::Network}.
208
+ [`Cinch::IRC#network`](../lib/cinch/irc.rb) and [`Cinch::Network`](../lib/cinch/network.rb).
203
209
 
204
- ## Reworked logging facilities
210
+ ### Reworked logging facilities
205
211
 
206
212
  The logging API has been drastically improved. Check the
207
- {file:docs/logging.md logging documentation} for more information.
208
-
213
+ [logging documentation](logging.md) for more information.
209
214
 
210
- ## Added match groups
215
+ ### Added match groups
211
216
 
212
217
  A new option for matchers, `:group`, allows grouping multiple matchers
213
218
  to a group. What's special is that in any group, only the first
@@ -215,177 +220,178 @@ matching handler will be executed.
215
220
 
216
221
  Example:
217
222
 
218
- class Foo
219
- include Cinch::Plugin
220
-
221
- match /foo (\d+)/, group: :blegh, method: :foo1
222
- match /foo (.+)/, group: :blegh, method: :foo2
223
- match /foo .+/, method: :foo3
224
- def foo1(m, arg)
225
- m.reply "foo1"
226
- end
223
+ ```ruby
224
+ class Foo
225
+ include Cinch::Plugin
227
226
 
228
- def foo2(m, arg)
229
- m.reply "foo2"
230
- end
227
+ match /foo (\d+)/, group: :blegh, method: :foo1
228
+ match /foo (.+)/, group: :blegh, method: :foo2
229
+ match /foo .+/, method: :foo3
230
+ def foo1(m, arg)
231
+ m.reply "foo1"
232
+ end
231
233
 
232
- def foo3(m)
233
- m.reply "foo3"
234
- end
235
- end
236
- # 02:05:39 dominikh │ !foo 123
237
- # 02:05:40 cinch │ foo1
238
- # 02:05:40 cinch │ foo3
234
+ def foo2(m, arg)
235
+ m.reply "foo2"
236
+ end
239
237
 
240
- # 02:05:43 dominikh │ !foo bar
241
- # 02:05:44 cinch │ foo2
242
- # 02:05:44 cinch │ foo3
238
+ def foo3(m)
239
+ m.reply "foo3"
240
+ end
241
+ end
242
+ # 02:05:39 dominikh │ !foo 123
243
+ # 02:05:40 cinch │ foo1
244
+ # 02:05:40 cinch │ foo3
243
245
 
246
+ # 02:05:43 dominikh │ !foo bar
247
+ # 02:05:44 cinch │ foo2
248
+ # 02:05:44 cinch │ foo3
249
+ ```
244
250
 
245
- ## Added match options overwriting plugin options
251
+ ### Added match options overwriting plugin options
246
252
 
247
253
  Matchers now have their own `:prefix`, `:suffix` and `:react_on`
248
254
  options which overwrite plugin options for single matchers.
249
255
 
250
-
251
- ## Added support for actions (/me)
256
+ ### Added support for actions (/me)
252
257
 
253
258
  A new event, {`:action`} has been added and can be used for matching
254
259
  actions as follows:
255
260
 
256
- match "kicks the bot", react_on: :action
257
- def execute(m)
258
- m.reply "Ouch!"
259
- end
261
+ ```ruby
262
+ match "kicks the bot", react_on: :action
263
+ def execute(m)
264
+ m.reply "Ouch!"
265
+ end
266
+ ```
260
267
 
261
- ## API improvements
268
+ ### API improvements
262
269
 
263
- ### Helper changes
270
+ #### Helper changes
264
271
 
265
- The helper methods {Cinch::Helpers#User User()} and
266
- {Cinch::Helpers#Channel Channel()} have been extracted from
267
- {Cinch::Bot} and moved to {Cinch::Helpers their own module} which can
272
+ The helper methods [`User()`](../lib/cinch/helpers.rb) and
273
+ [`Channel()`](../lib/cinch/helpers.rb) have been extracted from
274
+ [`Cinch::Bot`](../lib/cinch/bot.rb) and moved to [their own module](../lib/cinch/helpers.rb) which can
268
275
  be reused in various places.
269
276
 
270
- ### Added a {Cinch::Target Target} class
277
+ #### Added a [Target](../lib/cinch/target.rb) class
271
278
 
272
- Since {Cinch::Channel} and {Cinch::User} share one common interface
279
+ Since [`Cinch::Channel`](../lib/cinch/channel.rb) and [`Cinch::User`](../lib/cinch/user.rb) share one common interface
273
280
  for sending messages, it only makes sense to have a common base class.
274
- {Cinch::Target This new class} takes care of sending messages and
275
- removes this responsibility from {Cinch::Channel}, {Cinch::User} and
276
- {Cinch::Bot}
281
+ [This new class](../lib/cinch/target.rb) takes care of sending messages and
282
+ removes this responsibility from [`Cinch::Channel`](../lib/cinch/channel.rb), [`Cinch::User`](../lib/cinch/user.rb) and
283
+ [`Cinch::Bot`](../lib/cinch/bot.rb)
277
284
 
278
- ### {Cinch::Constants}
285
+ #### [`Cinch::Constants`](../lib/cinch/constants.rb)
279
286
 
280
287
  All constants for IRC numeric replies (`RPL_*` and `ERR_*`) have been
281
- moved from {Cinch} to {Cinch::Constants}
288
+ moved from [`Cinch`](../lib/cinch/ban.rb) to [`Cinch::Constants`](../lib/cinch/constants.rb)
282
289
 
283
- ### New methods
290
+ #### New methods
284
291
 
285
- #### {Cinch::Bot}
292
+ ##### [`Cinch::Bot`](../lib/cinch/bot.rb)
286
293
 
287
- - {Cinch::Bot#channel_list}
288
- - {Cinch::Bot#handlers}
289
- - {Cinch::Bot#loggers}
290
- - {Cinch::Bot#loggers=}
291
- - {Cinch::Bot#modes}
292
- - {Cinch::Bot#modes=}
293
- - {Cinch::Bot#set_mode}
294
- - {Cinch::Bot#unset_mode}
295
- - {Cinch::Bot#user_list}
294
+ - [`Cinch::Bot#channel_list`](../lib/cinch/bot.rb)
295
+ - [`Cinch::Bot#handlers`](../lib/cinch/bot.rb)
296
+ - [`Cinch::Bot#loggers`](../lib/cinch/bot.rb)
297
+ - [`Cinch::Bot#loggers=`](../lib/cinch/bot.rb)
298
+ - [`Cinch::Bot#modes`](../lib/cinch/bot.rb)
299
+ - [`Cinch::Bot#modes=`](../lib/cinch/bot.rb)
300
+ - [`Cinch::Bot#set_mode`](../lib/cinch/bot.rb)
301
+ - [`Cinch::Bot#unset_mode`](../lib/cinch/bot.rb)
302
+ - [`Cinch::Bot#user_list`](../lib/cinch/bot.rb)
296
303
 
297
- #### {Cinch::Channel}
304
+ ##### [`Cinch::Channel`](../lib/cinch/channel.rb)
298
305
 
299
- - {Cinch::Channel#admins}
300
- - {Cinch::Channel#half_ops}
301
- - {Cinch::Channel#ops}
302
- - {Cinch::Channel#owners}
303
- - {Cinch::Channel#voiced}
306
+ - [`Cinch::Channel#admins`](../lib/cinch/channel.rb)
307
+ - [`Cinch::Channel#half_ops`](../lib/cinch/channel.rb)
308
+ - [`Cinch::Channel#ops`](../lib/cinch/channel.rb)
309
+ - [`Cinch::Channel#owners`](../lib/cinch/channel.rb)
310
+ - [`Cinch::Channel#voiced`](../lib/cinch/channel.rb)
304
311
 
305
- #### {Cinch::Helpers}
312
+ ##### [`Cinch::Helpers`](../lib/cinch/helpers.rb)
306
313
 
307
- - {Cinch::Helpers#Target} -- For creating a {Cinch::Target Target} which can receive messages
308
- - {Cinch::Helpers#Timer} -- For creating new timers anywhere
309
- - {Cinch::Helpers#rescue_exception} -- For rescueing and automatically logging an exception
310
- - {Cinch::Helpers#Format} -- For adding colors and formatting to messages
314
+ - [`Cinch::Helpers#Target`](../lib/cinch/helpers.rb) -- For creating a [Target](../lib/cinch/target.rb) which can receive messages
315
+ - [`Cinch::Helpers#Timer`](../lib/cinch/helpers.rb) -- For creating new timers anywhere
316
+ - [`Cinch::Helpers#rescue_exception`](../lib/cinch/helpers.rb) -- For rescueing and automatically logging an exception
317
+ - [`Cinch::Helpers#Format`](../lib/cinch/helpers.rb) -- For adding colors and formatting to messages
311
318
 
312
- ##### Logging shortcuts
313
- - {Cinch::Helpers#debug}
314
- - {Cinch::Helpers#error}
315
- - {Cinch::Helpers#exception}
316
- - {Cinch::Helpers#fatal}
317
- - {Cinch::Helpers#incoming}
318
- - {Cinch::Helpers#info}
319
- - {Cinch::Helpers#log}
320
- - {Cinch::Helpers#outgoing}
321
- - {Cinch::Helpers#warn}
319
+ ###### Logging shortcuts
322
320
 
323
- #### {Cinch::IRC}
321
+ - [`Cinch::Helpers#debug`](../lib/cinch/helpers.rb)
322
+ - [`Cinch::Helpers#error`](../lib/cinch/helpers.rb)
323
+ - [`Cinch::Helpers#exception`](../lib/cinch/helpers.rb)
324
+ - [`Cinch::Helpers#fatal`](../lib/cinch/helpers.rb)
325
+ - [`Cinch::Helpers#incoming`](../lib/cinch/helpers.rb)
326
+ - [`Cinch::Helpers#info`](../lib/cinch/helpers.rb)
327
+ - [`Cinch::Helpers#log`](../lib/cinch/helpers.rb)
328
+ - [`Cinch::Helpers#outgoing`](../lib/cinch/helpers.rb)
329
+ - [`Cinch::Helpers#warn`](../lib/cinch/helpers.rb)
324
330
 
325
- - {Cinch::IRC#network}
331
+ ##### [`Cinch::IRC`](../lib/cinch/irc.rb)
326
332
 
327
- #### {Cinch::Message}
333
+ - [`Cinch::IRC#network`](../lib/cinch/irc.rb)
328
334
 
329
- - {Cinch::Message#action?}
330
- - {Cinch::Message#action_message}
331
- - {Cinch::Message#target}
332
- - {Cinch::Message#time}
335
+ ##### [`Cinch::Message`](../lib/cinch/message.rb)
333
336
 
334
- #### {Cinch::Plugin}
337
+ - [`Cinch::Message#action?`](../lib/cinch/message.rb)
338
+ - [`Cinch::Message#action_message`](../lib/cinch/message.rb)
339
+ - [`Cinch::Message#target`](../lib/cinch/message.rb)
340
+ - [`Cinch::Message#time`](../lib/cinch/message.rb)
335
341
 
336
- - {Cinch::Plugin#handlers}
337
- - {Cinch::Plugin#timers}
338
- - {Cinch::Plugin#unregister}
342
+ ##### [`Cinch::Plugin`](../lib/cinch/plugin.rb)
339
343
 
340
- #### {Cinch::User}
344
+ - [`Cinch::Plugin#handlers`](../lib/cinch/plugin.rb)
345
+ - [`Cinch::Plugin#timers`](../lib/cinch/plugin.rb)
346
+ - [`Cinch::Plugin#unregister`](../lib/cinch/plugin.rb)
341
347
 
342
- - {Cinch::User#away}
343
- - {Cinch::User#dcc_send} - See {Cinch::DCC::Outgoing::Send}
344
- - {Cinch::User#match}
345
- - {Cinch::User#monitor} - See {file:docs/common_tasks.md#checking-if-a-user-is-online Checking if a user is online}
346
- - {Cinch::User#monitored}
347
- - {Cinch::User#online?}
348
- - {Cinch::User#unmonitor}
348
+ ##### [`Cinch::User`](../lib/cinch/user.rb)
349
349
 
350
- ### Handlers
350
+ - [`Cinch::User#away`](../lib/cinch/user.rb)
351
+ - [`Cinch::User#dcc_send`](../lib/cinch/user.rb) - See [`Cinch::DCC::Outgoing::Send`](../lib/cinch/dcc/outgoing/send.rb)
352
+ - [`Cinch::User#match`](../lib/cinch/user.rb)
353
+ - [`Cinch::User#monitor`](../lib/cinch/user.rb) - See [Checking if a user is online](common_tasks.md#checking-if-a-user-is-online)
354
+ - [`Cinch::User#monitored`](../lib/cinch/user.rb)
355
+ - [`Cinch::User#online?`](../lib/cinch/user.rb)
356
+ - [`Cinch::User#unmonitor`](../lib/cinch/user.rb)
351
357
 
352
- Internally, Cinch uses {Cinch::Handler Handlers} for listening to and
358
+ #### Handlers
359
+
360
+ Internally, Cinch uses [Handlers](../lib/cinch/handler.rb) for listening to and
353
361
  matching events. In previous versions, this was hidden from the user,
354
362
  but now they're part of the public API, providing valuable information
355
- and the chance to {Cinch::Handler#unregister unregister handlers}
363
+ and the chance to [unregister handlers](../lib/cinch/handler.rb)
356
364
  alltogether.
357
365
 
358
- {Cinch::Bot#on} now returns the created handler and
359
- {Cinch::Plugin#handlers} allows getting a plugin's registered
366
+ [`Cinch::Bot#on`](../lib/cinch/bot.rb) now returns the created handler and
367
+ [`Cinch::Plugin#handlers`](../lib/cinch/plugin.rb) allows getting a plugin's registered
360
368
  handlers.
361
369
 
362
- ### Removed/Renamed methods
370
+ #### Removed/Renamed methods
371
+
363
372
  The following methods have been removed:
364
373
 
365
- | Removed method | Replacement |
366
- |----------------------------------------+---------------------------------------------------------------------------------|
367
- | Cinch::Bot#halt | `next` or `break` (Ruby keywords) |
368
- | Cinch::Bot#raw | {Cinch::IRC#send} |
369
- | Cinch::Bot#msg | {Cinch::Target#msg} |
370
- | Cinch::Bot#notice | {Cinch::Target#notice} |
371
- | Cinch::Bot#safe_msg | {Cinch::Target#safe_msg} |
372
- | Cinch::Bot#safe_notice | {Cinch::Target#safe_notice} |
373
- | Cinch::Bot#action | {Cinch::Target#action} |
374
- | Cinch::Bot#safe_action | {Cinch::Target#safe_action} |
375
- | Cinch::Bot#dispatch | {Cinch::HandlerList#dispatch} |
376
- | Cinch::Bot#register_plugins | {Cinch::PluginList#register_plugins} |
377
- | Cinch::Bot#register_plugin | {Cinch::PluginList#register_plugin} |
378
- | Cinch::Bot#logger | {Cinch::Bot#loggers} |
379
- | Cinch::Bot#logger= | |
380
- | Cinch::Bot#debug | {Cinch::LoggerList#debug} |
381
- | Cinch::IRC#message | {Cinch::IRC#send} |
382
- | Cinch::Logger::Logger#log_exception | {Cinch::Logger#exception} |
383
- | Class methods in Plugin to set options | A new {Cinch::Plugin::ClassMethods#set set} method as well as attribute setters |
384
-
385
-
386
- ### The Plugin class
387
-
388
- The {Cinch::Plugin Plugin} class has been drastically improved to look
374
+ - `Cinch::Bot#halt` → `next` or `break` (Ruby keywords)
375
+ - `Cinch::Bot#raw` → [`Cinch::IRC#send`](../lib/cinch/irc.rb)
376
+ - `Cinch::Bot#msg` → [`Cinch::Target#msg`](../lib/cinch/target.rb)
377
+ - `Cinch::Bot#notice` → [`Cinch::Target#notice`](../lib/cinch/target.rb)
378
+ - `Cinch::Bot#safe_msg` → [`Cinch::Target#safe_msg`](../lib/cinch/target.rb)
379
+ - `Cinch::Bot#safe_notice` → [`Cinch::Target#safe_notice`](../lib/cinch/target.rb)
380
+ - `Cinch::Bot#action` → [`Cinch::Target#action`](../lib/cinch/target.rb)
381
+ - `Cinch::Bot#safe_action` → [`Cinch::Target#safe_action`](../lib/cinch/target.rb)
382
+ - `Cinch::Bot#dispatch` → [`Cinch::HandlerList#dispatch`](../lib/cinch/handler_list.rb)
383
+ - `Cinch::Bot#register_plugins` → [`Cinch::PluginList#register_plugins`](../lib/cinch/plugin_list.rb)
384
+ - `Cinch::Bot#register_plugin` → [`Cinch::PluginList#register_plugin`](../lib/cinch/plugin_list.rb)
385
+ - `Cinch::Bot#logger` → [`Cinch::Bot#loggers`](../lib/cinch/bot.rb)
386
+ - `Cinch::Bot#logger=` was removed.
387
+ - `Cinch::Bot#debug` → [`Cinch::LoggerList#debug`](../lib/cinch/logger_list.rb)
388
+ - `Cinch::IRC#message` → [`Cinch::IRC#send`](../lib/cinch/irc.rb)
389
+ - `Cinch::Logger::Logger#log_exception` → [`Cinch::Logger#exception`](../lib/cinch/logger.rb)
390
+ - Class methods in Plugin to set options → A new [`set`](../lib/cinch/plugin.rb) method as well as attribute setters
391
+
392
+ #### The Plugin class
393
+
394
+ The [Plugin](../lib/cinch/plugin.rb) class has been drastically improved to look
389
395
  and behave more like a proper Ruby class instead of being some
390
396
  abstract black box.
391
397
 
@@ -395,147 +401,152 @@ possible to access a Plugin instance's registered handlers and timers,
395
401
  as well as unregister plugins.
396
402
 
397
403
  For a complete overview of available attributes and methods, see
398
- {Cinch::Plugin} and {Cinch::Plugin::ClassMethods}.
404
+ [`Cinch::Plugin`](../lib/cinch/plugin.rb) and [`Cinch::Plugin::ClassMethods`](../lib/cinch/plugin.rb).
399
405
 
400
- ### Plugin options
406
+ #### Plugin options
401
407
 
402
408
  The aforementioned changes also affect the way plugin options are
403
409
  being set: Plugin options aren't set with DSL-like methods anymore but
404
- instead are made available via {Cinch::Plugin::ClassMethods#set a
405
- `set` method} or alternatively plain attribute setters.
410
+ instead are made available via [a `set` method](../lib/cinch/plugin.rb) or alternatively plain attribute setters.
406
411
 
407
412
  See
408
- {file:docs/migrating.md#plugin-options the migration guide} for more
413
+ [the migration guide](migrating.md#plugin-options) for more
409
414
  information.
410
415
 
411
- ### Channel/Target/User implement Comparable
416
+ #### Channel/Target/User implement Comparable
412
417
 
413
- {Cinch::Target} and thus {Cinch::Channel} and {Cinch::User} now
418
+ [`Cinch::Target`](../lib/cinch/target.rb) and thus [`Cinch::Channel`](../lib/cinch/channel.rb) and [`Cinch::User`](../lib/cinch/user.rb) now
414
419
  implement the Comparable interface, which makes them sortable by all
415
420
  usual Ruby means.
416
421
 
417
- ### Renamed `*Manager` to `*List`
422
+ #### Renamed `*Manager` to `*List`
418
423
 
419
424
  `Cinch::ChannelManager` and `Cinch::UserManager` have been renamed to
420
- {Cinch::ChannelList} and {Cinch::UserList} respectively.
425
+ [`Cinch::ChannelList`](../lib/cinch/channel_list.rb) and [`Cinch::UserList`](../lib/cinch/user_list.rb) respectively.
426
+
427
+ ### Added support for broken IRC networks
421
428
 
422
- ## Added support for broken IRC networks
423
429
  Special support for the following flawed IRC networks has been added:
424
430
 
425
431
  - JustinTV
426
432
  - NGameTV
427
433
  - IRCnet
428
434
 
429
- ## Dynamic timers
435
+ ### Dynamic timers
430
436
 
431
437
  It is now possible to create new timers from any method/handler. It is
432
- also possible to {Cinch::Timer#stop stop existing timers} or
433
- {Cinch::Timer#start restart them}.
438
+ also possible to [stop existing timers](../lib/cinch/timer.rb) or
439
+ [restart them](../lib/cinch/timer.rb).
434
440
 
435
441
  The easiest way of creating new timers is by using the
436
- {Cinch::Helpers#Timer Timer helper method}, even though it is also
437
- possible, albeit more complex, to create instances of {Cinch::Timer}
442
+ [Timer helper method](../lib/cinch/helpers.rb), even though it is also
443
+ possible, albeit more complex, to create instances of [`Cinch::Timer`](../lib/cinch/timer.rb)
438
444
  directly.
439
445
 
440
446
  Example:
441
447
 
442
- match /remind me in (\d+) seconds/
443
- def execute(m, seconds)
444
- Timer(seconds.to_i, shots: 1) do
445
- m.reply "This is your reminder.", true
446
- end
447
- end
448
-
449
- For more information on timers, see the {Cinch::Timer Timer documentation}.
450
-
451
- ## New options
452
-
453
- - :{file:docs/bot_options.md#dccownip dcc.own_ip}
454
- - :{file:docs/bot_options.md#modes modes}
455
- - :{file:docs/bot_options.md#maxreconnectdelay max_reconnect_delay}
456
- - :{file:docs/bot_options.md#localhost local_host}
457
- - :{file:docs/bot_options.md#delayjoins delay_joins}
458
- - :{file:docs/bot_options.md#saslusername sasl.username}
459
- - :{file:docs/bot_options.md#saslpassword sasl.password}
460
-
461
- ## New events
462
- - :{file:docs/events.md#action action}
463
- - :{file:docs/events.md#away away}
464
- - :{file:docs/events.md#unaway unaway}
465
- - :{file:docs/events.md#dccsend dcc_send}
466
- - :{file:docs/events.md#owner owner}
467
- - :{file:docs/events.md#dehalfop-deop-deowner-devoice deowner}
468
- - :{file:docs/events.md#leaving leaving}
469
- - :{file:docs/events.md#online online}
470
- - :{file:docs/events.md#offline offline}
471
-
472
-
473
- # What has changed in 1.1?
448
+ ```ruby
449
+ match /remind me in (\d+) seconds/
450
+ def execute(m, seconds)
451
+ Timer(seconds.to_i, shots: 1) do
452
+ m.reply "This is your reminder.", true
453
+ end
454
+ end
455
+ ```
456
+
457
+ For more information on timers, see the [Timer documentation](../lib/cinch/timer.rb).
458
+
459
+ ### New options
460
+
461
+ - [:dcc.own_ip](bot_options.md#dccown_ip)
462
+ - [:modes](bot_options.md#modes)
463
+ - [:max_reconnect_delay](bot_options.md#max_reconnect_delay)
464
+ - [:local_host](bot_options.md#local_host)
465
+ - [:delay_joins](bot_options.md#delay_joins)
466
+ - [:sasl.username](bot_options.md#saslusername)
467
+ - [:sasl.password](bot_options.md#saslpassword)
468
+
469
+ ### New events
470
+
471
+ - [`:action`](events.md#action)
472
+ - [`:away`](events.md#away)
473
+ - [`:unaway`](events.md#unaway)
474
+ - [`:dcc_send`](events.md#dcc_send)
475
+ - [`:owner`](events.md#owner)
476
+ - [`:deowner`](events.md#dehalfop-deop-deowner-devoice)
477
+ - [`:leaving`](events.md#leaving)
478
+ - [`:online`](events.md#online)
479
+ - [`:offline`](events.md#offline)
480
+
481
+ ## What has changed in 1.1?
482
+
474
483
  1. **New events**
475
484
  2. **New methods**
476
485
  3. **New options**
477
486
  4. **Improved logger**
478
- x. **Deprecated methods**
487
+ 5. **Deprecated methods**
479
488
 
480
- ## New events
489
+ ### New events
481
490
 
482
- - :{file:docs/events.md#op op}
483
- - :{file:docs/events.md#dehalfop-deop-deowner-devoice deop}
484
- - :{file:docs/events.md#voice voice}
485
- - :{file:docs/events.md#dehalfop-deop-deowner-devoice devoice}
486
- - :{file:docs/events.md#halfop halfop}
487
- - :{file:docs/events.md#dehalfop-deop-deowner-devoice dehalfop}
488
- - :{file:docs/events.md#ban ban}
489
- - :{file:docs/events.md#unban unban}
490
- - :{file:docs/events.md#modechange mode_change}
491
- - :{file:docs/events.md#catchall catchall}
491
+ - [`:op`](events.md#op)
492
+ - [`:deop`](events.md#dehalfop-deop-deowner-devoice)
493
+ - [`:voice`](events.md#voice)
494
+ - [`:devoice`](events.md#dehalfop-deop-deowner-devoice)
495
+ - [`:halfop`](events.md#halfop)
496
+ - [`:dehalfop`](events.md#dehalfop-deop-deowner-devoice)
497
+ - [`:ban`](events.md#ban)
498
+ - [`:unban`](events.md#unban)
499
+ - [`:mode_change`](events.md#mode_change)
500
+ - [`:catchall`](events.md#catchall)
492
501
 
493
502
  Additionally, plugins are now able to send their own events by using
494
503
  Cinch::Bot#dispatch.
495
504
 
496
- ## New methods
505
+ ### New methods
506
+
507
+ #### [`Cinch::User#last_nick`](../lib/cinch/user.rb)
497
508
 
498
- ### {Cinch::User#last_nick}
499
509
  Stores the last nick of a user. This can for example be used in `on
500
510
  :nick` to compare a user's old nick against the new one.
501
511
 
502
- ### Cinch::User#notice, Cinch::Channel#notice and Cinch::Bot#notice
512
+ #### Cinch::User#notice, Cinch::Channel#notice and Cinch::Bot#notice
513
+
503
514
  For sending notices.
504
515
 
505
- ### {Cinch::Message#to_s}
506
- Provides a nicer representation of {Cinch::Message} objects.
516
+ #### [`Cinch::Message#to_s`](../lib/cinch/message.rb)
517
+
518
+ Provides a nicer representation of [`Cinch::Message`](../lib/cinch/message.rb) objects.
519
+
520
+ #### [`Cinch::Channel#has_user?`](../lib/cinch/channel.rb)
507
521
 
508
- ### {Cinch::Channel#has_user?}
509
522
  Provides an easier way of checking if a given user is in a channel
510
523
 
511
- ## New options
512
- - {file:docs/bot_options.md#pluginssuffix plugins.suffix}
513
- - {file:docs/bot_options.md#ssluse ssl.use}
514
- - {file:docs/bot_options.md#sslverify ssl.verify}
515
- - {file:docs/bot_options.md#sslcapath ssl.ca_path}
516
- - {file:docs/bot_options.md#sslclientcert ssl.client_cert}
517
- - {file:docs/bot_options.md#nicks nicks}
518
- - {file:docs/bot_options.md#timeoutsread timeouts.read}
519
- - {file:docs/bot_options.md#timeoutsconnect timeouts.connect}
520
- - {file:docs/bot_options.md#pinginterval ping_interval}
521
- - {file:docs/bot_options.md#reconnect reconnect}
524
+ ### New options
522
525
 
526
+ - [`plugins.suffix`](bot_options.md#pluginssuffix)
527
+ - [`ssl.use`](bot_options.md#ssluse)
528
+ - [`ssl.verify`](bot_options.md#sslverify)
529
+ - [`ssl.ca_path`](bot_options.md#sslca_path)
530
+ - [`ssl.client_cert`](bot_options.md#sslclient_cert)
531
+ - [`nicks`](bot_options.md#nicks)
532
+ - [`timeouts.read`](bot_options.md#timeoutsread)
533
+ - [`timeouts.connect`](bot_options.md#timeoutsconnect)
534
+ - [`ping_interval`](bot_options.md#ping_interval)
535
+ - [`reconnect`](bot_options.md#reconnect)
523
536
 
537
+ ### Improved logger
524
538
 
525
- ## Improved logger
526
- The {Cinch::Logger::FormattedLogger formatted logger} (which is the
539
+ The [formatted logger](../lib/cinch/logger/formatted_logger.rb) (which is the
527
540
  default one) now contains timestamps. Furthermore, it won't emit color
528
541
  codes if not writing to a TTY.
529
542
 
530
543
  Additionally, it can now log any kind of object, not only strings.
531
544
 
532
- ## Deprecated methods
545
+ ### Deprecated methods
533
546
 
534
- | Deprecated method | Replacement |
535
- |-----------------------------+------------------------------------|
536
- | Cinch::User.find_ensured | Cinch::UserManager#find_ensured |
537
- | Cinch::User.find | Cinch::UserManager#find |
538
- | Cinch::User.all | Cinch::UserManager#each |
539
- | Cinch::Channel.find_ensured | Cinch::ChannelManager#find_ensured |
540
- | Cinch::Channel.find | Cinch::ChannelManager#find |
541
- | Cinch::Channel.all | Cinch::ChannelManager#each |
547
+ - `Cinch::User.find_ensured` → `Cinch::UserManager#find_ensured`
548
+ - `Cinch::User.find` → `Cinch::UserManager#find`
549
+ - `Cinch::User.all` → `Cinch::UserManager#each`
550
+ - `Cinch::Channel.find_ensured` → `Cinch::ChannelManager#find_ensured`
551
+ - `Cinch::Channel.find` → `Cinch::ChannelManager#find`
552
+ - `Cinch::Channel.all` → `Cinch::ChannelManager#each`