Sha256: 28df2079a453bee51bce642e1917bf048b20e09803d39377bc1c515799c490d3

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

require 'shopify_theme/filters/blacklist'
require 'shopify_theme/filters/whitelist'
require 'shopify_theme/filters/command_input'

module ShopifyTheme
  class FileFilters
    def initialize(*filters)
      raise ArgumentError, "Must have at least one filter to apply" unless filters.length > 0
      @filters = filters
    end

    def select(list)
      @filters.reduce(list) do |results, filter|
        filter.select(results)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shopify_theme-0.0.25 lib/shopify_theme/file_filters.rb
shopify_theme-0.0.24 lib/shopify_theme/file_filters.rb