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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
13 deletions
+26
-13
executable.rb
lib/cocoapods/executable.rb
+10
-9
executable_spec.rb
spec/unit/executable_spec.rb
+16
-4
No files found.
lib/cocoapods/executable.rb
View file @
14f891c4
...
...
@@ -86,10 +86,6 @@ module Pod
i
.
close
status
=
t
.
value
o
.
flush
e
.
flush
sleep
(
0.1
)
status
end
end
...
...
@@ -100,11 +96,17 @@ module Pod
begin
loop
do
buf
<<
input
.
readpartial
(
4096
)
string
,
separator
,
buf
=
buf
.
rpartition
(
/[\r\n]/
)
output
<<
string
<<
separator
loop
do
string
,
separator
,
buf
=
buf
.
partition
(
/[\r\n]/
)
if
separator
.
empty?
buf
=
string
break
end
output
<<
(
string
<<
separator
)
end
end
rescue
EOFError
output
<<
buf
<<
$/
unless
buf
.
empty?
output
<<
(
buf
<<
$/
)
unless
buf
.
empty?
end
end
end
...
...
@@ -141,8 +143,7 @@ module Pod
#
def
<<
(
value
)
super
ensure
@io
<<
"
#{
indent
}#{
value
}
"
if
@io
io
<<
"
#{
indent
}#{
value
}
"
if
io
end
end
end
...
...
spec/unit/executable_spec.rb
View file @
14f891c4
...
...
@@ -59,16 +59,28 @@ module Pod
RB
Executable
.
execute_command
(
'ruby'
,
cmd
,
true
).
should
==
"foo
\r
bar
\n
baz
\r
"
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
it
'indents any appended strings'
do
UI
.
indentation_level
=
4
io
=
StringIO
.
new
indenter
=
Executable
::
Indenter
.
new
(
io
)
indenter
<<
'hello'
io
.
string
.
should
==
' hello'
end
end
...
...
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