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
f96667b5
Commit
f96667b5
authored
Nov 01, 2013
by
Joshua Kalpin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving private methods only used by spec lint into its class
parent
21b8aff6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
spec.rb
lib/cocoapods/command/spec.rb
+32
-30
No files found.
lib/cocoapods/command/spec.rb
View file @
f96667b5
...
...
@@ -99,6 +99,38 @@ module Pod
end
podspecs_tmp_dir
.
rmtree
if
podspecs_tmp_dir
.
exist?
end
private
def
podspecs_to_lint
@podspecs_to_lint
||=
begin
files
=
[]
@podspecs_paths
<<
'.'
if
@podspecs_paths
.
empty?
@podspecs_paths
.
each
do
|
path
|
if
path
=~
/https?:\/\//
require
'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
}
end
files
<<
output_path
else
if
(
pathname
=
Pathname
.
new
(
path
)).
directory?
files
+=
Pathname
.
glob
(
pathname
+
'**/*.podspec'
)
raise
Informative
,
"No specs found in the current directory."
if
files
.
empty?
else
files
<<
(
pathname
=
Pathname
.
new
(
path
))
raise
Informative
,
"Unable to find a spec named `
#{
path
}
'."
unless
pathname
.
exist?
&&
path
.
include?
(
'.podspec'
)
end
end
end
files
end
end
def
podspecs_tmp_dir
Pathname
.
new
(
'/tmp/CocoaPods/Lint_podspec'
)
end
end
#-----------------------------------------------------------------------#
...
...
@@ -345,36 +377,6 @@ module Pod
return
best_source
.
specification
(
set
.
name
,
best_version
),
best_source
end
def
podspecs_to_lint
@podspecs_to_lint
||=
begin
files
=
[]
@podspecs_paths
<<
'.'
if
@podspecs_paths
.
empty?
@podspecs_paths
.
each
do
|
path
|
if
path
=~
/https?:\/\//
require
'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
}
end
files
<<
output_path
else
if
(
pathname
=
Pathname
.
new
(
path
)).
directory?
files
+=
Pathname
.
glob
(
pathname
+
'**/*.podspec'
)
raise
Informative
,
"No specs found in the current directory."
if
files
.
empty?
else
files
<<
(
pathname
=
Pathname
.
new
(
path
))
raise
Informative
,
"Unable to find a spec named `
#{
path
}
'."
unless
pathname
.
exist?
&&
path
.
include?
(
'.podspec'
)
end
end
end
files
end
end
def
podspecs_tmp_dir
Pathname
.
new
(
'/tmp/CocoaPods/Lint_podspec'
)
end
#--------------------------------------#
# Templates and github information retrieval for spec create
...
...
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