Skip to content

Commit

Permalink
Add workaround for Ruby 2.3.3p222
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 12, 2017
1 parent fcfe7f2 commit 8c2f7eb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/chupa-text/external-command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,18 @@ def set_option(key, type)
end
limit_info = "soft-limit:#{soft_limit}, hard-limit:#{hard_limit}"
info("#{log_tag}[#{key}][set] <#{value}>(#{limit_info})")
@options[:"rlimit_#{key}"] = value

# TODO: Workaround for Ruby 2.3.3p222
case key
when :cpu
@options[:rlimit_cpu] = value
when :rss
@options[:rlimit_rss] = value
when :as
@options[:rlimit_as] = value
else
@options[:"rlimit_#{key}"] = value
end
end

def parse_int(key, value)
Expand Down

0 comments on commit 8c2f7eb

Please sign in to comment.