<commit_before>require 'cocoapods_testing'
require 'slather'
require 'xcodeproj'

module Pod
  class Command
    class Lib
      # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
      #       in the `plugins.json` file, once your plugin is released.
      #
      class Coverage < Lib
        self.summary = 'Generate code coverage statistics for Pods.'

        self.description = <<-DESC
          Longer description of cocoapods-coverage.
        DESC

        def run
          test_with_coverage

          Pod::Command::Lib::Testing.handle_workspaces_in_dir(Pathname.pwd) do |workspace, _path|
            workspace.file_references.each do |file_ref|
              next unless file_ref.path.end_with? '.xcodeproj'
              next if file_ref.path == 'Pods/Pods.xcodeproj'
              slather(file_ref.path)
            end
          end
        end

        def slather(project_path)
          project = Slather::Project.open(project_path)

          if ENV['TRAVIS'] == 'true'
            project.coverage_service = :coveralls
          else
            project.coverage_service = :terminal
          end

          project.post

          project.coverage_service = :gutter_json
          project.post
        end

        def test_with_coverage
          args = CLAide::ARGV.new(['GCC_GENERATE_TEST_COVERAGE_FILES=YES',
                                   'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES'])
          tester = Pod::Command::Lib::Testing.new(args)
          tester.run
        end
      end
    end
  end
end
<commit_msg>Ignore errors regarding not found Xcode projects.<commit_after>require 'cocoapods_testing'
require 'slather'
require 'xcodeproj'

module Pod
  class Command
    class Lib
      # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
      #       in the `plugins.json` file, once your plugin is released.
      #
      class Coverage < Lib
        self.summary = 'Generate code coverage statistics for Pods.'

        self.description = <<-DESC
          Longer description of cocoapods-coverage.
        DESC

        def run
          test_with_coverage

          Pod::Command::Lib::Testing.handle_workspaces_in_dir(Pathname.pwd) do |workspace, _path|
            workspace.file_references.each do |file_ref|
              next unless file_ref.path.end_with? '.xcodeproj'
              next if file_ref.path == 'Pods/Pods.xcodeproj'
              slather(file_ref.path)
            end
          end
        end

        def slather(project_path)
          return if not File.directory?(project_path)
          project = Slather::Project.open(project_path)

          if ENV['TRAVIS'] == 'true'
            project.coverage_service = :coveralls
          else
            project.coverage_service = :terminal
          end

          project.post

          project.coverage_service = :gutter_json
          project.post
        end

        def test_with_coverage
          args = CLAide::ARGV.new(['GCC_GENERATE_TEST_COVERAGE_FILES=YES',
                                   'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES'])
          tester = Pod::Command::Lib::Testing.new(args)
          tester.run
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07589006870705808, 'fraction_numerical': 0.0, 'mean_word_length': 1.9091734786557675, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '222090', 'n_tokens_mistral': 969, 'n_tokens_neox': 931, 'n_words': 212}