Class: Cacheinator

Inherits:
Object show all
Defined in:
lib/ceedling/cacheinator.rb

Overview

Ceedling - Test-Centered Build System for C
ThrowTheSwitch.org
Copyright (c) 2010-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
SPDX-License-Identifier: MIT

Instance Method Summary collapse

Instance Method Details

#cache_release_config(hash) ⇒ Object



16
17
18
# File 'lib/ceedling/cacheinator.rb', line 16

def cache_release_config(hash)
  @yaml_wrapper.dump( @file_path_utils.form_release_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE ), hash )
end

#cache_test_config(hash) ⇒ Object



12
13
14
# File 'lib/ceedling/cacheinator.rb', line 12

def cache_test_config(hash)
  @yaml_wrapper.dump( @file_path_utils.form_test_build_cache_path( INPUT_CONFIGURATION_CACHE_FILE), hash )
end

#diff_cached_release_config?(hash) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
51
# File 'lib/ceedling/cacheinator.rb', line 47

def diff_cached_release_config?(hash)
  cached_filepath = @file_path_utils.form_release_build_cache_path(INPUT_CONFIGURATION_CACHE_FILE)

  return @cacheinator_helper.diff_cached_config?( cached_filepath, hash )
end

#diff_cached_test_config?(hash) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
39
# File 'lib/ceedling/cacheinator.rb', line 35

def diff_cached_test_config?(hash)
  cached_filepath = @file_path_utils.form_test_build_cache_path(INPUT_CONFIGURATION_CACHE_FILE)

  return @cacheinator_helper.diff_cached_config?( cached_filepath, hash )
end

#diff_cached_test_defines?(files) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
44
45
# File 'lib/ceedling/cacheinator.rb', line 41

def diff_cached_test_defines?(files)
  cached_filepath = @file_path_utils.form_test_build_cache_path(DEFINES_DEPENDENCY_CACHE_FILE)

  return @cacheinator_helper.diff_cached_defines?( cached_filepath, files )
end

#diff_cached_test_file(filepath) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ceedling/cacheinator.rb', line 21

def diff_cached_test_file( filepath )
  cached_filepath = @file_path_utils.form_test_build_cache_path( filepath )

  if (@file_wrapper.exist?( cached_filepath ) and (!@file_wrapper.compare( filepath, cached_filepath )))
    @file_wrapper.cp(filepath, cached_filepath, {:preserve => false})
    return filepath
  elsif (!@file_wrapper.exist?( cached_filepath ))
    @file_wrapper.cp(filepath, cached_filepath, {:preserve => false}) 
    return filepath
  end

  return cached_filepath
end