Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
198e3d04
Commit
198e3d04
authored
Apr 12, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3386 from CocoaPods/kylef/repo-list
[pod repo list] Fix issue showing the URL for git
parents
2fcf6c17
3a0c01c1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
48 deletions
+60
-48
CHANGELOG.md
CHANGELOG.md
+7
-0
repo.rb
lib/cocoapods/command/repo.rb
+0
-31
list.rb
lib/cocoapods/command/repo/list.rb
+15
-17
list_spec.rb
spec/functional/command/repo/list_spec.rb
+38
-0
No files found.
CHANGELOG.md
View file @
198e3d04
...
...
@@ -13,12 +13,19 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
#3145
](
https://github.com/CocoaPods/CocoaPods/issues/3145
)
*
Show the source URI for local Pod specification repositories in
`pod repo list`
.
[
Kyle Fuller
](
https://github.com/kylef
)
##### Bug Fixes
*
Do not pass code-sign arguments to xcodebuild when linting OS X targets.
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3310
](
https://github.com/CocoaPods/CocoaPods/issues/3310
)
*
Fixes an issue showing the URL to remote resources in
`pod repo list`
.
[
Kyle Fuller
](
https://github.com/kylef
)
## 0.36.3
...
...
lib/cocoapods/command/repo.rb
View file @
198e3d04
...
...
@@ -24,37 +24,6 @@ module Pod
def
dir
config
.
repos_dir
+
@name
end
# Returns the branch name (i.e. master).
#
# @return [String] The name of the current branch.
#
def
branch_name
`git name-rev --name-only HEAD`
.
strip
end
# Returns the branch remote name (i.e. origin).
#
# @param [#to_s] branch_name
# The branch name to look for the remote name.
#
# @return [String] The given branch's remote name.
#
def
branch_remote_name
(
branch_name
)
`git config branch.
#{
branch_name
}
.remote`
.
strip
end
# Returns the url of the given remote name
# (i.e. git@github.com:CocoaPods/Specs.git).
#
# @param [#to_s] remote_name
# The branch remote name to look for the url.
#
# @return [String] The URL of the given remote.
#
def
url_of_git_repo
(
remote_name
)
`git config remote.
#{
remote_name
}
.url`
.
strip
end
end
end
end
lib/cocoapods/command/repo/list.rb
View file @
198e3d04
...
...
@@ -20,12 +20,13 @@ module Pod
# @output Examples:
#
# master
# - type: git (
origin
)
# - type: git (
master
)
# - URL: https://github.com/CocoaPods/Specs.git
# - path: /Users/lascorbe/.cocoapods/repos/master
#
# test
# - type: local copy
# - URL: file:///Users/lascorbe/.cocoapods/repos/test
# - path: /Users/lascorbe/.cocoapods/repos/test
#
def
run
...
...
@@ -38,27 +39,24 @@ module Pod
# Pretty-prints the source at the given path.
#
# @param [S
tring,Pathname] path
# The
path of the source
to be printed.
# @param [S
ource] source
# The
source repository
to be printed.
#
# @return [void]
#
def
print_source_at_path
(
path
)
Dir
.
chdir
(
path
)
do
if
SourcesManager
.
git_repo?
(
path
)
remote_name
=
branch_remote_name
(
branch_name
)
if
remote_name
UI
.
puts
"- Type: git (
#{
remote_name
}
)"
url
=
url_of_git_repo
(
remote_name
)
UI
.
puts
"- URL:
#{
url
}
"
else
UI
.
puts
'- Type: git (no remote information available)'
def
print_source
(
source
)
if
SourcesManager
.
git_repo?
(
source
.
repo
)
Dir
.
chdir
(
source
.
repo
)
do
branch_name
=
`git name-rev --name-only HEAD 2>/dev/null`
.
strip
branch_name
=
'unknown'
if
branch_name
.
empty?
UI
.
puts
"- Type: git (
#{
branch_name
}
)"
end
else
UI
.
puts
'- Type: local copy'
end
UI
.
puts
"- Path:
#{
path
}
"
UI
.
puts
'- Type: local'
end
UI
.
puts
"- URL:
#{
source
.
url
}
"
UI
.
puts
"- Path:
#{
source
.
repo
}
"
end
# Pretty-prints the given sources.
...
...
@@ -71,7 +69,7 @@ module Pod
def
print_sources
(
sources
)
sources
.
each
do
|
source
|
UI
.
title
source
.
name
do
print_source
_at_path
source
.
repo
print_source
(
source
)
end
end
UI
.
puts
"
\n
"
...
...
spec/functional/command/repo/list_spec.rb
View file @
198e3d04
...
...
@@ -26,5 +26,43 @@ module Pod
output
.
should
.
include?
'repo'
output
.
should
.
not
.
include?
'- Type:'
end
it
'shows the path to the spec repository'
do
output
=
run_command
(
'repo'
,
'list'
)
output
.
should
.
include?
"- Path:
#{
repo_path
(
'master'
)
}
"
end
it
'shows unknown as the branch when there is no branch for git repositories'
do
path
=
repo_path
(
name
)
path
.
mkpath
Dir
.
chdir
(
path
)
do
`git init`
end
output
=
run_command
(
'repo'
,
'list'
)
output
.
should
.
include?
'git (unknown)'
end
describe
'with a git based spec repository with a remote'
do
extend
SpecHelper
::
TemporaryRepos
before
do
config
.
repos_dir
=
tmp_repos_path
Dir
.
chdir
(
repo_make
(
'apiary'
))
do
`git remote add origin https://github.com/apiaryio/Specs`
end
end
it
'shows the current git branch configuration'
do
output
=
run_command
(
'repo'
,
'list'
)
output
.
should
.
include?
'- Type: git (master)'
end
it
'shows the git URL (when an upstream is not configured)'
do
output
=
run_command
(
'repo'
,
'list'
)
output
.
should
.
include?
'- URL: https://github.com/apiaryio/Specs'
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment