Class: Cucover::SourceFileCache

Inherits:
Object
  • Object
show all
Defined in:
lib/cucover.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


34
35
36
# File 'lib/cucover.rb', line 34

def any_dirty_files?
  not dirty_files.empty?
end

#exists?Boolean

Returns:

  • (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

#timeObject



38
39
40
# File 'lib/cucover.rb', line 38

def time
  File.mtime(cache_filename)
end