coderunner 0.12.4 → 0.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.4
1
+ 0.12.5
data/coderunner.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coderunner"
8
- s.version = "0.12.4"
8
+ s.version = "0.12.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock"]
data/lib/coderunner.rb CHANGED
@@ -202,6 +202,7 @@ EOF
202
202
  ["continue_in_new_folder", "cnf", 1, 'Make a new folder in the parent directory and copy all coderunner configuration files to that folder. If options j or f are specified, copy all matching runs to that new folder.', ['folder'], [:j, :f, :U, :N]],
203
203
  ["code_runner_execute", "crex", 1, 'Run (within the CodeRunner class) the fragment of Ruby code given.', ['Ruby fragment'], []],
204
204
  ["delete", "del", 0, 'Permanently erase all filtered runs.', [], [:j, :F, :U, :N]],
205
+ ["differences_between", "diff", 1, 'Print a table of all the differences between the input parameters of the given ids.', ['ids'], [:j, :F, :U, :N]],
205
206
  ["directory", "dir", 1, 'Print out the directory for the given run.', ['id'], []],
206
207
  ['dumb_film', "dfm", 0, 'Create a film of the specified graphkits using gnuplot "dumb" ASCII terminal.', [], [:F, :G, :g, :U, :N, :j, :f]],
207
208
  ["execute", "ex", 1, 'Run (at the top level) the fragment of Ruby code given.', ['Ruby fragment'], []],
@@ -76,6 +76,28 @@ class CodeRunner
76
76
  runner = fetch_runner(copts)
77
77
  runner.destroy
78
78
  end
79
+ def self.differences_between(ids, copts = {})
80
+ runner = fetch_runner(copts)
81
+ runs = runner.filtered_ids.map{|id| runner.run_list[id]}
82
+ vars = runner.run_class.rcp.variables.dup + runner.run_class.rcp.run_info.dup
83
+ vars.delete_if{|var| runs.map{|r| r.send(var)}.uniq.size == 1}
84
+ vars.delete :id
85
+ vars.delete :run_name
86
+ vars.delete :output_file
87
+ vars.delete :error_file
88
+ vars.delete :executable
89
+ vars.delete :comment
90
+ vars.delete :naming_pars
91
+ vars.delete :parameter_hash
92
+ vars.unshift :id
93
+ #vars.push 'File.basename(executable)'
94
+ table = vars.map{|var| [var] + runs.map{|r| str = r.instance_eval(var.to_s).to_s; str.size>10?str[0..9]:str} }
95
+ #vars[-1] = 'exec'
96
+ col_widths = table.map{|row| row.map{|v| v.to_s.size}}.inject{|o,n| o.zip(n).map{|a| a.max}}
97
+ eputs
98
+ table.each{|row| i=0; eputs row.map{|v| str = sprintf(" %#{col_widths[i]}s ", v.to_s); i+=1; str}.join('|'); eputs '-' * (col_widths.sum + col_widths.size*3 - 1) }
99
+ #p table, col_widths
100
+ end
79
101
 
80
102
  def self.dumb_film(copts = {})
81
103
  # process_copts(copts)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.4
4
+ version: 0.12.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: