Class: Cucover::SourceFileCache
- Inherits:
-
Object
- Object
- Cucover::SourceFileCache
- Defined in:
- lib/cucover.rb
Instance Method Summary collapse
- #dirty_files ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(feature_file) ⇒ SourceFileCache
constructor
A new instance of SourceFileCache.
- #save(analyzed_files) ⇒ Object
- #time ⇒ Object
Constructor Details
#initialize(feature_file) ⇒ SourceFileCache
Returns a new instance of SourceFileCache.
10 11 12 |
# File 'lib/cucover.rb', line 10 def initialize(feature_file) @feature_file = feature_file end |
Instance Method Details
#dirty_files ⇒ Object
25 26 27 28 29 |
# File 'lib/cucover.rb', line 25 def dirty_files source_files.select do |source_file| File.mtime(Dir.pwd + '/' + source_file.strip) > time end end |
#exists? ⇒ Boolean
21 22 23 |
# File 'lib/cucover.rb', line 21 def exists? File.exist?(cache_filename) end |
#save(analyzed_files) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cucover.rb', line 14 def save(analyzed_files) FileUtils.mkdir_p File.dirname(cache_filename) File.open(cache_filename, "w") do |file| file.puts analyzed_files end end |
#time ⇒ Object
31 32 33 |
# File 'lib/cucover.rb', line 31 def time File.mtime(cache_filename) end |