lib/coderunner/run.rb in coderunner-0.16.6 vs lib/coderunner/run.rb in coderunner-0.16.7
- old
+ new
@@ -83,10 +83,16 @@
@runner.cache[:runs] ||= {}
@runner.cache[:runs][@id] ||= {}
@runner.cache[:runs][@id]
end
+# Empty the cache for this run
+def clear_cache
+ @runner.cache[:runs] ||= {}
+ @runner.cache[:runs][@id] = {}
+end
+
# The hard cache persists after the current program ceases because
# it is written in the .code_runner_run_data file.
# It will disappear if the -a or -A flags are specified at any point
# If you edit the hard cache you ''must'' call <tt>save</tt> afterwards
# or your changes may not be kept
@@ -218,11 +224,13 @@
# Analyse the directory of the run. This should be called from the directory where the files of the run are located. This method reads in the CodeRunner data already available in <tt>code_runner_info.rb</tt> and <tt>code_runner_results.rb</tt>, and then calls <tt>process_directory_code_specific</tt> which is defined in the code module.
def process_directory
# Clear the cache
- @runner.cache[:runs]||={}
- @runner.cache[:runs][@id] = {}
+ # EGH removed the two lines below because code module need the cache
+ # to last, e.g. if it contains references to other files
+ #@runner.cache[:runs]||={}
+ #@runner.cache[:runs][@id] = {}
logf(:process_directory)
raise CRFatal.new("Something has gone horribly wrong: runner.class is #{@runner.class} instead of CodeRunner") unless @runner.class.to_s == "CodeRunner"
begin
@code_runner_version = Version.new(File.read('.code_runner_version.txt'))