Class: Cucover::SourceFileCache
- Inherits:
-
Object
- Object
- Cucover::SourceFileCache
- Defined in:
- lib/cucover.rb
Instance Method Summary collapse
- #any_dirty_files? ⇒ Boolean
- #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.
19 20 21 |
# File 'lib/cucover.rb', line 19 def initialize(feature_file) @feature_file = feature_file end |
Instance Method Details
#any_dirty_files? ⇒ Boolean
34 35 36 |
# File 'lib/cucover.rb', line 34 def any_dirty_files? not dirty_files.empty? end |
#exists? ⇒ Boolean
30 31 32 |
# File 'lib/cucover.rb', line 30 def exists? File.exist?(cache_filename) end |
#save(analyzed_files) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/cucover.rb', line 23 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
38 39 40 |
# File 'lib/cucover.rb', line 38 def time File.mtime(cache_filename) end |