Age | Commit message (Collapse) | Author |
|
I revisited my fix for the ThreadError in ruby 2.0.0
this doesn't use a queue for signals but just starts a
thread for each received signal, works much better for me.
It also fixes a bug in Bot#reconnect where the SystemExit
exception coming from quit is not handled correctly.
|
|
Ruby 2.0.0 crashes with "ThreadError: can't be called from trap context"
anytime a signal is received, because it tries to write a debug message
within the "trap context".
This changes signal handling so that signals are queued and processed
in the main loop.
More information: https://www.ruby-forum.com/topic/4411227
|
|
I don't really know what this is all about, but this
fixes a bug with the compat19 monkeypatching. @waiters
is now a Hash.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=38109&view=revision
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Somewhere along the line between 2.0.0 and 2.2.1 gettext switched from
locale to lang for the hash key name. Support both.
|
|
|
|
This prevents subsequent spurious flushes from bombing out because of
closed databases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When closing the TC db on cleanup, we didn't remove it from the
environment. Override the #close() method to achieve that.
|
|
Rather than raising changing the message (a message that would not be
displayed anyway), display the (composed) error message and then reraise
without further changes.
|
|
This prevents them from being delegated to unreplied() before the processing
thread has the chance to mark it replied. The solution would fail for
threaded messages whose processing would not reply, but I'm not aware of
such a method currently exists.
A future design of the message delegation and mapping could thread the
actual delegation instead, and this problem would be solved.
|
|
Since in the subsequent switc we check for nil, explicitly use
nil when the modifier is empty or nil rather than relying on a rescued
exception.
|
|
When either of the keys passed to the BDB compare function is nil, we
emit a warning. In this warning, however, we used to peek at the
registry value, which required the use of the comparison function
itself, falling in a nested loop. Solve by omitting the
self[<key>].inspect from the warning.
|
|
|
|
Only reset quit message when entering the main loop sanely.
|
|
Since version 4.1.0, HTMLEntities removed the decode_entities()
class method and uses a decoder since. Support the new interface as well
as the old one.
Also slightly optimize by moving the conditional outside of the method
definition. Now a rescan is required even if HTMLEntities is loaded at
runtime, but the method should be slightly faster.
|
|
This was affecting the imdb plugin when htmlentities was not available,
because TV series were split at en dashes, which were being converted to
asterisks when our built-in UNESCAPE_TABLE was being used.
|
|
This prevents things such as "nickA: hi, nickB" where nickA is e.g. the
owner and nickB is the newly met user.
|
|
Rather than complaining about a missing use_ssl= method, if net/https
fails to load we define a mock use_ssl= method that raises a runtime
error making the LoadError message public. This is not the most
user-friendly message (we would prefer not to expose internals), but
it should be clear enough to help owners that forget to read the log
find what's missing.
|
|
|
|
The various checkpointing function may be called when no env has been
loaded (yet), support this.
|
|
Since TokyoCabinet does not provide a DB environment, trying to reopen
the same db multiple times (something that happens with subregistry
mostly, and possibly after rescans) causes the subsequent opens to fail
due to "threading errors".
Fix by implementing some sort of environmentalish database management
(only keeps track of open databases, returns existing ones if reopening
the same db multiple times, closes all of them on exit).
|
|
The symbol appears in weather underground data an was not being escaped
when htmlentities was not available
|
|
|
|
Fix most ruby 1.9 warnings about shadowed variables (still one remaining in
keywords.rb). The only significant changes are in the quiz game plugin.
Also fix an issue in dictclient where the block parameter of a method
was not correctly isolated from the previous parameter.
|
|
Including Comparable at the top level causes infinite recursions in Ruby
1.9.2
|
|
Although the reply method for fake messages was actually relying on the
original, we still need to set 'replied' to prevent the fake message
from being wrongly delegated to 'unreplied'.
The most obvious bug this commit fixes is the potentially infinite loop
triggered by defining a command reaction triggered by the command name
itself (e.g. reply to ping with cmd:ping).
|
|
Allow deletion of an element from the array iff it's at a given position (or in
a given range of positions).
|
|
Since commit a993d1c358e24ab85621568c10411c5496e2dea8, the message
mappers have a more rational way of reporting failures, but the auth
module was not using it, resulting in the wrong permissions being
granted/revoked whenever allow/deny was being used.
|
|
|
|
Default mIRC colors are 0-15, and some clients don't react too well to a
color > 15, while most wrap or default. Konversation, for example, will
stop the color command parsing and interpret it as color 1, followed by
the literal digit 6.
So use the 'official' (mIRC) value of 0 for white.
|
|
Some plugins (ri, fortune) wrap safe_exec in begin/rescue blocks that
did not get triggered because the exceptions from the execution were
caught in the popen block (and would never get exposed anyway). Fix this
by raising if $? does not indicate success.
|
|
Convert the (optional) first argument to #each*() methods to a string to
ensure the calls work as expected. This fixes a problem with
@registry.each not working as expected, and although it would have been
sufficient to convert the default for the first argument from nil to the
empty string, the approach implemented by this patch is more robust
overall.
|
|
|
|
Don't trap them, rerise and let the bot handle them
|
|
When timing out during a wait, return false instead of raising. This
fixes a problem with TimeoutError being raised during restarts on
ruby 1.9.x
|
|
Having Server#to_s alias the hostname would cause problems when the
hostname was nil (e.g. after a disconnect). Fix by making sure that to_s
always returns a string instead.
|
|
|
|
When using a DB backend different from BDB, the BDB constant may not be
defined, causing a NameError during error trapping in the main loop. Fix
this by defining our own DBFatal error that maps to BDB::Fatal in the
BDB case and is defined as an (unused) Exception for TokyoCabinet.
|