Module: Weechat

Defined in:
lib/weechat/input.rb,
lib/weechat.rb,
lib/weechat/bar.rb,
lib/weechat/line.rb,
lib/weechat/info.rb,
lib/weechat/hook.rb,
lib/weechat/timer.rb,
lib/weechat/hooks.rb,
lib/weechat/color.rb,
lib/weechat/script.rb,
lib/weechat/option.rb,
lib/weechat/window.rb,
lib/weechat/plugin.rb,
lib/weechat/buffer.rb,
lib/weechat/process.rb,
lib/weechat/pointer.rb,
lib/weechat/command.rb,
lib/weechat/property.rb,
lib/weechat/modifier.rb,
lib/weechat/callback.rb,
lib/weechat/irc/host.rb,
lib/weechat/terminal.rb,
lib/weechat/infolist.rb,
lib/weechat/irc/ctcp.rb,
lib/weechat/irc/user.rb,
lib/weechat/utilities.rb,
lib/weechat/irc/whois.rb,
lib/weechat/callbacks.rb,
lib/weechat/exceptions.rb,
lib/weechat/irc/server.rb,
lib/weechat/properties.rb,
lib/weechat/irc/message.rb,
lib/weechat/irc/channel.rb,
lib/weechat/hooks/print.rb,
lib/weechat/hooks/signal.rb,
lib/weechat/hooks/config.rb,
lib/weechat/custom_buffer.rb,
lib/weechat/script/config.rb,
lib/weechat/irc/identifier.rb,
lib/weechat/hooks/command_run.rb,
lib/weechat/custom_free_content_buffer.rb

Overview

:input=>1, :input_buffer_alloc=>256, :input_buffer_length=>0, :input_buffer_1st_display=>0,

Defined Under Namespace

Modules: Callbacks, Exception, Helper, Hooks, IRC, Modifiers, Pointer, Properties, Utilities Classes: Bar, Buffer, Callback, Color, Command, CustomBuffer, CustomFreeContentBuffer, EvaluatedCallback, Hook, Info, Infolist, Input, Line, Modifier, Option, Plugin, PrintedLine, Process, Property, Script, Terminal, Timer, Window

Constant Summary

VERSION =
"0.0.6"
Core =

The core buffer

Buffer.from_ptr("")

Class Method Summary collapse

Class Method Details

.bar_item_update(name) ⇒ Object



244
245
246
# File 'lib/weechat.rb', line 244

def bar_item_update(name)
  old_bar_item_update(name.to_s)
end

.bar_update(name) ⇒ Object



239
240
241
# File 'lib/weechat.rb', line 239

def bar_update(name)
  old_bar_update(name.to_s)
end

.bool_to_integer(bool) ⇒ Object



234
235
236
# File 'lib/weechat.rb', line 234

def bool_to_integer(bool)
  bool ? 1 : 0
end

.charsetsObject



284
285
286
287
288
289
# File 'lib/weechat.rb', line 284

def charsets
  {
    :internal => Weechat.info_get("charset_internal", ""),
    :terminal => Weechat.info_get("charset_terminal", ""),
  }
end

.color(name) ⇒ Object Also known as: get_color



39
40
41
42
# File 'lib/weechat/color.rb', line 39

def color(name)
  color = Weechat.old_color(name)
  color.empty? ? nil : color
end

.compilation_dateObject



267
268
269
# File 'lib/weechat.rb', line 267

def compilation_date
  Date.parse(Weechat.info_get("date", ""))
end

.directoriesObject Also known as: dirs



291
292
293
294
295
296
297
298
299
# File 'lib/weechat.rb', line 291

def directories
  {
    :weechat   => Weechat.info_get("weechat_dir", ""),
    :lib       => Weechat.info_get("weechat_libdir", ""),
    :locale    => Weechat.info_get("weechat_localedir", ""),
    :share     => Weechat.info_get("weechat_sharedir", ""),
    :separator => Weechat.info_get("dir_separator", "")
  }
end

.exec(command, buffer = nil) ⇒ Object Also known as: send_command, execute



197
198
199
# File 'lib/weechat.rb', line 197

def exec(command, buffer=nil)
  Weechat.command(buffer.to_s, command)
end

.fifoObject



263
264
265
# File 'lib/weechat.rb', line 263

def fifo
  Weechat.info_get("fifo_filename", "")
end

.filtering?Boolean



271
272
273
# File 'lib/weechat.rb', line 271

def filtering?
  integer_to_bool(Weechat.info_get("filters_enabled", ""))
end

.get_buffer(buffer = nil) ⇒ Object



186
187
188
189
190
191
192
193
194
195
# File 'lib/weechat.rb', line 186

def get_buffer(buffer = nil)
  case buffer
  when nil
    ""
  when :current
    Weechat::Buffer.current
  else
    buffer
  end
end

.integer_to_bool(int) ⇒ Object



230
231
232
# File 'lib/weechat.rb', line 230

def integer_to_bool(int)
  int.to_i == 0 ? false : true
end

.keyboard_inactivityObject Also known as: inactivity



275
276
277
# File 'lib/weechat.rb', line 275

def keyboard_inactivity
  Weechat.info_get("inactivity", "").to_i
end

.log(text) ⇒ void

This method returns an undefined value.

Writes text to the WeeChat log weechat.log



226
227
228
# File 'lib/weechat.rb', line 226

def log(text)
  Weechat.log_print(text)
end

.mkdir(*args) ⇒ Object



255
256
257
# File 'lib/weechat.rb', line 255

def mkdir(*args)
  integer_to_bool(old_mkdir(*args))
end

.mkdir_home(*args) ⇒ Object



251
252
253
# File 'lib/weechat.rb', line 251

def mkdir_home(*args)
  integer_to_bool(old_mkdir_home(*args))
end

.mkdir_parents(*args) ⇒ Object



259
260
261
# File 'lib/weechat.rb', line 259

def mkdir_parents(*args)
  integer_to_bool(old_mkdir_parents(*args))
end

.old_bar_item_updateObject



243
# File 'lib/weechat.rb', line 243

alias_method :old_bar_item_update, :bar_item_update

.old_bar_updateObject



238
# File 'lib/weechat.rb', line 238

alias_method :old_bar_update, :bar_update

.old_colorObject



38
# File 'lib/weechat/color.rb', line 38

alias_method :old_color, :color

.old_mkdirObject



249
# File 'lib/weechat.rb', line 249

alias_method :old_mkdir, :mkdir

.old_mkdir_homeObject



248
# File 'lib/weechat.rb', line 248

alias_method :old_mkdir_home, :mkdir_home

.old_mkdir_parentsObject



250
# File 'lib/weechat.rb', line 250

alias_method :old_mkdir_parents, :mkdir_parents

.p(object, buffer = nil) ⇒ Object



215
216
217
# File 'lib/weechat.rb', line 215

def p(object, buffer = nil)
  self.puts(object.inspect, buffer)
end

.pp(object, buffer = nil) ⇒ Object



219
220
221
# File 'lib/weechat.rb', line 219

def pp(object, buffer = nil)
  puts(object.pretty_inspect, buffer)
end

.puts(text, buffer = nil) ⇒ Object



203
204
205
206
207
# File 'lib/weechat.rb', line 203

def puts(text, buffer = nil)
  buffer = get_buffer(buffer)
  Weechat.print(buffer.to_s, text.to_s)
  nil # to mimic Kernel::puts
end

.puts_y(text, line, buffer = nil) ⇒ Object



209
210
211
212
213
# File 'lib/weechat.rb', line 209

def puts_y(text, line, buffer = nil)
  buffer = get_buffer(buffer)
  Weechat.print_y(text.to_s, line, buffer.to_s)
  nil # to mimic Kernel::puts
end

.versionObject



280
281
282
# File 'lib/weechat.rb', line 280

def version
  Weechat.info_get("version", "")
end