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
5ee28a7c
Commit
5ee28a7c
authored
Feb 17, 2015
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3119 from CocoaPods/seg-tmpdir
Use proper TMPDIR instead of /tmp
parents
31315a80
955bc272
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
10 deletions
+26
-10
CHANGELOG.md
CHANGELOG.md
+4
-0
cocoapods.rb
lib/cocoapods.rb
+1
-0
lint.rb
lib/cocoapods/command/spec/lint.rb
+1
-1
validator.rb
lib/cocoapods/validator.rb
+15
-6
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+1
-1
validator_spec.rb
spec/unit/validator_spec.rb
+4
-2
No files found.
CHANGELOG.md
View file @
5ee28a7c
...
@@ -23,6 +23,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -23,6 +23,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#2943
](
https://github.com/CocoaPods/CocoaPods/issues/2943
)
[
#2943
](
https://github.com/CocoaPods/CocoaPods/issues/2943
)
*
Use the proper
`TMPDIR`
for the CocoaPods process, instead of blindly using
`/tmp`
.
[
Samuel Giddins
](
https://github.com/segiddins
)
##### Bug Fixes
##### Bug Fixes
*
Added support for .tpp C++ header files in specs (previously were getting
*
Added support for .tpp C++ header files in specs (previously were getting
...
...
lib/cocoapods.rb
View file @
5ee28a7c
...
@@ -16,6 +16,7 @@ end
...
@@ -16,6 +16,7 @@ end
module
Pod
module
Pod
require
'pathname'
require
'pathname'
require
'tmpdir'
require
'cocoapods/gem_version'
require
'cocoapods/gem_version'
require
'cocoapods-core'
require
'cocoapods-core'
...
...
lib/cocoapods/command/spec/lint.rb
View file @
5ee28a7c
...
@@ -97,7 +97,7 @@ module Pod
...
@@ -97,7 +97,7 @@ module Pod
end
end
def
podspecs_tmp_dir
def
podspecs_tmp_dir
Pathname
(
File
.
join
(
Pathname
.
new
(
'/tmp'
).
realpath
,
'/CocoaPods/Lint_podspec'
))
Pathname
.
new
(
Dir
.
tmpdir
)
+
'CocoaPods/Lint_podspec'
end
end
end
end
end
end
...
...
lib/cocoapods/validator.rb
View file @
5ee28a7c
...
@@ -183,7 +183,7 @@ module Pod
...
@@ -183,7 +183,7 @@ module Pod
# @return [Pathname] the temporary directory used by the linter.
# @return [Pathname] the temporary directory used by the linter.
#
#
def
validation_dir
def
validation_dir
Pathname
.
new
(
File
.
join
(
Pathname
.
new
(
'/tmp'
).
realpath
,
'CocoaPods/Lint'
))
Pathname
(
Dir
.
tmpdir
)
+
'CocoaPods/Lint'
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
@@ -510,7 +510,7 @@ module Pod
...
@@ -510,7 +510,7 @@ module Pod
l
.
include?
(
'note: '
)
&&
(
l
!~
/expanded from macro/
)
l
.
include?
(
'note: '
)
&&
(
l
!~
/expanded from macro/
)
end
end
selected_lines
.
map
do
|
l
|
selected_lines
.
map
do
|
l
|
new
=
l
.
gsub
(
%r{
/tmp/CocoaPods/Lint
/Pods/}
,
''
)
new
=
l
.
gsub
(
%r{
#{
validation_dir
}
/Pods/}
,
''
)
new
.
gsub!
(
/^ */
,
' '
)
new
.
gsub!
(
/^ */
,
' '
)
end
end
end
end
...
@@ -521,11 +521,9 @@ module Pod
...
@@ -521,11 +521,9 @@ module Pod
def
xcodebuild
def
xcodebuild
command
=
'xcodebuild clean build -target Pods CODE_SIGN_IDENTITY=-'
command
=
'xcodebuild clean build -target Pods CODE_SIGN_IDENTITY=-'
command
<<
' -sdk iphonesimulator'
if
consumer
.
platform_name
==
:ios
command
<<
' -sdk iphonesimulator'
if
consumer
.
platform_name
==
:ios
output
,
status
=
_xcodebuild
"
#{
command
}
2>&1"
UI
.
puts
command
if
config
.
verbose?
unless
status
.
success?
output
=
`
#{
command
}
2>&1`
unless
$?
.
success?
message
=
'Returned a unsuccessful exit code.'
message
=
'Returned a unsuccessful exit code.'
message
+=
' You can use `--verbose` for more information.'
unless
config
.
verbose?
message
+=
' You can use `--verbose` for more information.'
unless
config
.
verbose?
error
(
'xcodebuild'
,
message
)
error
(
'xcodebuild'
,
message
)
...
@@ -534,6 +532,17 @@ module Pod
...
@@ -534,6 +532,17 @@ module Pod
output
output
end
end
# Executes the given command in the current working directory.
#
# @return [(String, Status)] The output of the given command and its
# resulting status.
#
def
_xcodebuild
(
command
)
UI
.
puts
command
if
config
.
verbose
output
=
`
#{
command
}
`
[
output
,
$?
]
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
end
end
end
end
spec/unit/installer/analyzer_spec.rb
View file @
5ee28a7c
...
@@ -72,7 +72,7 @@ module Pod
...
@@ -72,7 +72,7 @@ module Pod
end
end
it
'does not update non-git repositories'
do
it
'does not update non-git repositories'
do
tmp_directory
=
'/private/tmp/CocoaPods/
'
tmp_directory
=
Pathname
(
Dir
.
tmpdir
)
+
'CocoaPods
'
FileUtils
.
mkdir_p
(
tmp_directory
)
FileUtils
.
mkdir_p
(
tmp_directory
)
FileUtils
.
cp_r
(
ROOT
+
'spec/fixtures/spec-repos/test_repo/'
,
tmp_directory
)
FileUtils
.
cp_r
(
ROOT
+
'spec/fixtures/spec-repos/test_repo/'
,
tmp_directory
)
non_git_repo
=
tmp_directory
+
'test_repo'
non_git_repo
=
tmp_directory
+
'test_repo'
...
...
spec/unit/validator_spec.rb
View file @
5ee28a7c
...
@@ -88,7 +88,7 @@ module Pod
...
@@ -88,7 +88,7 @@ module Pod
validator
.
quick
=
true
validator
.
quick
=
true
validator
.
stubs
(
:validate_url
)
validator
.
stubs
(
:validate_url
)
validator
.
validate
validator
.
validate
validator
.
validation_dir
.
should
.
be
==
Pathname
.
new
(
'/private/tmp/CocoaPods/Lint'
)
validator
.
validation_dir
.
should
.
be
==
Pathname
.
new
(
Dir
.
tmpdir
)
+
'CocoaPods/Lint'
end
end
end
end
...
@@ -364,7 +364,9 @@ module Pod
...
@@ -364,7 +364,9 @@ module Pod
validator
.
stubs
(
:check_file_patterns
)
validator
.
stubs
(
:check_file_patterns
)
validator
.
stubs
(
:validate_url
)
validator
.
stubs
(
:validate_url
)
validator
.
stubs
(
:`
).
returns
(
'Output'
)
validator
.
stubs
(
:`
).
returns
(
'Output'
)
$?
.
stubs
(
:success?
).
returns
(
false
)
status
=
mock
status
.
stubs
(
:success?
).
returns
(
false
)
validator
.
stubs
(
:_xcodebuild
).
returns
([
'Output'
,
status
])
validator
.
validate
validator
.
validate
first
=
validator
.
results
.
map
(
&
:to_s
).
first
first
=
validator
.
results
.
map
(
&
:to_s
).
first
first
.
should
.
include
'[xcodebuild] Returned a unsuccessful exit code'
first
.
should
.
include
'[xcodebuild] Returned a unsuccessful exit code'
...
...
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