diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-05-16 15:17:45 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-05-16 15:17:45 +0100 |
commit | 0c2a485fc14bdd5855acfd367855782cbf2b6702 (patch) | |
tree | ac7f1610ee690e2738f2e7554d80ebce8258f526 /lib/alaveteli_external_command.rb | |
parent | 16ca4662692125290f8df336d71dc098af4b937b (diff) | |
parent | 323318c600480e15f177e01f88946b15bad2db84 (diff) |
Merge remote-tracking branch 'origin/hotfix/0.9.0.3' into rails-3-develop
Conflicts:
Rakefile
app/models/contact_mailer.rb
spec/models/contact_mailer_spec.rb
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 ac91a5867..fbdee8a62 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 |