Skip to content

Commit

Permalink
[Rakefile] Dont use bundler when checking for lack of warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Aug 7, 2018
1 parent b011143 commit 70f72d1
Showing 1 changed file with 23 additions and 21 deletions.
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
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

0 comments on commit 70f72d1

Please sign in to comment.