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
8b499c26
Unverified
Commit
8b499c26
authored
Nov 11, 2016
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Spec::Lint] Fail gracefully when downloading podspec fails
parent
42de87c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
lint.rb
lib/cocoapods/command/spec/lint.rb
+6
-2
spec_spec.rb
spec/functional/command/spec_spec.rb
+5
-1
No files found.
lib/cocoapods/command/spec/lint.rb
View file @
8b499c26
...
...
@@ -98,8 +98,12 @@ module Pod
require
'cocoapods/open-uri'
output_path
=
podspecs_tmp_dir
+
File
.
basename
(
path
)
output_path
.
dirname
.
mkpath
open
(
path
)
do
|
io
|
output_path
.
open
(
'w'
)
{
|
f
|
f
<<
io
.
read
}
begin
open
(
path
)
do
|
io
|
output_path
.
open
(
'w'
)
{
|
f
|
f
<<
io
.
read
}
end
rescue
=>
e
raise
Informative
,
"Downloading a podspec from `
#{
path
}
` failed:
#{
e
}
"
end
files
<<
output_path
elsif
(
pathname
=
Pathname
.
new
(
path
)).
directory?
...
...
spec/functional/command/spec_spec.rb
View file @
8b499c26
...
...
@@ -193,7 +193,7 @@ module Pod
#-------------------------------------------------------------------------#
describe
'lint subcommand'
do
describe
Command
::
Spec
::
Lint
do
it
"complains if it can't find any spec to lint"
do
Dir
.
chdir
(
temporary_directory
)
do
lambda
{
command
(
'spec'
,
'lint'
).
run
}.
should
.
raise
Informative
...
...
@@ -214,6 +214,10 @@ module Pod
end
end
it
'fails with an informative error when downloading the podspec 404s'
do
lambda
{
run_command
(
'spec'
,
'lint'
,
'https://no.such.domain/404'
)
}.
should
.
raise
Informative
end
before
do
text
=
(
fixture
(
'spec-repos'
)
+
'master/Specs/JSONKit/1.4/JSONKit.podspec.json'
).
read
text
.
gsub!
(
/.*license.*/
,
'"license": { "file": "LICENSE" },'
)
...
...
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