Sha256: 28ff9037dabb4bca6eb65fd4667f653e290f316d306286266779bd650ec65d44

Contents?: true

Size: 459 Bytes

Versions: 5

Compression:

Stored size: 459 Bytes

Contents

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.downcase}.rb")
          instance = plugin.new(@bot)
          connection.msg(message.channel, "Reloading: #{plugin}")
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
muzang-plugins-1.1.4 lib/muzang-plugins/muzang-livereload.rb
muzang-plugins-1.1.3 lib/muzang-plugins/muzang-livereload.rb
muzang-plugins-1.1.2 lib/muzang-plugins/muzang-livereload.rb
muzang-plugins-1.1.1 lib/muzang-plugins/muzang-livereload.rb
muzang-plugins-1.1.0 lib/muzang-plugins/muzang-livereload.rb