Skip to content

Commit

Permalink
Fix for use for spring 4
Browse files Browse the repository at this point in the history
spring 4 changed, files, directories to be hashes instead of Sets ( rails/spring@7f4ddf9 )
  • Loading branch information
fcheung committed Jan 31, 2022
1 parent 5c8aa81 commit da75829
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/spring/watcher/listen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def subjects_changed
end

def watching?(file)
files.include?(file) || file.start_with?(*directories)
files.include?(file) || file.start_with?(*directories.keys)
end

def changed(modified, added, removed)
Expand All @@ -56,8 +56,8 @@ def changed(modified, added, removed)

def base_directories
([root] +
files.reject { |f| f.start_with? "#{root}/" }.map { |f| File.expand_path("#{f}/..") } +
directories.reject { |d| d.start_with? "#{root}/" }
files.keys.reject { |f| f.start_with? "#{root}/" }.map { |f| File.expand_path("#{f}/..") } +
directories.keys.reject { |d| d.start_with? "#{root}/" }
).uniq.map { |path| Pathname.new(path) }
end
end
Expand Down
2 changes: 1 addition & 1 deletion spring-watcher-listen.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake"
spec.add_development_dependency "activesupport"

spec.add_dependency "spring", ">= 1.2", "< 4.0"
spec.add_dependency "spring", ">= 4", "< 5"
spec.add_dependency "listen", ">= 2.7", '< 4.0'
end

0 comments on commit da75829

Please sign in to comment.