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
76ceafcf
Commit
76ceafcf
authored
Apr 23, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Executable] Dont try and run threads that are no longer alive
parent
fd9770ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
executable.rb
lib/cocoapods/executable.rb
+22
-8
No files found.
lib/cocoapods/executable.rb
View file @
76ceafcf
...
@@ -51,7 +51,6 @@ module Pod
...
@@ -51,7 +51,6 @@ module Pod
bin
=
`which
#{
executable
}
`
.
strip
bin
=
`which
#{
executable
}
`
.
strip
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
if
bin
.
empty?
raise
Informative
,
"Unable to locate the executable `
#{
executable
}
`"
if
bin
.
empty?
require
'open3'
require
'shellwords'
require
'shellwords'
command
=
command
.
map
(
&
:to_s
)
command
=
command
.
map
(
&
:to_s
)
...
@@ -64,13 +63,7 @@ module Pod
...
@@ -64,13 +63,7 @@ module Pod
stdout
,
stderr
=
Indenter
.
new
,
Indenter
.
new
stdout
,
stderr
=
Indenter
.
new
,
Indenter
.
new
end
end
status
=
Open3
.
popen3
(
bin
,
*
command
)
do
|
i
,
o
,
e
,
t
|
status
=
popen3
(
bin
,
command
,
stdout
,
stderr
)
out_reader
=
Thread
.
new
{
while
s
=
o
.
gets
;
stdout
<<
s
;
end
}
err_reader
=
Thread
.
new
{
while
s
=
e
.
gets
;
stderr
<<
s
;
end
}
i
.
close
[
out_reader
,
err_reader
].
each
(
&
:run
)
t
.
value
end
output
=
stdout
.
join
(
"
\n
"
)
+
stderr
.
join
(
"
\n
"
)
output
=
stdout
.
join
(
"
\n
"
)
+
stderr
.
join
(
"
\n
"
)
unless
status
.
success?
unless
status
.
success?
if
raise_on_failure
if
raise_on_failure
...
@@ -82,6 +75,27 @@ module Pod
...
@@ -82,6 +75,27 @@ module Pod
output
output
end
end
private
def
self
.
popen3
(
bin
,
command
,
stdout
,
stderr
)
require
'open3'
Open3
.
popen3
(
bin
,
*
command
)
do
|
i
,
o
,
e
,
t
|
out_reader
=
Thread
.
new
{
while
s
=
o
.
gets
;
stdout
<<
s
;
end
}
err_reader
=
Thread
.
new
{
while
s
=
e
.
gets
;
stderr
<<
s
;
end
}
i
.
close
run_readers
=
lambda
do
[
out_reader
,
err_reader
].
each
do
|
reader
|
reader
.
run
if
reader
.
alive?
end
end
run_readers
.
call
t
.
value
.
tap
{
run_readers
.
call
}
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
# Helper class that allows to write to an {IO} instance taking into account
# Helper class that allows to write to an {IO} instance taking into account
...
...
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