<commit_before>module Pod
  class Command
    class Install < Command
      def self.banner
%{Installing dependencies of a pod spec:

    $ pod install [NAME] [PROJECT]

      Downloads all dependencies of the specified podspec file `NAME',
      creates an Xcode Pods library project in `./Pods', and sets up `PROJECT' 
      to use the specified pods (if `PROJECT' is given). In case `NAME' is
      omitted it defaults to either `Podfile' or `*.podspec' in the current
      working directory.
}
      end

      def self.options
        "    --no-clean  Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" +
        super
      end

      def initialize(argv)
        config.clean = !argv.option('--no-clean')
        projpath = argv.shift_argument
        projpath =~ /\.xcodeproj$/ ? @projpath = projpath : podspec = projpath
        @podspec = Pathname.new(podspec) if podspec
        @projpath ||= argv.shift_argument
        super unless argv.empty?
      end

      def run
        spec = nil
        if @podspec
          if @podspec.exist?
            spec = Specification.from_file(@podspec)
          else
            raise Informative, "The specified podspec `#{@podspec}' doesn't exist."
          end
        else
          unless spec = config.rootspec
            raise Informative, "No `Podfile' or `.podspec' file found in the current working directory."
          end
        end
        installer = Installer.new(spec)
        installer.install!
        installer.configure_project(@projpath) if @projpath
      end
    end
  end
end<commit_msg>Better detect project given to `pod install`<commit_after>module Pod
  class Command
    class Install < Command
      def self.banner
%{Installing dependencies of a pod spec:

    $ pod install [NAME] [PROJECT]

      Downloads all dependencies of the specified podspec file `NAME',
      creates an Xcode Pods library project in `./Pods', and sets up `PROJECT' 
      to use the specified pods (if `PROJECT' is given). In case `NAME' is
      omitted it defaults to either `Podfile' or `*.podspec' in the current
      working directory.
}
      end

      def self.options
        "    --no-clean  Leave SCM dirs like `.git' and `.svn' in tact after downloading\n" +
        super
      end

      def initialize(argv)
        config.clean = !argv.option('--no-clean')
        projpath = argv.shift_argument
        projpath =~ /\.xcodeproj\/?$/ ? @projpath = projpath : podspec = projpath
        @podspec = Pathname.new(podspec) if podspec
        @projpath ||= argv.shift_argument
        super unless argv.empty?
      end

      def run
        spec = nil
        if @podspec
          if @podspec.exist?
            spec = Specification.from_file(@podspec)
          else
            raise Informative, "The specified podspec `#{@podspec}' doesn't exist."
          end
        else
          unless spec = config.rootspec
            raise Informative, "No `Podfile' or `.podspec' file found in the current working directory."
          end
        end
        installer = Installer.new(spec)
        installer.install!
        installer.configure_project(@projpath) if @projpath
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0853125, 'fraction_numerical': 0.0, 'mean_word_length': 2.07492795389049, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2954079', 'n_tokens_mistral': 936, 'n_tokens_neox': 904, 'n_words': 313}