Skip to content

Commit

Permalink
use ext_monitor before ruby 2.7
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed Jan 8, 2020
1 parent d673f2f commit d800743
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
9 changes: 8 additions & 1 deletion lib/fluent/command/cat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,18 @@


require 'thread'
require 'monitor'
require 'socket'
require 'yajl'
require 'msgpack'

if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.7.0')
require 'monitor'
else
# monitor_ext is bundled since ruby 2.7.0
require 'ext_monitor'
end



class Writer
include MonitorMixin
Expand Down
7 changes: 6 additions & 1 deletion lib/fluent/load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
require 'socket'
require 'fcntl'
require 'time'
require 'monitor'
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.7.0')
require 'monitor'
else
# monitor_ext is bundled since ruby 2.7.0
require 'ext_monitor'
end
require 'stringio'
require 'fileutils'
require 'json'
Expand Down
7 changes: 6 additions & 1 deletion lib/fluent/plugin/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
require 'fluent/plugin/owned_by_mixin'
require 'fluent/unique_id'

require 'monitor'
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.7.0')
require 'monitor'
else
# monitor_ext is bundled since ruby 2.7.0
require 'ext_monitor'
end

module Fluent
module Plugin
Expand Down
8 changes: 7 additions & 1 deletion lib/fluent/plugin/buffer/chunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
require 'fluent/unique_id'
require 'fluent/event'

require 'monitor'
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.7.0')
require 'monitor'
else
# monitor_ext is bundled since ruby 2.7.0
require 'ext_monitor'
end

require 'tempfile'
require 'zlib'

Expand Down
8 changes: 7 additions & 1 deletion lib/fluent/plugin/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
require 'fluent/clock'

require 'time'
require 'monitor'

if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.7.0')
require 'monitor'
else
# monitor_ext is bundled since ruby 2.7.0
require 'ext_monitor'
end

module Fluent
module Plugin
Expand Down

0 comments on commit d800743

Please sign in to comment.