Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Ruby 2.6 and 2.7 support #632

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Ruby 2.6
- name: Set up Ruby 3.0
uses: ruby/setup-ruby@master
with:
ruby-version: '2.6'
ruby-version: '3.0'
bundler-cache: true
- name: Install dependencies
run: bundle install --path=vendor/bundle --jobs 4 --retry 3
Expand All @@ -35,7 +35,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
ruby-version: ['3.0', '3.1', '3.2', '3.3']
imagemagick-version:
- { full: 7.1.1-29, major-minor: '7.1' }
name: Ruby ${{ matrix.ruby-version }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
ruby-version: ['9.3.10.0', '9.4.3.0']
ruby-version: ['9.4.6.0']
name: JRuby ${{ matrix.ruby-version }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:

AllCops:
EnabledByDefault: true
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
Exclude:
- 'vendor/bundle/**/*'
- 'rails_generators/gruff/**/*'
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM ubuntu:22.04

RUN apt update && \
apt install -y tzdata sudo && \
apt install -y make gcc git bzip2 wget zlib1g-dev libgdbm-dev libreadline-dev libffi-dev
apt install -y make build-essential git bzip2 wget zlib1g-dev libgdbm-dev libreadline-dev libffi-dev

RUN git clone --depth 1 https://github.com/rbenv/ruby-build.git && \
cd ruby-build/bin && ./ruby-build 2.6.10 /usr/local
cd ruby-build/bin && ./ruby-build 3.0.6 /usr/local

RUN mkdir /tmp/gruff
WORKDIR /tmp/gruff
Expand All @@ -17,7 +17,7 @@ ADD before_install_linux.sh /tmp/gruff/before_install_linux.sh
ENV IMAGEMAGICK_VERSION 7.1.1-29
RUN bash /tmp/gruff/before_install_linux.sh && \
rm -rf /var/lib/apt/lists/* && \
gem install bundler:2.4.22 && \
gem install bundler:2.5.7 && \
bundle install

WORKDIR /opt/gruff
2 changes: 1 addition & 1 deletion gruff.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
end
s.add_dependency 'histogram'
s.required_ruby_version = '>= 2.6.0'
s.required_ruby_version = '>= 3.0.0'

s.add_development_dependency 'rake'
s.add_development_dependency 'minitest-reporters'
Expand Down
8 changes: 4 additions & 4 deletions lib/gruff/store/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ def columns
end

def min
@min ||= @data.map(&:min).compact.min
@min ||= @data.filter_map(&:min).min
end
alias min_y min

def max
@max ||= @data.map(&:max).compact.max
@max ||= @data.filter_map(&:max).max
end
alias max_y max

def min_x
@min_x ||= @data.map(&:min_x).compact.min
@min_x ||= @data.filter_map(&:min_x).min
end

def max_x
@max_x ||= @data.map(&:max_x).compact.max
@max_x ||= @data.filter_map(&:max_x).max
end

def sort_data!
Expand Down
2 changes: 1 addition & 1 deletion test/test_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def test_many_numbers
]

%i[wpm errors accuracy].each do |field|
g.dataxy(field, data.each_with_index.map { |d, i| [i + 1, d[field]] if d[field] }.compact)
g.dataxy(field, data.each_with_index.filter_map { |d, i| [i + 1, d[field]] if d[field] })
end

labels = {}
Expand Down