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
7d0a5c10
Commit
7d0a5c10
authored
Jul 14, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Executable] Dont use a subprocess for which
parent
b26f26ba
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
6 deletions
+21
-6
executable.rb
lib/cocoapods/executable.rb
+16
-2
validator.rb
lib/cocoapods/validator.rb
+1
-1
spec_helper.rb
spec/spec_helper.rb
+1
-1
executable_spec.rb
spec/unit/executable_spec.rb
+2
-1
bridge_support_spec.rb
spec/unit/generator/bridge_support_spec.rb
+1
-1
No files found.
lib/cocoapods/executable.rb
View file @
7d0a5c10
...
...
@@ -48,8 +48,8 @@ module Pod
# @todo Find a way to display the live output of the commands.
#
def
self
.
execute_command
(
executable
,
command
,
raise_on_failure
)
bin
=
`which
#{
executable
}
`
.
strip
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
if
bin
.
empty?
bin
=
which
(
executable
)
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
unless
bin
require
'shellwords'
...
...
@@ -75,6 +75,20 @@ module Pod
output
end
# Returns the absolute path to the binary with the given name on the current
# `PATH`, or `nil` if none is found.
#
def
self
.
which
(
program
)
program
=
program
.
to_s
ENV
[
"PATH"
].
split
(
File
::
PATH_SEPARATOR
).
each
do
|
path
|
bin
=
File
.
expand_path
(
program
,
path
)
if
File
.
file?
(
bin
)
&&
File
.
executable?
(
bin
)
return
bin
end
end
nil
end
private
def
self
.
popen3
(
bin
,
command
,
stdout
,
stderr
)
...
...
lib/cocoapods/validator.rb
View file @
7d0a5c10
...
...
@@ -381,7 +381,7 @@ module Pod
# @return [void]
#
def
build_pod
if
`which xcodebuild`
.
strip
.
empty
?
if
Executable
.
which
(
'xcodebuild'
).
nil
?
UI
.
warn
"Skipping compilation with `xcodebuild' because it can't be found.
\n
"
.
yellow
else
UI
.
message
"
\n
Building with xcodebuild.
\n
"
.
yellow
do
...
...
spec/spec_helper.rb
View file @
7d0a5c10
...
...
@@ -70,7 +70,7 @@ end
#-----------------------------------------------------------------------------#
ENV
[
'SKIP_SETUP'
]
=
'true'
if
ENV
[
'SKIP_XCODEBUILD'
].
nil?
&&
`which xcodebuild`
.
strip
.
empty
?
if
ENV
[
'SKIP_XCODEBUILD'
].
nil?
&&
Pod
::
Executable
.
which
(
'xcodebuild'
).
nil
?
ENV
[
'SKIP_XCODEBUILD'
]
=
'true'
end
...
...
spec/unit/executable_spec.rb
View file @
7d0a5c10
...
...
@@ -12,7 +12,8 @@ module Pod
it
'should support spaces in the full path of the command'
do
cmd
=
'/Spa ces/are"/fun/false'
Executable
.
stubs
(
:`
).
returns
(
cmd
)
File
.
expects
(
:file?
).
with
(
cmd
).
returns
(
true
)
File
.
expects
(
:executable?
).
with
(
cmd
).
returns
(
true
)
result
=
mock
result
.
stubs
(
:success?
).
returns
(
true
)
...
...
spec/unit/generator/bridge_support_spec.rb
View file @
7d0a5c10
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
describe
'Pod::Generator::BridgeSupport'
do
if
`which gen_bridge_metadata`
.
strip
.
empty
?
if
Executable
.
which
(
'gen_bridge_metadata'
).
nil
?
puts
' ! '
.
red
<<
"Skipping because the `gen_bridge_metadata` executable can't be found."
else
it
'generates a metadata file with the appropriate search paths'
do
...
...
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