ircinch 2.4.5 → 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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +1 -1
  3. data/CHANGELOG.md +10 -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/message_queue.rb +2 -2
  48. data/lib/cinch/plugin.rb +1 -1
  49. data/lib/cinch/version.rb +1 -1
  50. metadata +270 -249
  51. data/lib/cinch/rubyext/float.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e38ea0125101664ba65d200052123e03cd228a58f74fd41665875c8afdf0e18
4
- data.tar.gz: d174789e928ccdf40d05e24d9766fa0a34490558d5cc25ab36cf73977e97340d
3
+ metadata.gz: 34c51fbdabcd306e8bc34d32906638f878dceebf3de04f2bb232026fdea67760
4
+ data.tar.gz: 2d2fc20b90a4ad09d8df33a9fdbe58dad2e8048d721d240210d714083d0b70f2
5
5
  SHA512:
6
- metadata.gz: 45d2ecc80e52a2f482af905ca5d0a1f14962c1c6e9291683573f360fc00d6c3fdab27091aace0407fd6fc066fc620bff49065d00a35a68e2b044a4061733a421
7
- data.tar.gz: 965cc61c9929916a5e648dd1a89fd7800da41ff17c77e9538b1885de1e41c1a769d7c47b43d85d5cc9d4b595496930622b5a52ee69c8bfa2a3932a16871ec037
6
+ metadata.gz: ce693adc7b30ac8abe1e0b6bc3007c471c1a4d36f90e4a9a667eb27df044c15970a285a56dd2777ed59f5bbaabf29e298347ad57e8e738a095f1d2f9d353e94f
7
+ data.tar.gz: 148d93dc0059c4974e569335ef086c8ce03f934e7225bca81d23075a2ba58f067a77c49581349a6aab1458763216a92ac2adb229cb9047b9817ae0292244af3c
data/.standard.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  # For available configuration options, see:
2
2
  # https://github.com/testdouble/standard
3
3
  parallel: true
4
- ruby_version: 3.2
4
+ ruby_version: 3.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ * IRCinch 2.4.6, 23 November 2026
2
+ - Add JRuby, TruffleRuby, and Ruby 4.1.0-preview1 to CI matrix
3
+ - Remove Ruby 3.2 from CI matrix
4
+ - Remove obsolete Float::INFINITY fallback
5
+ - Bump minimum supported Ruby version to 3.3.0
6
+ - Use monotonic timing for reconnect waits and message throttling
7
+ - Add base64 as a runtime dependency for forward compatibility
8
+ - Minor performance improvements
9
+ - Refresh documentation and examples
10
+
1
11
  * IRCinch 2.4.5, 7 February 2026
2
12
  - Fix issue in which bot does not join channels or set modes after connecting (fix by @snex)
3
13
 
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,84 +1,10 @@
1
- # Contributor Covenant Code of Conduct
1
+ # Code of Conduct
2
2
 
