Skip to content

Commit f3c8f35

Browse files
authored
out_file: remove workaround for Ruby 2.7 and 3.0 on macOS (#4770)
**Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: Next fluentd version will drop support of Ruby 3.1 or below. Ref. #4745 So, we can remove the workaround for Ruby 2.7 and 3.0 on macOS that added at #3579 **Docs Changes**: **Release Note**: Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
1 parent ba5b206 commit f3c8f35

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/fluent/plugin/out_file.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,6 @@ def configure(conf)
189189
@dir_perm = system_config.dir_permission || Fluent::DEFAULT_DIR_PERMISSION
190190
@file_perm = system_config.file_permission || Fluent::DEFAULT_FILE_PERMISSION
191191
@need_lock = system_config.workers > 1
192-
193-
# https://github.com/fluent/fluentd/issues/3569
194-
@need_ruby_on_macos_workaround = false
195-
if @append && Fluent.macos?
196-
condition = Gem::Dependency.new('', [">= 2.7.0", "< 3.1.0"])
197-
@need_ruby_on_macos_workaround = true if condition.match?('', RUBY_VERSION)
198-
end
199192
end
200193

201194
def multi_workers_ready?
@@ -244,12 +237,7 @@ def write(chunk)
244237

245238
def write_without_compression(path, chunk)
246239
File.open(path, "ab", @file_perm) do |f|
247-
if @need_ruby_on_macos_workaround
248-
content = chunk.read()
249-
f.puts content
250-
else
251-
chunk.write_to(f)
252-
end
240+
chunk.write_to(f)
253241
end
254242
end
255243

0 commit comments

Comments
 (0)