Sha256: f078f8f9131a7e5d5f62fd8b43955cb495f2fd4290d020c718347ffad1d8b498

Contents?: true

Size: 523 Bytes

Versions: 12

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true
module ThemeCheck
  class Checks < Array
    def call(method, *args)
      each do |check|
        if check.respond_to?(method) && !check.ignored?
          check.send(method, *args)
        end
      end
    end

    def always_enabled
      self.class.new(reject(&:can_disable?))
    end

    def except_for(disabled_checks)
      still_enabled = reject { |check| disabled_checks.all.include?(check.code_name) }

      self.class.new((always_enabled + still_enabled).uniq)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
theme-check-0.8.0 lib/theme_check/checks.rb
theme-check-0.7.3 lib/theme_check/checks.rb
theme-check-0.7.2 lib/theme_check/checks.rb
theme-check-0.7.1 lib/theme_check/checks.rb
theme-check-0.7.0 lib/theme_check/checks.rb
theme-check-0.6.0 lib/theme_check/checks.rb
theme-check-0.5.0 lib/theme_check/checks.rb
theme-check-0.4.0 lib/theme_check/checks.rb
theme-check-0.3.3 lib/theme_check/checks.rb
theme-check-0.3.2 lib/theme_check/checks.rb
theme-check-0.3.1 lib/theme_check/checks.rb
theme-check-0.3.0 lib/theme_check/checks.rb