Sha256: 1a24552f5deb90710438e592702dc66794bee6d8cde84e6ac5657748bd92e826

Contents?: true

Size: 559 Bytes

Versions: 5

Compression:

Stored size: 559 Bytes

Contents

module AppPerfAgent
  module Plugin
    class << self
      def load_plugins
        pattern = File.join(File.dirname(__FILE__), 'plugin', '**', '*.rb')

        Dir.glob(pattern) do |f|
          begin
            require f
          rescue => e
            AppPerfAgent.logger.info "Error loading plugin '#{f}' : #{e}"
            AppPerfAgent.logger.info "#{e.backtrace.first}"
          end
        end
      end

      def plugins
        @plugins ||= ::AppPerfAgent::Plugin::Base
          .descendants
          .map(&:new)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_perf_agent-0.0.9 lib/app_perf_agent/plugin.rb
app_perf_agent-0.0.8 lib/app_perf_agent/plugin.rb
app_perf_agent-0.0.7 lib/app_perf_agent/plugin.rb
app_perf_agent-0.0.6 lib/app_perf_agent/plugin.rb
app_perf_agent-0.0.5 lib/app_perf_agent/plugin.rb