Class: Weechat::Plugin
- Inherits:
-
Object
- Object
- Weechat::Plugin
- Extended by:
- Properties
- Includes:
- Pointer
- Defined in:
- lib/weechat/plugin.rb
Overview
Gettable properties
- filename
-
Filename of the plugin
- handle
-
?
- name
-
Name of the plugin
- description
-
Description of the plugin
- author
-
Author of the plugin
- version
-
Version of the plugin
- license
-
Licence of the plugin
- charset
-
?
- debug?
-
?
Instance Attribute Summary
Attributes included from Pointer
Class Method Summary collapse
- .all ⇒ Object
- .find(name) ⇒ Object (also: from_name)
-
.load(name) ⇒ void
Loads a plugin.
-
.reload_all ⇒ Array<Plugin>
Reloads all plugins.
Instance Method Summary collapse
- #name ⇒ Object
-
#reload(force = false) ⇒ Boolean
Reload the plugin.
-
#scripts ⇒ Array<Script>
Returns an array of all scripts loaded by this plugin.
-
#unload(force = false) ⇒ Boolean
Unloads the plugin.
Methods included from Weechat::Properties::ClassMethods
#all, #apply_rtransformation, #apply_transformation, #init_properties, #known_integer_properties, #known_properties, #known_string_properties, #mappings, #rtransformations, #settable_properties, #transformations, #type
Methods included from Pointer
#==, #hash, included, #inspect, #to_s
Class Method Details
.all ⇒ Object
37 38 39 40 41 |
# File 'lib/weechat/plugin.rb', line 37 def all items = super items[0,0] = Plugin.find("") items end |
.find(name) ⇒ Object Also known as: from_name
29 30 31 32 33 34 |
# File 'lib/weechat/plugin.rb', line 29 def find(name) if name.nil? or name.empty? or name == "core" return Plugin.from_ptr("") end all.find {|plugin| plugin.name == name} end |
Instance Method Details
#name ⇒ Object
61 62 63 |
# File 'lib/weechat/plugin.rb', line 61 def name Weechat.plugin_get_name(@ptr) end |
#reload(force = false) ⇒ Boolean
Reload the plugin.
84 85 86 87 88 89 90 |
# File 'lib/weechat/plugin.rb', line 84 def reload(force = false) if name == "ruby" and !force Weechat.puts "Won't reload the ruby plugin unless you force it." else Weechat.exec("/plugin reload #{name}") end end |
#scripts ⇒ Array<Script>
Returns an array of all scripts loaded by this plugin.
95 96 97 98 99 100 101 |
# File 'lib/weechat/plugin.rb', line 95 def scripts scripts = [] Infolist.parse("#{name}_script").each do |script| scripts << Script.new(script[:pointer], self) end scripts end |
#unload(force = false) ⇒ Boolean
Unloads the plugin.
70 71 72 73 74 75 76 77 78 |
# File 'lib/weechat/plugin.rb', line 70 def unload(force = false) if name == "ruby" and !force Weechat.puts "Won't unload the ruby plugin unless you force it." false else Weechat.exec("/plugin unload #{name}") true end end |