Sha256: f568f89cbf0d2a7464852cb0abe0d5255efe1d441a798cfe03c49642b3631623

Contents?: true

Size: 807 Bytes

Versions: 28

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

require_relative './configuration_validator'

module Reek
  module Configuration
    #
    # Hash extension for the default directive.
    #
    module DefaultDirective
      include ConfigurationValidator

      # Adds the configuration for detectors as default directive.
      #
      # @param detectors_configuration [Hash] the configuration e.g.:
      #   {
      #    :IrresponsibleModule => {:enabled=>false},
      #    :Attribute => {:enabled=>true}
      #   }
      #
      # @return [self]
      def add(detectors_configuration)
        detectors_configuration.each do |name, configuration|
          detector = key_to_smell_detector(name)
          self[detector] = (self[detector] || {}).merge configuration
        end
        self
      end
    end
  end
end

Version data entries

28 entries across 26 versions & 2 rubygems

Version Path
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/configuration/default_directive.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/configuration/default_directive.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/configuration/default_directive.rb
reek-5.2.0 lib/reek/configuration/default_directive.rb
reek-5.1.0 lib/reek/configuration/default_directive.rb
reek-5.0.2 lib/reek/configuration/default_directive.rb
reek-5.0.1 lib/reek/configuration/default_directive.rb
reek-5.0.0 lib/reek/configuration/default_directive.rb