ircinch 2.4.0

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 (105) hide show
  1. checksums.yaml +7 -0
  2. data/.standard.yml +3 -0
  3. data/CHANGELOG.md +298 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +5 -0
  6. data/LICENSE.txt +23 -0
  7. data/README.md +195 -0
  8. data/Rakefile +14 -0
  9. data/docs/bot_options.md +454 -0
  10. data/docs/changes.md +541 -0
  11. data/docs/common_mistakes.md +60 -0
  12. data/docs/common_tasks.md +57 -0
  13. data/docs/encodings.md +69 -0
  14. data/docs/events.md +273 -0
  15. data/docs/getting_started.md +184 -0
  16. data/docs/logging.md +90 -0
  17. data/docs/migrating.md +267 -0
  18. data/docs/plugins.md +4 -0
  19. data/docs/readme.md +20 -0
  20. data/examples/basic/autovoice.rb +32 -0
  21. data/examples/basic/google.rb +35 -0
  22. data/examples/basic/hello.rb +14 -0
  23. data/examples/basic/join_part.rb +35 -0
  24. data/examples/basic/memo.rb +39 -0
  25. data/examples/basic/msg.rb +15 -0
  26. data/examples/basic/seen.rb +37 -0
  27. data/examples/basic/urban_dict.rb +36 -0
  28. data/examples/basic/url_shorten.rb +36 -0
  29. data/examples/plugins/autovoice.rb +37 -0
  30. data/examples/plugins/custom_prefix.rb +22 -0
  31. data/examples/plugins/dice_roll.rb +38 -0
  32. data/examples/plugins/google.rb +36 -0
  33. data/examples/plugins/hello.rb +21 -0
  34. data/examples/plugins/hooks.rb +34 -0
  35. data/examples/plugins/join_part.rb +41 -0
  36. data/examples/plugins/lambdas.rb +35 -0
  37. data/examples/plugins/last_nick.rb +24 -0
  38. data/examples/plugins/msg.rb +21 -0
  39. data/examples/plugins/multiple_matches.rb +32 -0
  40. data/examples/plugins/own_events.rb +37 -0
  41. data/examples/plugins/seen.rb +44 -0
  42. data/examples/plugins/timer.rb +22 -0
  43. data/examples/plugins/url_shorten.rb +34 -0
  44. data/ircinch.gemspec +43 -0
  45. data/lib/cinch/ban.rb +53 -0
  46. data/lib/cinch/bot.rb +476 -0
  47. data/lib/cinch/cached_list.rb +21 -0
  48. data/lib/cinch/callback.rb +22 -0
  49. data/lib/cinch/channel.rb +465 -0
  50. data/lib/cinch/channel_list.rb +31 -0
  51. data/lib/cinch/configuration/bot.rb +50 -0
  52. data/lib/cinch/configuration/dcc.rb +18 -0
  53. data/lib/cinch/configuration/plugins.rb +43 -0
  54. data/lib/cinch/configuration/sasl.rb +21 -0
  55. data/lib/cinch/configuration/ssl.rb +21 -0
  56. data/lib/cinch/configuration/timeouts.rb +16 -0
  57. data/lib/cinch/configuration.rb +75 -0
  58. data/lib/cinch/constants.rb +535 -0
  59. data/lib/cinch/dcc/dccable_object.rb +39 -0
  60. data/lib/cinch/dcc/incoming/send.rb +149 -0
  61. data/lib/cinch/dcc/incoming.rb +3 -0
  62. data/lib/cinch/dcc/outgoing/send.rb +123 -0
  63. data/lib/cinch/dcc/outgoing.rb +3 -0
  64. data/lib/cinch/dcc.rb +14 -0
  65. data/lib/cinch/exceptions.rb +48 -0
  66. data/lib/cinch/formatting.rb +127 -0
  67. data/lib/cinch/handler.rb +120 -0
  68. data/lib/cinch/handler_list.rb +92 -0
  69. data/lib/cinch/helpers.rb +230 -0
  70. data/lib/cinch/i_support.rb +100 -0
  71. data/lib/cinch/irc.rb +924 -0
  72. data/lib/cinch/log_filter.rb +23 -0
  73. data/lib/cinch/logger/formatted_logger.rb +100 -0
  74. data/lib/cinch/logger/zcbot_logger.rb +26 -0
  75. data/lib/cinch/logger.rb +171 -0
  76. data/lib/cinch/logger_list.rb +88 -0
  77. data/lib/cinch/mask.rb +69 -0
  78. data/lib/cinch/message.rb +397 -0
  79. data/lib/cinch/message_queue.rb +104 -0
  80. data/lib/cinch/mode_parser.rb +78 -0
  81. data/lib/cinch/network.rb +106 -0
  82. data/lib/cinch/open_ended_queue.rb +26 -0
  83. data/lib/cinch/pattern.rb +66 -0
  84. data/lib/cinch/plugin.rb +517 -0
  85. data/lib/cinch/plugin_list.rb +40 -0
  86. data/lib/cinch/rubyext/float.rb +5 -0
  87. data/lib/cinch/rubyext/module.rb +28 -0
  88. data/lib/cinch/rubyext/string.rb +35 -0
  89. data/lib/cinch/sasl/dh_blowfish.rb +73 -0
  90. data/lib/cinch/sasl/diffie_hellman.rb +50 -0
  91. data/lib/cinch/sasl/mechanism.rb +8 -0
  92. data/lib/cinch/sasl/plain.rb +29 -0
  93. data/lib/cinch/sasl.rb +36 -0
  94. data/lib/cinch/syncable.rb +83 -0
  95. data/lib/cinch/target.rb +199 -0
  96. data/lib/cinch/timer.rb +147 -0
  97. data/lib/cinch/user.rb +489 -0
  98. data/lib/cinch/user_list.rb +89 -0
  99. data/lib/cinch/utilities/deprecation.rb +18 -0
  100. data/lib/cinch/utilities/encoding.rb +39 -0
  101. data/lib/cinch/utilities/kernel.rb +15 -0
  102. data/lib/cinch/version.rb +6 -0
  103. data/lib/cinch.rb +7 -0
  104. data/lib/ircinch.rb +7 -0
  105. metadata +205 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 699864e2ea083e92cca54e715391bd73f3ef6fb89f19bccb96102ac8d95d3b64
4
+ data.tar.gz: c31ed1cbcc9dda592887c87e845499f771a95ed889c5432548663cf6295ee350
5
+ SHA512:
6
+ metadata.gz: 66f5e90889687e3851d712c2785c5f31a1389d72e360cce5f67feb8333f8561bda8458bd456159d0b4a925ff923f21245a836837dd2ab061c52b9b0280551b50
7
+ data.tar.gz: eff8ea7c95c23e257750eaa3856212609c2d1d4d66fa4244d83d51052da690e4cd02711acfc360283dfa85b836436d4a610462ea3cb3dcee77d3f0c24de0d957
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/testdouble/standard
3
+ ruby_version: 3.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,298 @@
1
+ * IRCinch 2.4.0, 21 November 2022
2
+ - Fork the archived Cinch project as IRCinch
3
+ - Various updates to rename the project to IRCinch without breaking drop-in
4
+ compatibility with Cinch
5
+ - Start separation of positional and keyword arguments for compatibility
6
+ with Ruby >= 3.0
7
+
8
+ * Cinch 2.3.2, 25 April 2016
9
+ - Fix exception and premature timeouts in DCC send
10
+
11
+ * Cinch 2.3.1, 01 November 2015
12
+ - Fix logging of exceptions, which was broken by Cinch 2.3.0
13
+ - Fix the accidental removal of hooks. This could lead to hooks
14
+ never executing or being removed under certain conditions. Anyone
15
+ relying on hooks, especially those using them for ACL systems,
16
+ should update to Cinch 2.3.1.
17
+
18
+ * Cinch 2.3.0, 26 October 2015
19
+ - Add basic support for STATUSMSG messages. These are messages
20
+ directed at voiced or ops in a channel, by sending a message to
21
+ +#channel or @#channel. Cinch will now correctly identify those as
22
+ channel messages. Channel#reply will reply to the same group of
23
+ people, and Channel#statusmsg_mode will contain the mode that was
24
+ addressed.
25
+ - Add support for filtering log messages, allowing to hide passwords
26
+ and other confidential information. See
27
+ http://www.rubydoc.info/gems/cinch/file/docs/logging.md for more
28
+ information.
29
+
30
+ * Cinch 2.2.8, 23 October 2015
31
+ - Fix WHOIS retry code, don't raise an exception
32
+
33
+ * Cinch 2.2.7, 28 September 2015
34
+ - Don't replace the letter "z" with spaces when splitting long
35
+ messages
36
+
37
+ * Cinch 2.2.6, 08 July 2015
38
+ - Better support for Slack
39
+ - Support channel owners on InspIRCd
40
+ - Don't get stuck in a WHOIS forever on certain servers
41
+
42
+ * Cinch 2.2.5, 30 March 2015
43
+ - Correctly split messages containing multibyte characters
44
+ - Fix User#authname on servers that send both 330 (WHOISACCOUNT) and
45
+ 307 (WHOISREGNICK)
46
+
47
+ * Cinch 2.2.4, 10 Feburary 2015
48
+ - Fix User#away
49
+
50
+ * Cinch 2.2.3, 10 January 2015
51
+ - Fix processing of RPL_WHOISACCOUNT, broken in 2.2.0
52
+
53
+ * Cinch 2.2.2, 06 January 2015
54
+ - Do not cause deprecation warnings in our own code
55
+
56
+ * Cinch 2.2.1, 01 January 2015
57
+ - Fix message of deprecation warning
58
+ - Make sure italic formatting is indeed italic, and not reverse
59
+ video
60
+
61
+ * Cinch 2.2.0, 31 December 2014
62
+ - Deprecate several methods and aliases:
63
+ - Channel#msg
64
+ - Channel#privmsg
65
+ - Channel#to_str
66
+ - Target#msg
67
+ - Target#privmsg
68
+ - Target#safe_msg
69
+ - Target#safe_privmsg
70
+ - User#whois
71
+ - Helpers.Color
72
+ - Do not strip trailing whitespace in incoming messages
73
+ - Fix handling of rate-limited WHOIS
74
+ - Always send UTF-8 when using "irc" encoding
75
+ - Add Helpers.sanitize
76
+ - Add Formatting.unformat
77
+ - Add Channel#remove
78
+ - Fix (wrong) exceptions in mode parser
79
+
80
+ * Cinch 2.1.0, 27 Februrary 2014
81
+ - Add User#monitored? and User#synced? as aliases for User#monitored
82
+ and User#synced
83
+ - Add Bot#oper to OPER the bot
84
+ - Add User#oper? to check if a user is an OPER
85
+ - Add Utilities::String.strip_colors
86
+ - New matcher option `strip_colors`
87
+ - Correctly re-apply bot modes on reconnect
88
+ - Do not store duplicated bot modes
89
+ - Add Message#action_reply and Message#safe_action_reply
90
+ - Return started thread from Handler#call
91
+ - Return started threads from HandlerList#dispatch
92
+ - Per group hooks
93
+
94
+ * Cinch 2.0.12, 30 January 2013
95
+ - Support second optional argument to User#respond_to?
96
+
97
+ * Cinch 2.0.11, 09 December 2013
98
+ - Unsync authname on nick change
99
+ - Work around bugs in Hector that prevented connecting
100
+ - Update a user's host and username whenever we see it, to avoid
101
+ unnecessary WHOIS calls
102
+ - Correctly handle NOSUCHNICK in WHOIS requests
103
+ * Cinch 2.0.10, 03 November 2013
104
+ - Fix registration process for InspIRCd 2.x servers
105
+
106
+ * Cinch 2.0.9, 02 September 2013
107
+ - Fix support for IPv4 addresses in incoming DCC SEND (2.0.6 broke
108
+ it)
109
+
110
+ * Cinch 2.0.8, 02 September 2013
111
+ - Correctly expect NAK instead of NACK during client capability
112
+ negotiation
113
+ - Remove all references to the Storage API that has never officially
114
+ been part of Cinch
115
+
116
+ * Cinch 2.0.7, 29 July 2013
117
+ - Fix regression introduced by 2.0.6 where requesting channel
118
+ attributes would lead to an exception
119
+
120
+ * Cinch 2.0.6, 26 July 2013
121
+ - Correctly handle empty channel topics
122
+ - Reset bot's channel list on reconnect
123
+ - Fix example plugins that set options
124
+ - Support IPv6 addresses in incoming DCC SEND
125
+
126
+ * Cinch 2.0.5, 21 June 2013
127
+ - Fix internal handling of AWAY
128
+
129
+ * Cinch 2.0.4, 05 February 2013
130
+ - Make User#unmonitor more robust
131
+ - Do not unset SASL password after first authentication
132
+ - Improve DCC SEND
133
+ - Do not block when sending ACKs
134
+ - Support spaces in file names
135
+ - Better transfer handling
136
+ - Return value to signal (un)successful file transfers when receiving a transfer
137
+ - Fix PluginList#unregister_all
138
+
139
+ * Cinch 2.0.3, 27 June 2012
140
+ - Fix monitoring of users
141
+ - Support all types of channels (#, &, !) in Message#channel
142
+ - Make c.delay_joins actually work
143
+ - Don't break when the bot's nick changes
144
+ - Fix User#authed?
145
+ - Do not fire :notice event twice for a single message
146
+ - Do not block on whois requests if a user isn't in any channels
147
+
148
+ * Cinch 2.0.2, 01 April 2012
149
+ - Correctly mark quitting users as offline
150
+ - Register dynamic timers so they can be unloaded (gh-70)
151
+ - Set bot modes when connecting (gh-71)
152
+ - Support fixnums in Bot#on (gh-72)
153
+
154
+ * Cinch 2.0.1, 24 March 2012
155
+ - Include .yardopts in gem so documentation gets built correctly
156
+
157
+ * Cinch 2.0.0, 24 March 2012
158
+ For detailed information check docs/changes.md
159
+
160
+ * Cinch 1.1.3, 12 May 2011
161
+ - PRIVMSGs can now be matched with the event :privmsg (additionally
162
+ to :message, :private and :channel)
163
+ - Moved execution of the configure block further up the chain, to
164
+ allow setting the logger before any log output is happening
165
+
166
+ * Cinch 1.1.2, 02 March 2011
167
+ - Fix Mask#match (it was completly unusable in v1.1.0 and later)
168
+ - Fix User#find_ensured (it was completly unusable in v1.1.0 and later; note
169
+ however that this method is deprecated)
170
+ - Fix Channel#has_user? (it was completly unusable in v1.1.0 and later)
171
+ - Support the question mark as a globbing character in ban masks.
172
+ Before, only the asterisk was supported.
173
+ - Fix !help <plugin> – Since v1.1.0 it was not possible to use !help
174
+ if the plugin prefix was not a plain string.
175
+ - Plugin#config will never return nil
176
+ - It is now possible to set the user name of the bot. Before, it was
177
+ identical to the nick.
178
+ - Implement User#respond_to? to match User#method_missing
179
+
180
+ * Cinch 1.1.1, 18 January 2011
181
+ - Fixed a regression introduced by 1.1.0, which caused Plugin.ctcp
182
+ and thus implementing custom CTCP handlers to break
183
+
184
+ * Cinch 1.1.0, 15 January 2011
185
+ - New signals
186
+ - :op(<Message>message, <User>target) – emitted when someone gets opped
187
+ - :deop(<Message>message, <User>target) – emitted when someone gets deopped
188
+ - :voice(<Message>message, <User>target) – emitted when someone gets voiced
189
+ - :devoice(<Message>message, <User>target) – emitted when someone gets devoiced
190
+ - :halfop(<Message>message, <User>target) – emitted when someone gets half-opped
191
+ - :dehalfop(<Message>message, <User>target) – emitted when someone gets de-half-opped
192
+ - :ban(<Message>message, <Ban>ban) – emitted when someone gets banned
193
+ - :unban(<Message>message, <Ban>ban) – emitted when someone gets unbanned
194
+ - :mode_change(<Message>message, <Array>modes) – emitted on any mode change on a user or channel
195
+ - :catchall(<Message>message) – a generic signal that matches any kind of event
196
+ - New methods
197
+ - User#last_nick – stores the last nick of a user. This can for
198
+ example be used in `on :nick` to compare a user's old nick against
199
+ the new one.
200
+ - User#notice, Channel#notice and Bot#notice – for sending notices
201
+ - Message#to_s – Provides a nicer representation of Message objects
202
+ - Channel#has_user? – Provides an easier way of checking if a given
203
+ user is in a channel
204
+ - Channel#half_opped? – Check if a user is half-opped
205
+ - Plugins/extensions can send their own events using Bot#dispatch
206
+ - Modes as reported by Channel#users now use mode characters, not prefixes (e.g. "@" becomes "o")
207
+ - Modes reported by Channel#users now are an array of modes, not a string anymore
208
+ - The formatted logger (which is the default one) has been improved
209
+ and now contains timestamps and won't use color codes when not
210
+ writing to a tty. Additionally it can log objects which are not
211
+ strings.
212
+ - A minor bug in the handling of the original IRC casemap has been fixed
213
+ - User#authed? now is synced and won't return a wrong value on the
214
+ first use
215
+ - The string "!help" in the middle of a message won't cause Cinch to
216
+ print help messages anymore
217
+ - Quitting will not cause a deadlock anymore
218
+ - Using a regexp prefix with a string pattern no longer breaks Cinch
219
+ - User and channel caching have been completly rewritten, allowing to
220
+ run multiple bots at once. This deprecates and replaces the
221
+ following methods (syntax: deprecated → substitution):
222
+ - User.find_ensured → UserManager#find_ensured
223
+ - User.find → UserManager#find
224
+ - User.all → UserManager#each
225
+ - Channel.find_ensured → ChannelManager#find_ensured
226
+ - Channel.find → ChannelManager#find
227
+ - Channel.all → ChannelManager#each
228
+
229
+ Additionally this changes fix a bug where wrong User/Channel objects
230
+ could've been returned.
231
+ - Additionally to prefixes, plugins can now have suffixes
232
+ New option: plugins.suffix
233
+ - Various improvements to the handling of SSL have been made
234
+ - The option 'ssl' now is a set of options, as opposed to a simple boolean switch
235
+ - 'ssl.use' (Boolean) sets if SSL should be used
236
+ - 'ssl.verify' (Boolean) sets if the SSL certificate should be verified
237
+ - 'ssl.ca_path' (String) sets the path to a directory with
238
+ certificates. This has to be set properly for 'ssl.verify' to work.
239
+ - 'ssl.client_cert' (String) allows to set a client certificate,
240
+ which some networks can use for authentication (see
241
+ http://www.oftc.net/oftc/NickServ/CertFP)
242
+ - Instances of Mask can be checked for equality
243
+ - Mask#match has been fixed
244
+ - Timer functionality has been added to plugins
245
+ - A new option 'nicks' has been added which overrules 'nick' and
246
+ allows Cinch to try multiple nicks before appending underscores
247
+ - Proper disconnect and reconnect handling has been added to Cinch
248
+ - Cinch will notice unexpected disconnects
249
+ - New options:
250
+ - timeouts.read – If no data has been received for X seconds,
251
+ consider the connection dead
252
+ - timeouts.connect – Give up connecting after X seconds
253
+ - ping_interval – Ping the server every X seconds. This interval
254
+ should be smaller than 'timeouts.read' to prevent Cinch from
255
+ falsely declaring a connection dead
256
+ - reconnect – If true, try to reconnect after a connection loss
257
+ - pre- and post-execution hooks have been added to the plugin
258
+ architecture
259
+ - A new option 'user_host' has been added, which allows Cinch to
260
+ bind to a specific IP/Host, which is commonly used for using so
261
+ called "vhosts"
262
+ - Added support for RPL_WHOISREGNICK (+r flag on UnrealIRC)
263
+ - Prefixes, suffixes and patterns can now, additionally to strings
264
+ and regexps, also be procs/lambdas, which get executed everytime
265
+ before a message is matched against the pattern. This allows for
266
+ highly dynamic patterns. One possible use case are plugins that
267
+ only respond if the bot was directly addressed.
268
+ - A new encoding called :irc has been added and made the default.
269
+ - If incoming text is valid UTF-8, it will be interpreted as such.
270
+ If it fails validation, a CP1252 -> UTF-8 conversion is
271
+ performed.
272
+ - If your outgoing message contains only characters that fit
273
+ inside the CP1252 code page, the entire message will be sent
274
+ that way. If the text doesn't fit inside the CP1252 code page,
275
+ it will be sent using its original encoding, which should be UTF-8.
276
+ - This hybrid encoding allows Cinch to transparently handle nearly
277
+ all configurations in western countries, even if users in a
278
+ single channel cannot decide on one encoding. The :irc encoding
279
+ exploits the fact that most people either use UTF-8 or CP1252
280
+ (which is nearly identical to ISO-8859-1) and that text encoded
281
+ in CP1252 is not valid in UTF-8.
282
+ - Invalid bytes in incoming messages (e.g. if a wrong encoding has
283
+ been used) will be replaced with question marks (or U+FFFD if
284
+ using UTF-8)
285
+
286
+ * Cinch 1.0.2, 01 September 2010
287
+ - Left-over debug output has been removed
288
+ - Patterns won't be wrongly modified during registration anymore
289
+ - Using the same internal and external encoding doesn't break Cinch anymore
290
+ - Messages coming from SSL will be properly encoded
291
+
292
+ * Cinch 1.0.1, 19 August 2010
293
+ - fix several bugs regarding user syncing and unsyncing which cause
294
+ exceptions in the core of Cinch and which don't unsync users who
295
+ quit.
296
+
297
+ * Cinch 1.0.0, 18 August 2010
298
+ - first stable release of Cinch
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at siasmj@uwec.edu. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,23 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2010 Lee Jarvis, Dominik Honnef
4
+ Copyright (c) 2011-2019 Dominik Honnef
5
+ Copyright (c) 2022 Matt Sias
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # IRCinch - The IRC Bot Building Framework
2
+
3
+ ## Description
4
+
5
+ IRCinch is an IRC Bot Building Framework for quickly creating IRC bots in
6
+ Ruby with minimal effort. It provides a simple interface based on plugins and
7
+ rules. It's as easy as creating a plugin, defining a rule, and watching your
8
+ profits flourish.
9
+
10
+ IRCinch will do all of the hard work for you, so you can spend time creating
11
+ cool plugins and extensions to wow your internet peers.
12
+
13
+ IRCinch a fork of the brilliant [Cinch](https://github.com/cinchrb/cinch)
14
+ project by Dominik Honnef, Lee Jarvis, and contributors. The IRCinch fork
15
+ focuses on compatibility with supported versions of CRuby.
16
+
17
+ ## Installation
18
+
19
+ ### RubyGems
20
+
21
+ You can install the latest IRCinch gem using RubyGems:
22
+
23
+ ```
24
+ gem install ircinch
25
+ ```
26
+
27
+ ### Bundler
28
+ Or, you can install the latest IRCinch gem using Bundler:
29
+
30
+ ```
31
+ bundle add ircinch
32
+ bundle install
33
+ ```
34
+
35
+ ### GitHub
36
+
37
+ You can also check out the latest code directly from Github:
38
+
39
+ ```
40
+ git clone https://github.com/ircinchrb/ircinch.git
41
+ ```
42
+
43
+ ## Example
44
+
45
+ Your typical Hello, World application in Cinch would go something like this:
46
+
47
+ ```ruby
48
+ require "ircinch"
49
+
50
+ bot = Cinch::Bot.new do
51
+ configure do |c|
52
+ c.server = "irc.libera.chat"
53
+ c.channels = ["#ircinch-bots"]
54
+ end
55
+
56
+ on :message, "hello" do |m|
57
+ m.reply "Hello, #{m.user.nick}"
58
+ end
59
+ end
60
+
61
+ bot.start
62
+ ```
63
+
64
+ More examples can be found in the `examples` directory.
65
+
66
+ ## Features
67
+
68
+ ### Documentation
69
+
70
+ Cinch provides a documented API, which is online for your viewing pleasure
71
+ [here](http://rubydoc.info/gems/cinch/frames).
72
+
73
+ ### Object Oriented
74
+
75
+ Many IRC bots (and there are, **so** many) are great, but we see so little of
76
+ them take advantage of the awesome Object Oriented Interface which most Ruby
77
+ programmers will have become accustomed to and grown to love.
78
+
79
+ Well, IRCinch uses this functionality to its advantage. Rather than having to
80
+ pass around a reference to a channel or a user, to another method, which then
81
+ passes it to another method (by which time you're confused about what's
82
+ going on). IRCinch provides an OOP interface for even the simpliest of tasks,
83
+ making your code simple and easy to comprehend.
84
+
85
+ ### Threaded
86
+
87
+ Unlike a lot of popular IRC frameworks, IRCinch is threaded. But wait, don't
88
+ let that scare you. It's totally easy to grasp.
89
+
90
+ Each of IRCinch's plugins and handlers are executed in their own personal
91
+ thread. This means the main thread can stay focused on what it does best,
92
+ providing non-blocking reading and writing to an IRC server. This will prevent
93
+ your bot from locking up when one of your plugins starts doing some intense
94
+ operations. Damn that's handy.
95
+
96
+ ### Plugins
97
+
98
+ That's right folks, IRCinch provides a modular based plugin system. This is a
99
+ feature many people have bugged us about for a long time. It's finally here,
100
+ and it's as awesome as you had hoped!
101
+
102
+ This system allows you to create feature packed plugins without interfering
103
+ with any of the Cinch internals. Everything in your plugin is self contained,
104
+ meaning you can share your favorite plugins among your friends and release a
105
+ ton of your own plugins for others to use.
106
+
107
+ Want to see the same Hello, World application in plugin form? Sure you do!
108
+
109
+ ```ruby
110
+ require "ircinch"
111
+
112
+ class Hello
113
+ include Cinch::Plugin
114
+
115
+ match "hello"
116
+
117
+ def execute(m)
118
+ m.reply "Hello, #{m.user.nick}"
119
+ end
120
+ end
121
+
122
+ bot = Cinch::Bot.new do
123
+ configure do |c|
124
+ c.server = "irc.libera.chat"
125
+ c.channels = ["#cinch-bots"]
126
+ c.plugins.plugins = [Hello]
127
+ end
128
+ end
129
+
130
+ bot.start
131
+ ```
132
+
133
+ Note: Plugins take a default prefix of `/^!/` which means the actual match is
134
+ `!hello`.
135
+
136
+ More information can be found in the {Cinch::Plugin} documentation.
137
+
138
+ ### Numeric Replies
139
+
140
+ Do you know what IRC code 401 represents? How about 376? or perhaps 502?
141
+ Sure you don't (and if you do, you're as geeky as us!). IRCinch doesn't expect
142
+ you to store the entire IRC RFC code set in your head, and rightfully so!
143
+
144
+ That's exactly why IRCinch has a ton of constants representing these numbers
145
+ so you don't have to remember them. We're so nice.
146
+
147
+ ### Pretty Output
148
+
149
+ Ever get fed up of watching those boring, frankly unreadable lines flicker
150
+ down your terminal screen whilst your bot is online? Help is at hand! By
151
+ default, IRCinch will colorize all text it sends to a terminal, meaning you
152
+ get some pretty damn awesome readable coloured text. IRCinch also provides a
153
+ way for your plugins to log custom messages:
154
+
155
+ ```ruby
156
+ on :message, /hello/ do |m|
157
+ debug "Someone said hello"
158
+ end
159
+ ```
160
+
161
+ ## Code of Conduct
162
+
163
+ Everyone interacting in the IRCinch project's codebases, issue trackers, chat
164
+ rooms, and mailing lists is expected to follow the
165
+ [code of conduct](https://github.com/ircinchrb/ircinch/blob/main/CODE_OF_CONDUCT.md).
166
+
167
+ ## Contribute
168
+
169
+ Love IRCinch? Love Ruby? Love helping? Of course you do! If you feel like
170
+ IRCinch is missing that awesome jaw-dropping feature and you want to be the
171
+ one to make this magic happen, you can!
172
+
173
+ Please note that we intend for IRCinch to be fully compatible with all
174
+ supported CRuby versions.
175
+
176
+ Fork the project, implement your awesome feature in its own branch, and send
177
+ a pull request to one of the IRCinch collaborators. We'll be more than happy
178
+ to check it out.
179
+
180
+ ### Development
181
+
182
+ After forking/checking out the repo, run `bin/setup` to install dependencies.
183
+ Then, run `rake test` to run the tests. You can also run `bin/console` for an
184
+ interactive prompt that will allow you to experiment.
185
+
186
+ To install this gem onto your local machine, run `bundle exec rake install`.
187
+ To release a new version, update the version number in `lib/cinch/version.rb`,
188
+ and then run `bundle exec rake release`, which will create a git tag for the
189
+ version, push git commits and the created tag, and push the `.gem` file to
190
+ [rubygems.org](https://rubygems.org).
191
+
192
+ ## License
193
+
194
+ The gem is available as open source under the terms of the
195
+ [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/lib/**/*.rb"]
10
+ end
11
+
12
+ require "standard/rake"
13
+
14
+ task default: %i[test standard]