Skip to content

Commit a75f5b6

Browse files
committed
WIP: support Ruby 2.4
For td-agent v3.1.1 and later. (Embedded Fluentd version must be v1) Exclude macOS because the latest macOS runner does not support old Ruby versions. Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent 7ad3dbc commit a75f5b6

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ jobs:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
include:
1717
- os: ubuntu-latest
18-
ruby: 2.7.1
18+
ruby: '2.7.1'
19+
- os: ubuntu-latest
20+
ruby: '2.4.2'
21+
- os: windows-latest
22+
ruby: '2.7.1'
1923
- os: windows-latest
20-
ruby: 2.7.1
24+
ruby: '2.4.2'
2125
runs-on: ${{ matrix.os }}
2226
name: Test with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
2327
steps:
@@ -50,14 +54,18 @@ jobs:
5054
strategy:
5155
fail-fast: false
5256
matrix:
53-
ruby: ['3.4', '3.3', '3.2', '2.7.1']
57+
ruby: ['3.4', '3.3', '3.2', '2.7.1', '2.4.2']
5458
# macOS is excluded because of the difficulty in assuming a macOS shell behavior.
5559
os: [ubuntu-latest, windows-latest]
5660
include:
5761
- os: ubuntu-latest
5862
shell: bash
5963
- os: windows-latest
6064
shell: cmd
65+
- ruby: '2.7.1'
66+
fluentd: '1.11.1'
67+
- ruby: '2.4.2'
68+
fluentd: '1.0.2'
6169
runs-on: ${{ matrix.os }}
6270
name: Gem test with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
6371
steps:
@@ -69,6 +77,9 @@ jobs:
6977
with:
7078
name: gem
7179
path: pkg
80+
- name: Install specific version Fluentd
81+
if: ${{ matrix.fluentd != '' }}
82+
run: gem install fluentd --version ${{ matrix.fluentd }}
7283
- name: Install gem
7384
run: gem install pkg/*
7485
- name: Test command (bash)

lib/fluent/tail_checker/collection_ratio_checker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def check
5050
ratio = collection_ratio(entry.pos, size)
5151
if ratio < @collection_ratio_threshold
5252
unacceptable_collection_ratio_found = true
53-
unacceptable_collection_ratio_path_and_ratio_list.append([entry.path, ratio])
53+
unacceptable_collection_ratio_path_and_ratio_list.push([entry.path, ratio])
5454
end
5555
end
5656

lib/fluent/tail_checker/pos.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def self.load_entries(path)
5050
end
5151

5252
def watching_entries
53-
entries.filter do |entry|
53+
entries.select do |entry|
5454
not entry.unwatched?
5555
end
5656
end

0 commit comments

Comments
 (0)