Sha256: fd5577d1b66b8fdce0035579d10da57bc5f073767d4d9ce2796362218f1db0c5

Contents?: true

Size: 312 Bytes

Versions: 8

Compression:

Stored size: 312 Bytes

Contents

class Array
  def sfilter *filters
    filters = filters.first if filters.size == 1 and filters.first.is_a?(Array)
    filters.collect!{|o| o.is_a?(Regexp) ? o : /#{Regexp.escape o}/}
    self.select do |line|
      !filters.any?{|re| line =~ re}
    end
  end
  
  def self.wrap value
    Array(value)
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
ruby_ext-0.4.11 lib/ruby_ext/array.rb
ruby_ext-0.4.10 lib/ruby_ext/array.rb
ruby_ext-0.4.9 lib/ruby_ext/array.rb
ruby_ext-0.4.7 lib/ruby_ext/array.rb
ruby_ext-0.4.6 lib/ruby_ext/array.rb
ruby-ext-0.4.6 lib/ruby_ext/array.rb
ruby-ext-0.4.4 lib/ruby_ext/array.rb
ruby-ext-0.4.3 lib/ruby_ext/array.rb