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
3a0c01c1
Commit
3a0c01c1
authored
Apr 07, 2015
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pod repo list] Fix issue showing the URL for git
parent
2fcf6c17
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
49 deletions
+61
-49
CHANGELOG.md
CHANGELOG.md
+7
-0
repo.rb
lib/cocoapods/command/repo.rb
+0
-31
list.rb
lib/cocoapods/command/repo/list.rb
+16
-18
list_spec.rb
spec/functional/command/repo/list_spec.rb
+38
-0
No files found.
CHANGELOG.md
View file @
3a0c01c1
...
@@ -13,12 +13,19 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -13,12 +13,19 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
Marius Rackwitz
](
https://github.com/mrackwitz
)
[
#3145
](
https://github.com/CocoaPods/CocoaPods/issues/3145
)
[
#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
##### Bug Fixes
*
Do not pass code-sign arguments to xcodebuild when linting OS X targets.
*
Do not pass code-sign arguments to xcodebuild when linting OS X targets.
[
Boris Bügling
](
https://github.com/neonichu
)
[
Boris Bügling
](
https://github.com/neonichu
)
[
#3310
](
https://github.com/CocoaPods/CocoaPods/issues/3310
)
[
#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
## 0.36.3
...
...
lib/cocoapods/command/repo.rb
View file @
3a0c01c1
...
@@ -24,37 +24,6 @@ module Pod
...
@@ -24,37 +24,6 @@ module Pod
def
dir
def
dir
config
.
repos_dir
+
@name
config
.
repos_dir
+
@name
end
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
end
end
end
lib/cocoapods/command/repo/list.rb
View file @
3a0c01c1
...
@@ -20,12 +20,13 @@ module Pod
...
@@ -20,12 +20,13 @@ module Pod
# @output Examples:
# @output Examples:
#
#
# master
# master
# - type: git (
origin
)
# - type: git (
master
)
# - URL: https://github.com/CocoaPods/Specs.git
# - URL: https://github.com/CocoaPods/Specs.git
# - path: /Users/lascorbe/.cocoapods/repos/master
# - path: /Users/lascorbe/.cocoapods/repos/master
#
#
# test
# test
# - type: local copy
# - type: local copy
# - URL: file:///Users/lascorbe/.cocoapods/repos/test
# - path: /Users/lascorbe/.cocoapods/repos/test
# - path: /Users/lascorbe/.cocoapods/repos/test
#
#
def
run
def
run
...
@@ -38,27 +39,24 @@ module Pod
...
@@ -38,27 +39,24 @@ module Pod
# Pretty-prints the source at the given path.
# Pretty-prints the source at the given path.
#
#
# @param [S
tring,Pathname] path
# @param [S
ource] source
# The
path of the source
to be printed.
# The
source repository
to be printed.
#
#
# @return [void]
# @return [void]
#
#
def
print_source_at_path
(
path
)
def
print_source
(
source
)
Dir
.
chdir
(
path
)
do
if
SourcesManager
.
git_repo?
(
source
.
repo
)
if
SourcesManager
.
git_repo?
(
path
)
Dir
.
chdir
(
source
.
repo
)
do
remote_name
=
branch_remote_name
(
branch_name
)
branch_name
=
`git name-rev --name-only HEAD 2>/dev/null`
.
strip
if
remote_name
branch_name
=
'unknown'
if
branch_name
.
empty?
UI
.
puts
"- Type: git (
#{
remote_name
}
)"
UI
.
puts
"- Type: git (
#{
branch_name
}
)"
url
=
url_of_git_repo
(
remote_name
)
UI
.
puts
"- URL:
#{
url
}
"
else
UI
.
puts
'- Type: git (no remote information available)'
end
else
UI
.
puts
'- Type: local copy'
end
end
UI
.
puts
"- Path:
#{
path
}
"
else
UI
.
puts
'- Type: local'
end
end
UI
.
puts
"- URL:
#{
source
.
url
}
"
UI
.
puts
"- Path:
#{
source
.
repo
}
"
end
end
# Pretty-prints the given sources.
# Pretty-prints the given sources.
...
@@ -71,7 +69,7 @@ module Pod
...
@@ -71,7 +69,7 @@ module Pod
def
print_sources
(
sources
)
def
print_sources
(
sources
)
sources
.
each
do
|
source
|
sources
.
each
do
|
source
|
UI
.
title
source
.
name
do
UI
.
title
source
.
name
do
print_source
_at_path
source
.
repo
print_source
(
source
)
end
end
end
end
UI
.
puts
"
\n
"
UI
.
puts
"
\n
"
...
...
spec/functional/command/repo/list_spec.rb
View file @
3a0c01c1
...
@@ -26,5 +26,43 @@ module Pod
...
@@ -26,5 +26,43 @@ module Pod
output
.
should
.
include?
'repo'
output
.
should
.
include?
'repo'
output
.
should
.
not
.
include?
'- Type:'
output
.
should
.
not
.
include?
'- Type:'
end
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
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