From 61dfb27c1e13c2de9ae3ab024a08c9140c26748f Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Tue, 10 Jan 2023 19:20:57 +0000 Subject: [PATCH] Bump minimum Ruby version to 3.0 This bumps the Ruby version in the devcontainer, removes 2.7 from the CI, and updates the gemspec. This also fixes a style issue that was detected in version 3.0. --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci.yml | 7 ++----- .github/workflows/pages.yml | 2 +- .github/workflows/release.yml | 2 +- lib/repofetch/github.rb | 4 ++-- lib/repofetch/gitlab.rb | 4 ++-- repofetch.gemspec | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 249763e4..5c7db707 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,2 +1,2 @@ -ARG VARIANT="2.7-buster" +ARG VARIANT="3.0-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7759a14e..e637a144 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ { "build": { "dockerfile": "Dockerfile", - "args": { "VARIANT": "2.7-buster" } + "args": { "VARIANT": "3.0-bullseye" } }, "extensions": [ "EditorConfig.EditorConfig", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddc5c31a..2007872b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,10 @@ jobs: - macos-latest - windows-latest ruby-version: - - '2.7' - '3.0' - '3.1' exclude: # TODO: Figure out why Windows breaks on these - - os: windows-latest - ruby-version: '2.7' - os: windows-latest ruby-version: '3.0' @@ -53,7 +50,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' bundler-cache: true - name: Check Style @@ -68,7 +65,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' bundler-cache: true - name: Check Docs diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ecb5808a..56ffd465 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -27,7 +27,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' bundler-cache: true - name: Build Docs run: bundle exec yardoc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0db1f428..b67828ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: '3.0' - run: bundle install - name: Set Up Credentials env: diff --git a/lib/repofetch/github.rb b/lib/repofetch/github.rb index 2c6364d4..8ae953b4 100644 --- a/lib/repofetch/github.rb +++ b/lib/repofetch/github.rb @@ -11,8 +11,8 @@ class Repofetch class Github < Repofetch::Plugin include ActionView::Helpers::NumberHelper - HTTP_REMOTE_REGEX = %r{https?://github\.com/(?[\w.\-]+)/(?[\w.\-]+)}.freeze - SSH_REMOTE_REGEX = %r{git@github\.com:(?[\w.\-]+)/(?[\w.\-]+)}.freeze + HTTP_REMOTE_REGEX = %r{https?://github\.com/(?[\w.\-]+)/(?[\w.\-]+)} + SSH_REMOTE_REGEX = %r{git@github\.com:(?[\w.\-]+)/(?[\w.\-]+)} ASCII = File.read(File.expand_path('github/ASCII', __dir__)) attr_reader :owner, :repository diff --git a/lib/repofetch/gitlab.rb b/lib/repofetch/gitlab.rb index 4f8ecbcb..6ac30d11 100644 --- a/lib/repofetch/gitlab.rb +++ b/lib/repofetch/gitlab.rb @@ -8,8 +8,8 @@ class Repofetch # Adds support for GitLab repositories. class Gitlab < Repofetch::Plugin - HTTP_REMOTE_REGEX = %r{https?://gitlab\.com/(?[\w.\-][\w.\-/]+)}.freeze - SSH_REMOTE_REGEX = %r{git@gitlab\.com:(?[\w.\-][\w.\-/]+)}.freeze + HTTP_REMOTE_REGEX = %r{https?://gitlab\.com/(?[\w.\-][\w.\-/]+)} + SSH_REMOTE_REGEX = %r{git@gitlab\.com:(?[\w.\-][\w.\-/]+)} ASCII = File.read(File.expand_path('gitlab/ASCII', __dir__)) attr_reader :repo_identifier diff --git a/repofetch.gemspec b/repofetch.gemspec index 703b1169..d8482ef9 100644 --- a/repofetch.gemspec +++ b/repofetch.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/spenserblack/repofetch' spec.license = 'MIT' - spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0') + spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0') spec.files = Dir['lib/**/*'] + Dir['exe/*'] + Dir['[A-Z]*']