Class: Pod::Command::Repo

Inherits:
Pod::Command show all
Extended by:
Executable
Defined in:
lib/cocoapods/command/repo.rb,
lib/cocoapods/command/repo/push.rb

Direct Known Subclasses

Add, Lint, List, Push, Remove, Update

Defined Under Namespace

Classes: Add, Lint, List, Push, Remove, Update

Instance Method Summary collapse

Methods included from Executable

executable, execute_command

Methods inherited from Pod::Command

#initialize, options, parse, report_error, run, verify_git_version!

Methods included from Pod::Config::Mixin

#config

Constructor Details

This class inherits a constructor from Pod::Command

Instance Method Details

#branch_nameString

Returns the branch name (i.e. master).

Returns:

  • (String)

    The name of the current branch.



294
295
296
# File 'lib/cocoapods/command/repo.rb', line 294

def branch_name
  `git name-rev --name-only HEAD`.strip
end

#branch_remote_name(branch_name) ⇒ String

Returns the branch remote name (i.e. origin).

Parameters:

  • branch_name (#to_s)

    The branch name to look for the remote name.

Returns:

  • (String)

    The given branch’s remote name.



305
306
307
# File 'lib/cocoapods/command/repo.rb', line 305

def branch_remote_name(branch_name)
  `git config branch.#{branch_name}.remote`.strip
end

#dirObject



286
287
288
# File 'lib/cocoapods/command/repo.rb', line 286

def dir
  config.repos_dir + @name
end

#url_of_git_repo(remote_name) ⇒ String

Returns the url of the given remote name (i.e. [email protected]:CocoaPods/Specs.git).

Parameters:

  • remote_name (#to_s)

    The branch remote name to look for the url.

Returns:

  • (String)

    The URL of the given remote.



317
318
319
# File 'lib/cocoapods/command/repo.rb', line 317

def url_of_git_repo(remote_name)
  `git config remote.#{remote_name}.url`.strip
end