Class: Danger::FileList

Inherits:
Object
  • Object
show all
Includes:
Helpers::ArraySubclass
Defined in:
lib/danger/core_ext/file_list.rb

Instance Method Summary collapse

Methods included from Helpers::ArraySubclass

#<=>, #initialize, #kind_of?, #method_missing, #respond_to_missing?, #to_a, #to_ary

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Danger::Helpers::ArraySubclass

Instance Method Details

#include?(pattern) ⇒ Boolean

Information about pattern: ruby-doc.org/core-2.2.0/File.html#method-c-fnmatch e.g. “*/something.” for any file called something with any extension

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
# File 'lib/danger/core_ext/file_list.rb', line 9

def include?(pattern)
  self.each do |current|
    if !current.nil? && (File.fnmatch(pattern, current, File::FNM_EXTGLOB) || pattern == current)
      return true
    end
  end
  return false
end