lib/cocoapods/command/push.rb
def add_specs_to_repo
        UI.puts "\nAdding the #{'spec'.pluralize(count)} to the `#{@repo}' repo\n".yellow
        podspec_files.each do |spec_file|
          spec = Pod::Specification.from_file(spec_file)
          output_path = File.join(repo_dir, spec.name, spec.version.to_s)
          if Pathname.new(output_path).exist?
            message = "[Fix] #{spec}"
          elsif Pathname.new(File.join(repo_dir, spec.name)).exist?
            message = "[Update] #{spec}"
          else
            message = "[Add] #{spec}"
          end
          UI.puts " - #{message}"

          FileUtils.mkdir_p(output_path)
          FileUtils.cp(Pathname.new(spec.name+'.podspec'), output_path)
          Dir.chdir(repo_dir) do
            git!("add #{spec.name}")
            git!("commit --no-verify -m '#{message}'")
          end
        end
      end
# Commits the podspecs to the source, which should be a git repo.
#
# @note   The pre commit hook of the repo is skipped as the podspecs have
#         already been linted.
#
# @todo   Raise if the source is not under git source control.
#
# @return [void]
#
Commits the podspecs to the source, which should be a git repo.
Commits the podspecs to the source which should be a git repo .
def add_specs_to_repo
        UI.puts "\nAdding the #{'spec'.pluralize(count)} to the `#{@repo}' repo\n".yellow
        podspec_files.each do |spec_file|
          spec = Pod::Specification.from_file(spec_file)
          output_path = File.join(repo_dir, spec.name, spec.version.to_s)
          if Pathname.new(output_path).exist?
            message = "[Fix] #{spec}"
          elsif Pathname.new(File.join(repo_dir, spec.name)).exist?
            message = "[Update] #{spec}"
          else
            message = "[Add] #{spec}"
          end
          UI.puts " - #{message}"
          FileUtils.mkdir_p(output_path)
          FileUtils.cp(Pathname.new(spec.name+'.podspec'), output_path)
          Dir.chdir(repo_dir) do
            git!("add #{spec.name}")
            git!("commit --no-verify -m '#{message}'")
          end
        end
      end
def add_specs_to_repo UI . puts "\nAdding the #{'spec'.pluralize(count)} to the `#{@repo}' repo\n" . yellow podspec_files . each do | spec_file | spec = Pod :: Specification . from_file ( spec_file ) output_path = File . join ( repo_dir , spec . name , spec . version . to_s ) if Pathname . new ( output_path ) . exist? message = "[Fix] #{spec}" elsif Pathname . new ( File . join ( repo_dir , spec . name ) ) . exist? message = "[Update] #{spec}" else message = "[Add] #{spec}" end UI . puts " - #{message}" FileUtils . mkdir_p ( output_path ) FileUtils . cp ( Pathname . new ( spec . name + '.podspec' ) , output_path ) Dir . chdir ( repo_dir ) do git! ( "add #{spec.name}" ) git! ( "commit --no-verify -m '#{message}'" ) end end end
Commits the podspecs to the source, which should be a git repo.
Commits the podspecs to the source which should be a git repo .
None
void
note
The pre commit hook of the repo is skipped as the podspecs have already been linted.
The pre commit hook of the repo is skipped as the podspecs have already been linted .
todo
Raise if the source is not under git source control.
Raise if the source is not under git source control .