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
reek-6.1.4 lib/reek/configuration/default_directive.rb
reek-6.1.3 lib/reek/configuration/default_directive.rb
reek-6.1.2 lib/reek/configuration/default_directive.rb
reek-6.1.1 lib/reek/configuration/default_directive.rb
reek-6.1.0 lib/reek/configuration/default_directive.rb
reek-6.0.6 lib/reek/configuration/default_directive.rb
reek-6.0.5 lib/reek/configuration/default_directive.rb
reek-6.0.4 lib/reek/configuration/default_directive.rb
reek-6.0.3 lib/reek/configuration/default_directive.rb
reek-6.0.2 lib/reek/configuration/default_directive.rb
reek-6.0.1 lib/reek/configuration/default_directive.rb
reek-6.0.0 lib/reek/configuration/default_directive.rb
reek-5.6.0 lib/reek/configuration/default_directive.rb
reek-5.5.0 lib/reek/configuration/default_directive.rb
reek-5.4.1 lib/reek/configuration/default_directive.rb
reek-5.4.0 lib/reek/configuration/default_directive.rb
reek-5.3.2 lib/reek/configuration/default_directive.rb
reek-5.3.1 lib/reek/configuration/default_directive.rb
reek-5.3.0 lib/reek/configuration/default_directive.rb
config_gems_initialization_aim-0.1.4 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