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
3253d72c
Commit
3253d72c
authored
Nov 09, 2014
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pod spec create] Handle repos without commits
Fixes #2803
parent
46049417
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
CHANGELOG.md
CHANGELOG.md
+5
-0
spec.rb
lib/cocoapods/command/spec.rb
+1
-0
spec_spec.rb
spec/functional/command/spec_spec.rb
+19
-0
No files found.
CHANGELOG.md
View file @
3253d72c
...
...
@@ -12,6 +12,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
pre-release version that now leads to a version conflict.
[
Samuel Giddins
](
https://github.com/segiddins
)
*
Provides a user friendly message when using
`pod spec create`
with a
repository that doesn't yet have any commits.
[
Kyle Fuller
](
https://github.com/kylef
)
[
#2803
](
https://github.com/CocoaPods/CocoaPods/issues/2803
)
## 0.35.0.rc2
...
...
lib/cocoapods/command/spec.rb
View file @
3253d72c
...
...
@@ -458,6 +458,7 @@ module Pod
branches
=
GitHub
.
branches
(
repo
[
'html_url'
])
master_name
=
repo
[
'master_branch'
]
||
'master'
master
=
branches
.
find
{
|
branch
|
branch
[
'name'
]
==
master_name
}
raise
Informative
,
"Unable to find any commits on the master branch for the repository `
#{
repo
[
'html_url'
]
}
`"
unless
master
data
[
:ref_type
]
=
':commit'
data
[
:ref
]
=
master
[
'commit'
][
'sha'
]
else
...
...
spec/functional/command/spec_spec.rb
View file @
3253d72c
...
...
@@ -118,6 +118,25 @@ module Pod
spec
.
source
.
should
==
{
:git
=>
'https://github.com/lukeredpath/libPusher.git'
,
:commit
=>
'5f482b0693ac2ac1ad85d1aabc27ec7547cc0bc7'
}
end
it
"raises an informative message when the GitHub repository doesn't have any commits"
do
repo
=
{
'name'
=>
'QueryKit'
,
'owner'
=>
{
'login'
=>
'QueryKit'
},
'html_url'
=>
'https://github.com/QueryKit/QueryKit'
,
'description'
=>
'A simple CoreData query language for Swift and Objective-C.'
,
'clone_url'
=>
'https://github.com/QueryKit/QueryKit.git'
,
}
GitHub
.
expects
(
:repo
).
with
(
'QueryKit/QueryKit'
).
returns
(
repo
)
GitHub
.
expects
(
:tags
).
with
(
'https://github.com/QueryKit/QueryKit'
).
returns
([])
GitHub
.
expects
(
:branches
).
with
(
'https://github.com/QueryKit/QueryKit'
).
returns
([])
GitHub
.
expects
(
:user
).
with
(
'QueryKit'
).
returns
(
'name'
=>
'QueryKit'
,
'email'
=>
'support@querykit.org'
)
e
=
lambda
do
run_command
(
'spec'
,
'create'
,
'https://github.com/QueryKit/QueryKit.git'
)
end
.
should
.
raise
Pod
::
Informative
e
.
message
.
should
.
match
(
/Unable to find.*commits.*master branch/
)
end
it
"provides a markdown template if a github repo doesn't have semantic version tags"
do
repo
=
{
'name'
=>
'libPusher'
,
...
...
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