Using block syntax of popen4 to ensure that subprocesses are properly disposed of.
This fixes resource unavailable errors when jekyll is run with '--auto --pygments': Liquid error: Resource temporarily unavailable – fork(2) fork: Resource temporarily unavailable
This commit is contained in:
parent
82d96448b5
commit
2135a53897
|
@ -60,10 +60,13 @@ class Albino
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute(command)
|
def execute(command)
|
||||||
pid, stdin, stdout, stderr = Open4.popen4(command)
|
output = ''
|
||||||
stdin.puts @target
|
Open4.popen4(command) do |pid, stdin, stdout, stderr|
|
||||||
stdin.close
|
stdin.puts @target
|
||||||
stdout.read.strip
|
stdin.close
|
||||||
|
output = stdout.read.strip
|
||||||
|
end
|
||||||
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
def colorize(options = {})
|
def colorize(options = {})
|
||||||
|
|
Loading…
Reference in New Issue