Sha256: 6669220bbb715a657628d8af3c0d4adcd89af2458f0feff6d4e1292c1a360cd7
Contents?: true
Size: 489 Bytes
Versions: 2
Compression:
Stored size: 489 Bytes
Contents
module HaravanTheme module Filters class Whitelist DEFAULT_WHITELIST = %w(layout/ assets/ config/ snippets/ templates/ locales/) attr_reader :patterns def initialize(pattern_strings=[]) @patterns = (pattern_strings.empty? ? DEFAULT_WHITELIST : pattern_strings).map { |pattern| Regexp.new(pattern) } end def select(list) list.select do |entry| patterns.any? { |pat| pat.match(entry) } end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
haravan_theme-0.0.26 | lib/haravan_theme/filters/whitelist.rb |
haravan_theme-0.0.25 | lib/haravan_theme/filters/whitelist.rb |