Class: LiveReload
- Inherits:
-
Object
- Object
- LiveReload
- Includes:
- Muzang::Plugins::Helpers
- Defined in:
- lib/muzang-plugins/muzang-livereload.rb
Instance Method Summary collapse
- #call(connection, message) ⇒ Object
-
#initialize(bot) ⇒ LiveReload
constructor
A new instance of LiveReload.
Methods included from Muzang::Plugins::Helpers
#create_database, #match, #on_channel, #on_join
Constructor Details
#initialize(bot) ⇒ LiveReload
Returns a new instance of LiveReload.
4 5 6 |
# File 'lib/muzang-plugins/muzang-livereload.rb', line 4 def initialize(bot) @bot = bot end |
Instance Method Details
#call(connection, message) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/muzang-plugins/muzang-livereload.rb', line 8 def call(connection, ) on_channel() do match(, /^!reload$/) do @bot.plugins.each do |plugin, instance| Kernel.load("muzang-plugins/muzang-#{plugin.to_s.downcase}.rb") instance = plugin.new(@bot) connection.msg(.channel, "Reloading: #{plugin}") end end end end |