Sha256: 10794427fc8d08087ba797e81a9599c6afdfbde75c5b4d7a53f5e3ef60034997

Contents?: true

Size: 454 Bytes

Versions: 8

Compression:

Stored size: 454 Bytes

Contents

require "danger/helpers/array_subclass"

module Danger
  class FileList
    include Helpers::ArraySublcass

    # Information about pattern: http://ruby-doc.org/core-2.2.0/File.html#method-c-fnmatch
    # e.g. "**/something.*" for any file called something with any extension
    def include?(pattern)
      self.each do |current|
        return true if File.fnmatch(pattern, current) || pattern == current
      end
      return false
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
danger-5.5.11 lib/danger/core_ext/file_list.rb
danger-5.5.10 lib/danger/core_ext/file_list.rb
danger-5.5.9 lib/danger/core_ext/file_list.rb
danger-5.5.8 lib/danger/core_ext/file_list.rb
danger-5.5.7 lib/danger/core_ext/file_list.rb
danger-5.5.6 lib/danger/core_ext/file_list.rb
danger-5.5.5 lib/danger/core_ext/file_list.rb
danger-5.5.4 lib/danger/core_ext/file_list.rb