mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
String#bytesize fix for ruby < 1.8.7 using amqp
This commit is contained in:
parent
4d395c8674
commit
5159f091a3
1 changed files with 9 additions and 0 deletions
|
@ -9,4 +9,13 @@ if !String.instance_methods.include?("start_with?")
|
|||
end
|
||||
end
|
||||
|
||||
# Ruby 1.8.7 added String#bytesize, used by the latest amqp gem to get the
|
||||
# size of a string (instead of String#length). This monkeypatch enables older
|
||||
# ruby to work, but may cause AMQP trouble on UTF-8 strings.
|
||||
if !String.instance_methods.include?("bytesize")
|
||||
class String
|
||||
alias :bytesize :length
|
||||
end
|
||||
end
|
||||
|
||||
require "logstash/rubyfixes/regexp_union_takes_array"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue