lib/compare.rb | 16 ++++++++++------ lib/compare_matrixes.rb | 41 ++++++++++++++++++++++++++++------------- lib/matrix2.rb | 15 +++++++++++---- 3 files changed, 49 insertions(+), 23 deletions(-)
diff --git a/lib/compare.rb b/lib/compare.rb index 645f682..813e08c 100644 --- a/lib/compare.rb +++ b/lib/compare.rb
def parse_argv(argv, common_conditions) @@ -37,12 +37,16 @@ end
def create_matrices_list(conditions) matrices_list = []
- suites_list = [] es = ESQuery.new(ES_HOST, ES_PORT) conditions.each do |condition| query_results = es.multi_field_query(condition)
- matrices_list << combine_query_data(query_results)
- matrix, suites = combine_query_data(query_results)
- matrices_list << matrix
- suites_list.concat(suites) end
- matrices_list
- return matrices_list, suites_list
end
# ------------------------------------------------------------------------------------------- @@ -58,8 +62,8 @@ end def compare_group(argv, dimensions, options) conditions = parse_conditions(argv) dims = dimensions.split(' ')
- groups_matrices = create_groups_matrices_list(conditions, dims)
- compare_group_matrices(groups_matrices, options)
- groups_matrices, suites_list = create_groups_matrices_list(conditions, dims)
- compare_group_matrices(groups_matrices, suites_list, options)
end
def create_groups_matrices_list(conditions, dims) diff --git a/lib/compare_matrixes.rb b/lib/compare_matrixes.rb index 119d42d..bd1e646 100644 --- a/lib/compare_matrixes.rb +++ b/lib/compare_matrixes.rb end
-def compare_matrixes(matrixes_list, matrixes_titles = nil, group_key = nil, options: {}) +def compare_matrixes(matrixes_list, suites_list, matrixes_titles = nil, group_key = nil, options: {})
suites_list => suite_list lib/matrix2.rb you had defined suite_list for each matrix_list so should be consistent of it
# compare matrix in matrixes_list and print info # @matrixes_list: list consisting of matrix # @matrixes_titles: number or dimension of matrix @@ -208,6 +208,7 @@ def compare_matrixes(matrixes_list, matrixes_titles = nil, group_key = nil, opti result_str = group_key ? "\n\n\n\n\n" + group_key : '' result_str += get_all_result_str( matrixes_values,
- suites_list, matrixes_titles, matrixes_list.size, options[:theme]
@@ -382,7 +383,7 @@ end # compare each matrices_list within pre dimension of group matrices # input: group matrices # output: pre compare result of each group -def compare_group_matrices(group_matrices, options) +def compare_group_matrices(group_matrices, suites_list, options)
ditto
result_str = '' group_matrices.each do |k, v| matrices_list = [] @@ -392,9 +393,9 @@ def compare_group_matrices(group_matrices, options) matrices_list << matrix end if options[:no_print]
result_str += compare_matrixes(matrices_list, matrices_titles, k, options: options)
elseresult_str += compare_matrixes(matrices_list, suites_list.shift, matrices_titles, k, options: options)
print compare_matrixes(matrices_list, matrices_titles, k, options: options)
print compare_matrixes(matrices_list, suites_list.shift, matrices_titles, k, options: options)
ditto
Thanks, Weitao
end