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
14f891c4
Commit
14f891c4
authored
Jun 03, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Executable] Fix multiline executable output
parent
2edbe20e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
executable.rb
lib/cocoapods/executable.rb
+10
-9
executable_spec.rb
spec/unit/executable_spec.rb
+12
-0
No files found.
lib/cocoapods/executable.rb
View file @
14f891c4
...
@@ -86,10 +86,6 @@ module Pod
...
@@ -86,10 +86,6 @@ module Pod
i
.
close
i
.
close
status
=
t
.
value
status
=
t
.
value
o
.
flush
e
.
flush
sleep
(
0.1
)
status
status
end
end
end
end
...
@@ -100,11 +96,17 @@ module Pod
...
@@ -100,11 +96,17 @@ module Pod
begin
begin
loop
do
loop
do
buf
<<
input
.
readpartial
(
4096
)
buf
<<
input
.
readpartial
(
4096
)
string
,
separator
,
buf
=
buf
.
rpartition
(
/[\r\n]/
)
loop
do
output
<<
string
<<
separator
string
,
separator
,
buf
=
buf
.
partition
(
/[\r\n]/
)
if
separator
.
empty?
buf
=
string
break
end
output
<<
(
string
<<
separator
)
end
end
end
rescue
EOFError
rescue
EOFError
output
<<
buf
<<
$/
unless
buf
.
empty?
output
<<
(
buf
<<
$/
)
unless
buf
.
empty?
end
end
end
end
end
end
...
@@ -141,8 +143,7 @@ module Pod
...
@@ -141,8 +143,7 @@ module Pod
#
#
def
<<
(
value
)
def
<<
(
value
)
super
super
ensure
io
<<
"
#{
indent
}#{
value
}
"
if
io
@io
<<
"
#{
indent
}#{
value
}
"
if
@io
end
end
end
end
end
end
...
...
spec/unit/executable_spec.rb
View file @
14f891c4
...
@@ -60,6 +60,18 @@ module Pod
...
@@ -60,6 +60,18 @@ module Pod
Executable
.
execute_command
(
'ruby'
,
cmd
,
true
).
should
==
"foo
\r
bar
\n
baz
\r
"
Executable
.
execute_command
(
'ruby'
,
cmd
,
true
).
should
==
"foo
\r
bar
\n
baz
\r
"
end
end
it
'prints the correct output to the console'
do
io
=
''
UI
.
indentation_level
=
1
config
.
verbose
=
true
Executable
::
Indenter
.
any_instance
.
stubs
(
:io
).
returns
(
io
)
cmd
=
[
'-e'
,
<<-
RB
]
3.times { |i| puts i }
RB
Executable
.
execute_command
(
'ruby'
,
cmd
,
true
)
io
.
should
==
" 0
\n
1
\n
2
\n
"
end
describe
Executable
::
Indenter
do
describe
Executable
::
Indenter
do
it
'indents any appended strings'
do
it
'indents any appended strings'
do
UI
.
indentation_level
=
4
UI
.
indentation_level
=
4
...
...
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