<commit_before># The CocoaPods check command.

# The CocoaPods namespace
module Pod
  class Command
    class Check < Command
      self.summary = <<-SUMMARY
          Displays which Pods would be changed by running `pod install`
      SUMMARY

      self.description = <<-DESC
          Compares the Pod lockfile with the manifest lockfile and shows
          any differences. In non-verbose mode, '~' indicates an existing Pod
          will be updated to the version specified in Podfile.lock and '+'
          indicates a missing Pod will be installed.
      DESC

      self.arguments = []

      def self.options
        [
          ['--verbose', 'Show change details.']
        ].concat(super)
      end

      def initialize(argv)
        @check_command_verbose = argv.flag?('verbose')
        super
      end

      def run
        unless config.lockfile
          raise Informative, 'Missing Podfile.lock!'
        end

        development_pods = find_development_pods(config.podfile)
        results = find_differences(config, development_pods)
        print_results(results)
      end

      def find_development_pods(podfile)
        development_pods = {}
        podfile.dependencies.each do |dependency|
          development_pods[dependency.name] = dependency.external_source if dependency.external?
        end
        development_pods
      end

      def find_differences(config, development_pods)
        all_pod_names = config.lockfile.pod_names
        all_pod_names.concat development_pods.keys

        all_pod_names.sort.uniq.map do |spec_name|
          locked_version = config.lockfile.version(spec_name)

          # If no manifest, assume Pod hasn't been installed
          if config.sandbox.manifest
            manifest_version = config.sandbox.manifest.version(spec_name)
          else
            manifest_version = nil
          end

          # If this Pod is installed
          if manifest_version
            # If this is a development pod do a modified time check
            if development_pods[spec_name] != nil
              newer_files = get_files_newer_than_lockfile_for_podspec(config, development_pods[spec_name])
              if newer_files.any?
                changed_development_result(spec_name, newer_files)
              end
            # Otherwise just compare versions
            elsif locked_version != manifest_version
              changed_result(spec_name, manifest_version, locked_version)
            end
<commit_msg>Use a CP check for whether a dependency is a dev pod<commit_after># The CocoaPods check command.

# The CocoaPods namespace
module Pod
  class Command
    class Check < Command
      self.summary = <<-SUMMARY
          Displays which Pods would be changed by running `pod install`
      SUMMARY

      self.description = <<-DESC
          Compares the Pod lockfile with the manifest lockfile and shows
          any differences. In non-verbose mode, '~' indicates an existing Pod
          will be updated to the version specified in Podfile.lock and '+'
          indicates a missing Pod will be installed.
      DESC

      self.arguments = []

      def self.options
        [
          ['--verbose', 'Show change details.']
        ].concat(super)
      end

      def initialize(argv)
        @check_command_verbose = argv.flag?('verbose')
        super
      end

      def run
        unless config.lockfile
          raise Informative, 'Missing Podfile.lock!'
        end

        development_pods = find_development_pods(config.podfile)
        results = find_differences(config, development_pods)
        print_results(results)
      end

      def find_development_pods(podfile)
        development_pods = {}
        podfile.dependencies.each do |dependency|
          development_pods[dependency.name] = dependency.external_source if dependency.local?
        end
        development_pods
      end

      def find_differences(config, development_pods)
        all_pod_names = config.lockfile.pod_names
        all_pod_names.concat development_pods.keys

        all_pod_names.sort.uniq.map do |spec_name|
          locked_version = config.lockfile.version(spec_name)

          # If no manifest, assume Pod hasn't been installed
          if config.sandbox.manifest
            manifest_version = config.sandbox.manifest.version(spec_name)
          else
            manifest_version = nil
          end

          # If this Pod is installed
          if manifest_version
            # If this is a development pod do a modified time check
            if development_pods[spec_name] != nil
              newer_files = get_files_newer_than_lockfile_for_podspec(config, development_pods[spec_name])
              if newer_files.any?
                changed_development_result(spec_name, newer_files)
              end
            # Otherwise just compare versions
            elsif locked_version != manifest_version
              changed_result(spec_name, manifest_version, locked_version)
            end

{'fraction_non_alphanumeric': 0.0584, 'fraction_numerical': 0.0, 'mean_word_length': 2.181297709923664, 'pattern_counts': {'":': 0, '<': 13, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4004664', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1275, 'n_words': 369}