Sha256: cd8c2220ff76f43eeed87be0aa6f81dd6ee4e5946b43461836246906f0897a0e

Contents?: true

Size: 585 Bytes

Versions: 2

Compression:

Stored size: 585 Bytes

Contents

module Muzang
  module Plugins
    class LiveReload
      include Muzang::Plugins::Helpers

      def initialize(bot)
        @bot = bot
      end

      def call(connection, message)
        on_channel(message) do
          match(message, /^!reload$/) do
            @bot.plugins.each do |plugin, instance|
              Kernel.load("muzang-plugins/muzang-#{plugin.to_s.split("::").last.downcase}.rb")
              instance = plugin.new(@bot)
              connection.msg(message.channel, "Reloading: #{plugin}")
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
muzang-plugins-1.1.6 lib/muzang-plugins/muzang-livereload.rb
muzang-plugins-1.1.5 lib/muzang-plugins/muzang-livereload.rb