diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 837f6c963c..02ca3b2990 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -122,10 +122,12 @@ GEM rubocop ruby-macho (2.5.0) ruby-progressbar (1.10.1) - simplecov (0.19.1) + simplecov (0.20.0) docile (~> 1.1) simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov_json_formatter (0.1.2) sorbet (0.5.6111) sorbet-static (= 0.5.6111) sorbet-runtime (0.5.6111) diff --git a/Library/Homebrew/sorbet/rbi/gems/simplecov@0.19.1.rbi b/Library/Homebrew/sorbet/rbi/gems/simplecov@0.20.0.rbi similarity index 100% rename from Library/Homebrew/sorbet/rbi/gems/simplecov@0.19.1.rbi rename to Library/Homebrew/sorbet/rbi/gems/simplecov@0.20.0.rbi diff --git a/Library/Homebrew/sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi b/Library/Homebrew/sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi new file mode 100644 index 0000000000..9c33188937 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/simplecov_json_formatter@0.1.2.rbi @@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `simplecov_json_formatter` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index 22bfba4868..9c648e96ae 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -27765,6 +27765,13 @@ end class SimpleCov::Formatter::HTMLFormatter end +class SimpleCov::Formatter::JSONFormatter + def format(result); end +end + +class SimpleCov::Formatter::JSONFormatter +end + class SimpleCov::Formatter::MultiFormatter end @@ -27789,6 +27796,7 @@ class SimpleCov::Formatter::SimpleFormatter end module SimpleCov::Formatter + def self.from_env(env); end end module SimpleCov::LastRun @@ -28140,6 +28148,40 @@ module SimpleCov def self.write_last_run(result); end end +module SimpleCovJSONFormatter +end + +class SimpleCovJSONFormatter::ResultExporter + def export(); end + + def initialize(result_hash); end + FILENAME = ::T.let(nil, ::T.untyped) +end + +class SimpleCovJSONFormatter::ResultExporter +end + +class SimpleCovJSONFormatter::ResultHashFormatter + def format(); end + + def initialize(result); end +end + +class SimpleCovJSONFormatter::ResultHashFormatter +end + +class SimpleCovJSONFormatter::SourceFileFormatter + def format(); end + + def initialize(source_file); end +end + +class SimpleCovJSONFormatter::SourceFileFormatter +end + +module SimpleCovJSONFormatter +end + module Singleton def _dump(depth=T.unsafe(nil)); end diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 723f666306..fe0a7472f6 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -19,7 +19,8 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwi $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/json-2.3.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.3.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-0.19.1/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov_json_formatter-0.1.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-0.20.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/codecov-0.2.12/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/coderay-1.1.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/colorize-0.8.1/lib" diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter.rb new file mode 100644 index 0000000000..6f25f5dd31 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require 'simplecov_json_formatter/result_hash_formatter' +require 'simplecov_json_formatter/result_exporter' +require 'json' + +module SimpleCov + module Formatter + class JSONFormatter + def format(result) + result_hash = format_result(result) + + export_formatted_result(result_hash) + + puts output_message(result) + end + + private + + def format_result(result) + result_hash_formater = SimpleCovJSONFormatter::ResultHashFormatter.new(result) + result_hash_formater.format + end + + def export_formatted_result(result_hash) + result_exporter = SimpleCovJSONFormatter::ResultExporter.new(result_hash) + result_exporter.export + end + + def output_message(result) + "JSON Coverage report generated for #{result.command_name} to #{SimpleCov.coverage_path}. \ + #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered." + end + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_exporter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_exporter.rb new file mode 100644 index 0000000000..65d2ff603a --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_exporter.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module SimpleCovJSONFormatter + class ResultExporter + FILENAME = 'coverage.json' + + def initialize(result_hash) + @result = result_hash + end + + def export + File.open(export_path, 'w') do |file| + file << json_result + end + end + + private + + def json_result + JSON.pretty_generate(@result) + end + + def export_path + File.join(SimpleCov.coverage_path, FILENAME) + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_hash_formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_hash_formatter.rb new file mode 100644 index 0000000000..9dfe47da24 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/result_hash_formatter.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require 'simplecov_json_formatter/source_file_formatter' + +module SimpleCovJSONFormatter + class ResultHashFormatter + def initialize(result) + @result = result + end + + def format + @result.files.each do |source_file| + formatted_result[:coverage][source_file.filename] = + format_source_file(source_file) + end + + formatted_result + end + + private + + def formatted_result + @formatted_result ||= { + meta: { + simplecov_version: SimpleCov::VERSION + }, + coverage: {} + } + end + + def format_source_file(source_file) + source_file_formatter = SourceFileFormatter.new(source_file) + source_file_formatter.format + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/source_file_formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/source_file_formatter.rb new file mode 100644 index 0000000000..3564c791ae --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/source_file_formatter.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module SimpleCovJSONFormatter + class SourceFileFormatter + def initialize(source_file) + @source_file = source_file + end + + def format + if SimpleCov.branch_coverage? + line_coverage.merge(branch_coverage) + else + line_coverage + end + end + + private + + def line_coverage + @line_coverage || { + lines: lines + } + end + + def branch_coverage + { + branches: branches + } + end + + def lines + lines = [] + @source_file.lines.each do |line| + lines << parse_line(line) + end + + lines + end + + def branches + branches = [] + @source_file.branches.each do |branch| + branches << parse_branch(branch) + end + + branches + end + + def parse_line(line) + return line.coverage unless line.skipped? + + 'ignored' + end + + def parse_branch(branch) + { + type: branch.type, + start_line: branch.start_line, + end_line: branch.end_line, + coverage: parse_line(branch) + } + end + end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/version.rb new file mode 100644 index 0000000000..82d6c59729 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/simplecov_json_formatter-0.1.2/lib/simplecov_json_formatter/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module SimpleCovJSONFormatter + VERSION = '0.1.2' +end