Class: KeepUp::FileFilter
- Inherits:
-
Object
- Object
- KeepUp::FileFilter
- Defined in:
- lib/keep_up/file_filter.rb
Overview
Base class for file filters
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.apply_to_file(file, dependency) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/keep_up/file_filter.rb', line 6 def self.apply_to_file(file, dependency) contents = File.read(file) updated_contents = apply(contents, dependency) if contents == updated_contents false else File.write file, updated_contents true end end |