lib/buff/ignore/ignore_file.rb in buff-ignore-1.1.1 vs lib/buff/ignore/ignore_file.rb in buff-ignore-1.2.0
- old
+ new
@@ -27,9 +27,12 @@
def initialize(filepath, options = {})
raise IgnoreFileNotFound.new(filepath) unless filepath && File.exists?(filepath)
@filepath = File.expand_path(filepath)
@options = options
+ if @options[:base].nil?
+ @options[:base] = File.directory?(filepath) ? filepath : File.dirname(filepath)
+ end
end
# Apply the ignore to the list, returning a new list of filtered files
#
# @example