Class: RubyBranchCoverage

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_branch_coverage.rb,
lib/ruby_branch_coverage/engine.rb,
lib/ruby_branch_coverage/version.rb

Overview

rubocop:disable Style/Documentation

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
'1.0.0'

Instance Method Summary collapse

Instance Method Details

#read_json_and_getxml(filepath, parallelism_count = 0, parallelism_processors = 0) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_branch_coverage.rb', line 9

def read_json_and_getxml(filepath, parallelism_count = 0, parallelism_processors = 0)
  file = File.read(filepath)
  data_hash = JSON.parse(file)

  file_elements = if parallelism_count != 0 || parallelism_processors != 0
                    extract_file_elements_using_parallelism_args(data_hash, parallelism_count, parallelism_processors)
                  else
                    extract_file_elements(data_hash)
                  end

  create_xml(file_elements)
  file_elements.size.positive?
end