3
- ## Our Pledge
3
+ IRCinch follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
4
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.
5
+ * Participants will be tolerant of opposing views.
6
+ * Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
7
+ * When interpreting the words and actions of others, participants should always assume good intentions.
8
+ * Behaviour which can be reasonably considered harassment will not be tolerated.
6
9
 
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.
10
+ If you have any concerns about behaviour within this project, please contact us at [https://github.com/siasmj](https://github.com/siasmj).
data/README.md CHANGED
@@ -10,39 +10,43 @@ profits flourish.
10
10
  IRCinch will do all of the hard work for you, so you can spend time creating
11
11
  cool plugins and extensions to wow your internet peers.
12
12
 
13
- IRCinch a fork of the brilliant [Cinch](https://github.com/cinchrb/cinch)
13
+ IRCinch is a fork of the brilliant [Cinch](https://github.com/cinchrb/cinch)
14
14
  project by Dominik Honnef, Lee Jarvis, and contributors. The IRCinch fork
15
- focuses on compatibility with supported versions of CRuby.
15
+ focuses on compatibility with supported versions of Ruby, and keeps the Ruby
16
+ API under the `Cinch` namespace for drop-in compatibility.
16
17
 
17
18
  ## Installation
18
19
 
20
+ This checkout requires Ruby 3.3 or newer. The
21
+ [CI matrix](.github/workflows/ci.yml) includes CRuby, JRuby, and TruffleRuby.
22
+
19
23
  ### RubyGems
20
24
 
21
25
  You can install the latest IRCinch gem using RubyGems:
22
26
 
23
- ```
27
+ ```sh
24
28
  gem install ircinch
25
29
  ```
26
30
 
27
31
  ### Bundler
28
- Or, you can install the latest IRCinch gem using Bundler:
29
32
 
30
- ```
33
+ In an existing Bundler project, add IRCinch with:
34
+
35
+ ```sh
31
36
  bundle add ircinch
32
- bundle install
33
37
  ```
34
38
 
35
39
  ### GitHub
36
40
 
37
- You can also check out the latest code directly from Github:
41
+ You can also check out the latest code directly from GitHub:
38
42
 
39
- ```
43
+ ```sh
40
44
  git clone https://github.com/ircinchrb/ircinch.git
41
45
  ```
42
46
 
43
47
  ## Example
44
48
 
45
- Your typical Hello, World application in Cinch would go something like this:
49
+ Your typical "Hello, World" application in Cinch would go something like this:
46
50
 
47
51
  ```ruby
48
52
  require "ircinch"
@@ -50,6 +54,7 @@ require "ircinch"
50
54
  bot = Cinch::Bot.new do
51
55
  configure do |c|
52
56
  c.server = "irc.libera.chat"
57
+ c.nick = "my_example_bot"
53
58
  c.channels = ["#ircinch-bots"]
54
59
  end
55
60
 
@@ -61,14 +66,19 @@ end
61
66
  bot.start
62
67
  ```
63
68
 
64
- More examples can be found in the `examples` directory.
69
+ See [Getting Started](docs/getting_started.md) for setup and how to run the
70
+ example. The [example bots](examples/README.md) include complete scripts
71
+ and commands to try.
65
72
 
66
73
  ## Features
67
74
 
68
75
  ### Documentation
69
76
 
70
- IRCinch provides a documented API, which is online for your viewing pleasure at
71
- [https://rubydoc.info/gems/ircinch](https://rubydoc.info/gems/ircinch).
77
+ See the [IRCinch guides](docs/readme.md) for setup, bot options, plugins, and
78
+ events.
79
+
80
+ For API details, see the [source reference](lib/cinch) or the gem's
81
+ [RubyDoc.info page](https://rubydoc.info/gems/ircinch).
72
82
 
73
83
  ### Object Oriented
74
84
 
@@ -87,11 +97,10 @@ making your code simple and easy to comprehend.
87
97
  Unlike a lot of popular IRC frameworks, IRCinch is threaded. But wait, don't
88
98
  let that scare you. It's totally easy to grasp.
89
99
 
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.
100
+ IRCinch runs each handler invocation in its own thread and uses separate
101
+ threads for reading and writing IRC traffic. A plugin instance can handle
102
+ several events concurrently. Use [`synchronize`](docs/plugins.md#shared-state)
103
+ when handlers share mutable state.
95
104
 
96
105
  ### Plugins
97
106
 
@@ -122,6 +131,7 @@ end
122
131
  bot = Cinch::Bot.new do
123
132
  configure do |c|
124
133
  c.server = "irc.libera.chat"
134
+ c.nick = "my_example_bot"
125
135
  c.channels = ["#cinch-bots"]
126
136
  c.plugins.plugins = [Hello]
127
137
  end
@@ -133,7 +143,8 @@ bot.start
133
143
  Note: Plugins take a default prefix of `/^!/` which means the actual match is
134
144
  `!hello`.
135
145
 
136
- More information can be found in the {Cinch::Plugin} documentation.
146
+ See the [plugin guide](docs/plugins.md) for matchers, listeners, and
147
+ configuration.
137
148
 
138
149
  ### Numeric Replies
139
150
 
@@ -141,16 +152,15 @@ Do you know what IRC code 401 represents? How about 376? or perhaps 502?
141
152
  Sure you don't (and if you do, you're as geeky as us!). IRCinch doesn't expect
142
153
  you to store the entire IRC RFC code set in your head, and rightfully so!
143
154
 
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.
155
+ Use the named [constants](lib/cinch/constants.rb) in `Cinch::Constants`
156
+ or pass the numeric code directly to [`on` or `listen_to`](docs/events.md).
146
157
 
147
158
  ### Pretty Output
148
159
 
149
160
  Ever get fed up of watching those boring, frankly unreadable lines flicker
150
161
  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:
162
+ default, IRCinch uses a formatted logger that adds color when writing to a
163
+ terminal. Your plugins and handlers can also log custom messages:
154
164
 
155
165
  ```ruby
156
166
  on :message, /hello/ do |m|
@@ -158,11 +168,13 @@ on :message, /hello/ do |m|
158
168
  end
159
169
  ```
160
170
 
171
+ See [Logging](docs/logging.md) for levels, output, and filters.
172
+
161
173
  ## Code of Conduct
162
174
 
163
175
  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).
176
+ rooms, and mailing lists is expected to follow the
177
+ [code of conduct](CODE_OF_CONDUCT.md).
166
178
 
167
179
  ## Contribute
168
180
 
@@ -170,9 +182,6 @@ Love IRCinch? Love Ruby? Love helping? Of course you do! If you feel like
170
182
  IRCinch is missing that awesome jaw-dropping feature and you want to be the
171
183
  one to make this magic happen, you can!
172
184
 
173
- Please note that we intend for IRCinch to be fully compatible with all
174
- supported CRuby versions.
175
-
176
185
  Fork the project, implement your awesome feature in its own branch, and send
177
186
  a pull request to one of the IRCinch collaborators. We'll be more than happy
178
187
  to check it out.
@@ -180,8 +189,8 @@ to check it out.
180
189
  ### Development
181
190
 
182
191
  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.
192
+ Then, run `bundle exec rake test` to run the tests. You can also run
193
+ `bin/console` for an interactive prompt that will allow you to experiment.
185
194
 
186
195
  To install this gem onto your local machine, run `bundle exec rake install`.
187
196
  To release a new version, update the version number in `lib/cinch/version.rb`,