diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-05-16 11:09:57 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-05-16 11:09:57 +0100 |
commit | 4b4b92f9a1bfa5ef5828ab15e7d9abdbd288f728 (patch) | |
tree | 1e38aced05ae2dd5c0d7bbccabbc1846b3554506 /lib/alaveteli_external_command.rb | |
parent | 2cfad24e21f954099ae84d782373d3bc6336db37 (diff) | |
parent | 323318c600480e15f177e01f88946b15bad2db84 (diff) |
Merge remote-tracking branch 'origin/hotfix/0.9.0.3'0.9.0.3
Diffstat (limited to 'lib/alaveteli_external_command.rb')
-rw-r--r-- | lib/alaveteli_external_command.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb index 24b4b1aa8..5e9a7ee83 100644 --- a/lib/alaveteli_external_command.rb +++ b/lib/alaveteli_external_command.rb @@ -8,6 +8,7 @@ module AlaveteliExternalCommand # :stdin_string - stdin string to pass to the process # :binary_output - boolean flag for treating the output as binary or text (only significant # ruby 1.9 and above) + # :memory_limit - maximum amount of memory (in bytes) available to the process def run(program_name, *args) # Run an external program, and return its output. # Standard error is suppressed unless the program @@ -38,6 +39,9 @@ module AlaveteliExternalCommand if opts.has_key? :binary_output xc.binary_mode = opts[:binary_output] end + if opts.has_key? :memory_limit + xc.memory_limit = opts[:memory_limit] + end xc.run(opts[:stdin_string] || "", opts[:env] || {}) if xc.status != 0 |