summaryrefslogtreecommitdiff
path: root/lib/rbot
AgeCommit message (Collapse)Author
2009-09-24ircify_html: options to handle img tagsGiuseppe Bilotta
2009-09-09basics: log the fact that we're not joining default channelsGiuseppe Bilotta
This makes it easier to understand why the bot is not joining when join_after_identify is set to true and the bot is not identifying.
2009-09-06ruby 1.9: Exception#to_strfranz
Since in ruby 1.9 Exception#to_str was removed, change it to to #to_s
2009-09-06ruby 1.9: fix method_defined?franz
method_defined? doesn't search in private methods, and :bound_targets is private, so change it to respond_to?(method, include_private=true)
2009-08-30Revert "utils: try nokogiri/hpricot if hpricot is not available"Giuseppe Bilotta
This reverts commit 4ea25eba02d85b81dcee4302375d7d3e08cd52ac. Not only the patch was missing an essential part, but Nokogiri is not compatible enough with Hpricot anyway. Incompatibilities include doc/"style|script" raising an "Undefined namespace prefix" error and the non-existence of Hpricot::Elements. If we want to support Nokogiri we'll need to write code for it on purpose or redesign the Hpricot code so that it only uses the subset supported by Nokogiri.
2009-08-30httputil: POST respose '201 Created' is goodGiuseppe Bilotta
2009-08-30utils: try nokogiri/hpricot if hpricot is not availableGiuseppe Bilotta
2009-08-27utils: avoid namespace conflictGiuseppe Bilotta
The time parsing refactoring introduced an unpleasant namespace conflict by defining Utils::Time. Eliminate it by renaming it to ParseTime
2009-08-26gettext: fix empty LANGUAGE env varfranz
When LANGUAGE env var is set to empty value, it breaks gettext in ruby, so we unset it if it's empty.
2009-08-26ruby 1.9: fix *methods.include?franz
Since in 1.9 methods arrays have symbols instead of strings, fix it by changing into respond_to? and method_defined?
2009-08-26ruby 1.9: disable the Singleton monkeypatch for 1.9franz
this monkeypatch doesn't work on 1.9 - Singleton has no _load method
2009-08-26ruby 1.9: monkeypatch MonitorMixin and ConditionVariablefranz
ruby 1.9's ConditionVariable#wait is not implemented for timeout != nil, this patch adds an implementation for it (see ruby-core:15847) Also, since MonitorMixin is included into TCPSocket in rbot, and TCPSocket#send != Object#send in ruby 1.9, i changed that to use __send__.
2009-08-26ruby 1.9: fix Integer(nil)franz
in 1.9, Integer(nil) raises TypeError, so we change "%d" to "%s"
2009-08-26ruby 1.9: convert Exception to string explicitlyfranz
changed "string + exception" to "string #{e}", the former yields 'can't convert <e> into String' in ruby 1.9
2009-08-26ircbot: fix indentation errorfranz
2009-08-26ruby 1.9: get rid of Array#nitemsfranz
Array#nitems is gone in ruby 1.9, changed rbot code to use Array.compact.size, which works in both 1.8 & 1.9
2009-08-26Utils: time parsing routinesGiuseppe Bilotta
Add time parsing routines to Utils, to be used for human-to-computer conversion of time offsets. Refactored and enhanced from the remind plugin.
2009-08-16Suppress warnings about unitialized variablesGiuseppe Bilotta
hangman: an unneeded letters accessor was defined ircbot: restore initializations removed by previous commit
2009-08-14ircbot: clean up ping timings on connectGiuseppe Bilotta
2009-08-13basics: UI reconnect commandGiuseppe Bilotta
2009-08-12Better handling of MessageMapper failuresGiuseppe Bilotta
The plugin fallback method is now passed the list of failures. Failures themselves are encapsulated in their own data type, making it easier to handle failures that should inform the user with something more detailed than the classic 'usage' pattern. It's still up to the fallback method to make use (e.g. echo) the relevant messages.
2009-06-30extends: bring conjoin to EnumerableGiuseppe Bilotta
Put #conjoin() in the Enumerable module, so that it can be shared by all enumerables (e.g. ranges). Since #size() is not necessarily present, its use is replaced by #count(), the result of which is cached because it can be slow on objects missing #size().
2009-06-29core/utils/extends.rb: add #conjoin for ArrayAdam James
2009-06-16lib/rbot/plugins.rb: remove executable bitAdam James
2009-06-06* (gettext) relaxed check for bound_target() existancedmitry kim
2009-05-21multiple plugins: Changes to remove parenthesize warnings.David Gadling
All of these modules/plugins were generating warnings like this: warning: parenthesize argument(s) for future version This patch should fix all the warnings without affecting functionality.
2009-05-06ircbot: reinstante @bot.channelsGiuseppe Bilotta
When the new IRC framework was introduced, the old @channels Hash and its accessor for @bot were dismissed. Reintroduce it for backwards compatibility.
2009-04-20gettext: support version 2Giuseppe Bilotta
GetText version 2 has some significant difference from earlier version. * different syntax to set the default locale path * different syntax to set non-cached mode * different way to handle bound targets Most of the changes are relative to significant functionality split between the GetText submodules (LocalePath, TextDomain etc), so most of the changes are just a matter of moving the defines where appropriate. The bound_targets patch needed to cope with anonymous modules is not needed with gettext >= 2.0.0
2009-04-11utils: Utils.try_execGiuseppe Bilotta
An auxiliary method to test-run external programs and see if they run without problem
2009-04-11utils: fix safe_exec failuresGiuseppe Bilotta
safe_exec should be less verbose when reporting problems, since the output might end up on IRC, and it should return a non-zero error code when failing, so that $? get set correctly.
2009-03-25messagemapper: include defaults in optionsGiuseppe Bilotta
This change allows the use of :defaults in maps to define values for parameters which are not actually present in the map itself. We also move the initialization further down, to skip it in case of early returns.
2009-03-15extends: String#wrap_nonemptyGiuseppe Bilotta
We sometimes want to wrap a nonempty String with a given prefix and postfix. This method makes it a breeze.
2009-03-13filters: BotModule user filter loadingGiuseppe Bilotta
2009-03-07messagemapper: fix regexp creation for double-optional templatesGiuseppe Bilotta
When a mapping template had a double optional key such as 'something [[double] optional]' the resuting regexp moved the spacing between the (converted) double brackets, requiring extra spacing before the 'optional' keyword. Fix by moving spacing inside all consecutive brackets before converting brackets into their regexp form.
2009-03-06load rubygems if availableGiuseppe Bilotta
Try loading rubygems as soon as we're set up, since it can be needed for gettext and a number of other things. This also allows us to get rid of some stupid convoluted tricks in utils.
2009-03-06irc: monkeypatch Singleton to make _load and _dump public.Spencer Rinehart
This is to fix a possible bug in newer versions of ruby where _load was declared private in singletons. This would lead to errors where Marshal could not restore the Singleton. This "bug" was introduced to ruby in revisions 16659 and 17396.
2009-03-03utils: add a helper method for creating comma separated listsRaine Virta
2009-03-03ircbot: enable gettext on "restarting, back in..."Raine Virta
2009-03-03config: add alias config removeRaine Virta
2009-03-03config: allow multiple values in config add and rmRaine Virta
2009-02-28plugins: allow plugins whitelistingRaine Virta
If the whitelist is not empty, only load the specified plugins.
2009-02-28plugins: refactor plugin scanningRaine Virta
Refactor plugin scanning for cleaner distinction between core modules and plugins.
2009-02-28Separate @dirs containing all botmodules (plugins and core modules)Raine Virta
into @core_module_dirs and @plugin_dirs
2009-02-26finnish localization for basic expressionsRaine Virta
2009-02-22registry: expose set and bulk parametersGiuseppe Bilotta
expose set and bulk parameters in the each*() iterators. Some plugins might need it for faster lookup.
2009-02-22registry: spare useless I/OGiuseppe Bilotta
The each_key()/each_value() methods of the accessor relied on the each() method of the database, wasting I/O bandwidth and time by loading unnecessary data (particularly when running each_key() on databases with ridiculously enormous values such as in the markov plugin case).
2009-02-19remove whitespaceRaine Virta
2009-02-17ircbot: fix nil error variable on ServerErrorGiuseppe Bilotta
We were making use of an undefined variable e when catching ServerError in the main loop.
2009-02-15+ @bot.path and datafile methodsGiuseppe Bilotta
We provide two methods that make it more simple and elegant for botmodules to define paths relative to the bot's own directory (botclass) and to the BotModule's (assumed) non-registry directory. The first method is Irc::Bot#path(), which joins its arguments with the botclass. This method can be used to access datafiles in the bot directory with a much cleaner syntax; and since it uses File.join, the resulting paths are also properly formatted on each platform, which doesn't hurt. Each BotModule now also carries a dirname() method that should return the directory under botclass that holds the BotModule's datafiles. dirname() defaults to the BotModule's name(), but it can be overridden, e.g. for backwards compatibility (see the patch for the quotes plugin), or for BotModules that share their datafiles. Datafiles can be accessed using the BotModule#datafile() method that joins the botclass, the dirname() and whatever other argument is passed.
2009-02-15ircbot: refactor and clean up botclass dir handlingGiuseppe Bilotta
Use File.join across the board, and refactor some botclass directory handling. Most important changes: * failure to create the registry and safe_save directory is now fatal; * failure to create the local plugin directory prevents it from being added to the plugin path (with a warning); * botclass directory update from templates is now a standalone routine called during init, making it possible to use it in other cases too.