Module: FastCov::FileTracker::FilePatch
- Defined in:
- lib/fast_cov/trackers/file_tracker.rb
Instance Method Summary collapse
Instance Method Details
#open(name, *args, **kwargs, &block) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/fast_cov/trackers/file_tracker.rb', line 31 def open(name, *args, **kwargs, &block) mode = args[0] is_read = mode.nil? || (mode.is_a?(String) && mode.start_with?("r")) || (mode.is_a?(Integer) && (mode & (File::WRONLY | File::RDWR)).zero?) super.tap do FastCov::FileTracker.record(File.(name)) if is_read end end |
#read(name, *args, **kwargs, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/fast_cov/trackers/file_tracker.rb', line 25 def read(name, *args, **kwargs, &block) super.tap do FastCov::FileTracker.record(File.(name)) end end |