forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add backport monkeypatches for String#start_with?
- Loading branch information
1 parent
03068fc
commit 5cb19a5
Showing
3 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
require "logstash/namespace" | ||
require "logstash/ruby_fixes" | ||
require "uri" | ||
|
||
module LogStash::Inputs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require "logstash/namespace" | ||
require "logstash/ruby_fixes" | ||
require "logger" | ||
|
||
class LogStash::Logger < Logger | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
# Ruby 1.8.7 added String#start_with? - monkeypatch the | ||
# String class if it isn't supported (<= ruby 1.8.6) | ||
if !String.instance_methods.include?("start_with?") | ||
class String | ||
def start_with?(str) | ||
return self[0 .. (str.length-1)] == str | ||
end | ||
end | ||
end | ||
|