Module: Weechat

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

Overview

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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
"0.0.3"
Core =

The core buffer

Buffer.new("")

Class Method Summary collapse

Class Method Details

.bool_to_integer(bool) ⇒ Object



171
172
173
# File 'lib/weechat.rb', line 171

def bool_to_integer(bool)
  bool ? 1 : 0
end

.charsetsObject



211
212
213
214
215
216
# File 'lib/weechat.rb', line 211

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

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



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

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

.compilation_dateObject



194
195
196
# File 'lib/weechat.rb', line 194

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

.directoriesObject Also known as: dirs



218
219
220
221
222
223
224
225
226
# File 'lib/weechat.rb', line 218

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



134
135
136
# File 'lib/weechat.rb', line 134

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

.fifoObject



190
191
192
# File 'lib/weechat.rb', line 190

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

.filtering?Boolean

Returns:



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

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

.get_buffer(buffer = nil) ⇒ Object



123
124
125
126
127
128
129
130
131
132
# File 'lib/weechat.rb', line 123

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

.integer_to_bool(int) ⇒ Object



167
168
169
# File 'lib/weechat.rb', line 167

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

.keyboard_inactivityObject Also known as: inactivity



202
203
204
# File 'lib/weechat.rb', line 202

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



163
164
165
# File 'lib/weechat.rb', line 163

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

.mkdir(*args) ⇒ Object



182
183
184
# File 'lib/weechat.rb', line 182

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

.mkdir_home(*args) ⇒ Object



178
179
180
# File 'lib/weechat.rb', line 178

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

.mkdir_parents(*args) ⇒ Object



186
187
188
# File 'lib/weechat.rb', line 186

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

.old_colorObject



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

alias_method :old_color, :color

.old_mkdirObject



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

alias_method :old_mkdir, :mkdir

.old_mkdir_homeObject



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

alias_method :old_mkdir_home, :mkdir_home

.old_mkdir_parentsObject



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

alias_method :old_mkdir_parents, :mkdir_parents

.p(object, buffer = nil) ⇒ Object



152
153
154
# File 'lib/weechat.rb', line 152

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

.pp(object, buffer = nil) ⇒ Object



156
157
158
# File 'lib/weechat.rb', line 156

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

.puts(text, buffer = nil) ⇒ Object



140
141
142
143
144
# File 'lib/weechat.rb', line 140

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



146
147
148
149
150
# File 'lib/weechat.rb', line 146

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



207
208
209
# File 'lib/weechat.rb', line 207

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