summaryrefslogtreecommitdiff
path: root/src/plugins/ruby/weechat-ruby.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-11-17 20:51:54 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-11-17 20:51:54 +0100
commitb63ac8a0f10474d4ddda80a8eaacfecf71e844e2 (patch)
tree69441b8ee4edacbe7667eb385c68e33eb270e581 /src/plugins/ruby/weechat-ruby.c
parentbe9269dfc2132e53d7a777877f4da6af993eba22 (diff)
downloadweechat-b63ac8a0f10474d4ddda80a8eaacfecf71e844e2.zip
scripts: display lib version on signal "debug_libs"
Diffstat (limited to 'src/plugins/ruby/weechat-ruby.c')
-rw-r--r--src/plugins/ruby/weechat-ruby.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c
index 4e6d45c85..b4490e8a6 100644
--- a/src/plugins/ruby/weechat-ruby.c
+++ b/src/plugins/ruby/weechat-ruby.c
@@ -23,6 +23,7 @@
#undef _
#include <ruby.h>
+#include <ruby/version.h>
#if defined(RUBY_VERSION) && RUBY_VERSION >=19
#include <ruby/encoding.h>
#endif
@@ -948,6 +949,25 @@ weechat_ruby_signal_debug_dump_cb (void *data, const char *signal,
}
/*
+ * Display infos about external libraries used.
+ */
+
+int
+weechat_ruby_signal_debug_libs_cb (void *data, const char *signal,
+ const char *type_data, void *signal_data)
+{
+ /* make C compiler happy */
+ (void) data;
+ (void) signal;
+ (void) type_data;
+ (void) signal_data;
+
+ weechat_printf (NULL, " %s: v%s", RUBY_PLUGIN_NAME, ruby_version);
+
+ return WEECHAT_RC_OK;
+}
+
+/*
* Callback called when a buffer is closed.
*/
@@ -1163,6 +1183,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
init.callback_hdata = &weechat_ruby_hdata_cb;
init.callback_infolist = &weechat_ruby_infolist_cb;
init.callback_signal_debug_dump = &weechat_ruby_signal_debug_dump_cb;
+ init.callback_signal_debug_libs = &weechat_ruby_signal_debug_libs_cb;
init.callback_signal_buffer_closed = &weechat_ruby_signal_buffer_closed_cb;
init.callback_signal_script_action = &weechat_ruby_signal_script_action_cb;
init.callback_load_file = &weechat_ruby_load_cb;