class ContributorsStats::Base

Basis for ContributorsStats, includes logging and plugins support

Attributes

logger[RW]
options[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/contributors_stats/base.rb, line 7
def initialize(options = {})
  @logger = $stdout
  @logger = options.delete(:logger) if options[:logger]
  @options = options
end

Private Instance Methods

filter_options(type) click to toggle source
# File lib/contributors_stats/base.rb, line 15
def filter_options(type)
  @options.select do |key, value|
    plugins.class_exist?(type, key)
  end
end
log(text) click to toggle source
# File lib/contributors_stats/base.rb, line 25
def log(text)
  logger.respond_to?(:info) ? logger.info(text) : logger.puts(text)
end
plugins() click to toggle source
# File lib/contributors_stats/base.rb, line 21
def plugins
  @plugins ||= Pluginator.find("contributors_stats", extends: %i{first_class class_exist})
end