Sha256: 0e80f44ce4f64a079e563db92888065a00e944c10390db0129bb05520082c036

Contents?: true

Size: 515 Bytes

Versions: 18

Compression:

Stored size: 515 Bytes

Contents

require "danger/helpers/array_subclass"

module Danger
  class FileList
    include Helpers::ArraySubclass

    # 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|
        unless current.nil?
          return true if File.fnmatch(pattern, current, File::FNM_EXTGLOB) || pattern == current
        end
      end
      return false
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
danger-9.1.0 lib/danger/core_ext/file_list.rb
danger-9.0.0 lib/danger/core_ext/file_list.rb
danger-8.6.1 lib/danger/core_ext/file_list.rb
danger-8.6.0 lib/danger/core_ext/file_list.rb
danger-8.5.0 lib/danger/core_ext/file_list.rb
danger-8.4.5 lib/danger/core_ext/file_list.rb
danger-8.4.4 lib/danger/core_ext/file_list.rb
danger-8.4.3 lib/danger/core_ext/file_list.rb
danger-8.4.2 lib/danger/core_ext/file_list.rb
danger-8.4.1 lib/danger/core_ext/file_list.rb
danger-8.4.0 lib/danger/core_ext/file_list.rb
danger-8.3.1 lib/danger/core_ext/file_list.rb
danger-8.2.3 lib/danger/core_ext/file_list.rb
danger-8.2.2 lib/danger/core_ext/file_list.rb
danger-8.2.1 lib/danger/core_ext/file_list.rb
danger-8.2.0 lib/danger/core_ext/file_list.rb
danger-8.1.0 lib/danger/core_ext/file_list.rb
danger-8.0.6 lib/danger/core_ext/file_list.rb