Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VersionConflict] Allow customizing incompatible_version_message_for_conflict #99

Merged
merged 3 commits into from
Aug 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,31 @@ begin

files = FileList['lib/**/*.rb']

out, err = Open3.popen3('ruby', '-w', '-Ilib') do |stdin, stdout, stderr, _wait_thr|
files.each do |file|
stdin.puts "require '#{file.gsub(%r{(^lib/|\.rb$)}, '')}'"
end
stdin.close

[stdout, stderr].map do |io|
chunk_size = 16_384
select_timeout = 0.02
buffer = []
next '' if io.closed? || io.eof?
# IO.select cannot be used here due to the fact that it
# just does not work on windows
loop do
begin
IO.select([io], nil, nil, select_timeout)
break if io.eof? # stop raising :-(
buffer << io.readpartial(chunk_size)
rescue EOFError
break
out, err = Bundler.with_original_env do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Open3.popen3(Gem.ruby, '-w', '-Ilib') do |stdin, stdout, stderr, _wait_thr|
files.each do |file|
stdin.puts "require '#{file.gsub(%r{(^lib/|\.rb$)}, '')}'"
end
stdin.close

[stdout, stderr].map do |io|
chunk_size = 16_384
select_timeout = 0.02
buffer = []
next '' if io.closed? || io.eof?
# IO.select cannot be used here due to the fact that it
# just does not work on windows
loop do
begin
IO.select([io], nil, nil, select_timeout)
break if io.eof? # stop raising :-(
buffer << io.readpartial(chunk_size)
rescue EOFError
break
end
end
buffer.join.strip
end
buffer.join.strip
end
end

Expand Down