Skip to content

Commit

Permalink
consistent ruby version in Github workflows / rubocop (including triv…
Browse files Browse the repository at this point in the history
…ial adaptions)
  • Loading branch information
Ithanil committed Dec 11, 2024
1 parent f8680b9 commit 1ec5a18
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.build.prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env:
RUBY_VERSION: 2.7.x
RUBY_VERSION: 3.3.6

name: CI Build Pre-Release
on:
Expand All @@ -12,7 +12,7 @@ jobs:
env:
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.build.push.master.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env:
RUBY_VERSION: 2.7.x
RUBY_VERSION: 3.3.6

name: CI Build Push
on:
Expand All @@ -15,7 +15,7 @@ jobs:
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
DOCKER_BUILD_ALTERNATE_ENABLED: ${{ secrets.DOCKER_BUILD_ALTERNATE_ENABLED }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Check preconditions
id: preconditions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.build.push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env:
RUBY_VERSION: 2.7.x
RUBY_VERSION: 3.3.6

name: CI Build Push
on:
Expand All @@ -18,7 +18,7 @@ jobs:
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
DOCKER_BUILD_ALTERNATE_ENABLED: ${{ secrets.DOCKER_BUILD_ALTERNATE_ENABLED }}
DOCKER_BUILD_ON_PUSH_DISABLED: ${{ secrets.DOCKER_BUILD_ON_PUSH_DISABLED }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Check preconditions
id: preconditions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.build.release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env:
RUBY_VERSION: 2.7.x
RUBY_VERSION: 3.3.6

name: CI Build Release
on:
Expand All @@ -12,7 +12,7 @@ jobs:
env:
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
if: contains(env.DOCKER_BUILD_ENABLED, 'true')
Expand Down
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AllCops:
- 'vendor/**/*'
- 'vendor/bundle/**/*'
DisabledByDefault: false
TargetRubyVersion: 2.7
TargetRubyVersion: 3.3

NewCops: enable

Expand Down Expand Up @@ -236,6 +236,9 @@ Style/OptionalBooleanParameter:
Style/SlicingWithRange:
Enabled: true

Style/HashSyntax:
EnforcedShorthandSyntax: either

RSpec/ContextWording:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '>= 3.0.0'
ruby '>= 3.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.2'
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/concerns/cookie_same_site_compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def cookie_same_site_none_incompatible?(useragent)

private

IOS_VERSION_REGEXP = %r{\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit/}.freeze
MACOS_VERSION_REGEXP = %r{\(Macintosh;.*Mac OS X (\d+)_(\d+)[_\d]*.*\) AppleWebKit/}.freeze
SAFARI_REGEXP = %r{Version/.* Safari/}.freeze
CHROMIUM_BASED_REGEXP = /Chrom(?:e|ium)/.freeze
CHROMIUM_VERSION_REGEXP = %r{Chrom[^ /]+/(\d+)[.\d]* }.freeze
MAC_EMBEDDED_REGEXP = %r{^Mozilla/[.\d]+ \(Macintosh;.*Mac OS X [_\d]+\) AppleWebKit/[.\d]+ \(KHTML, like Gecko\)$}.freeze
UC_BROWSER_REGEXP = %r{UCBrowser/}.freeze
UC_BROWSER_VERSION_REGEXP = %r{UCBrowser/(\d+)\.(\d+)\.(\d+)[.\d]* }.freeze
IOS_VERSION_REGEXP = %r{\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit/}
MACOS_VERSION_REGEXP = %r{\(Macintosh;.*Mac OS X (\d+)_(\d+)[_\d]*.*\) AppleWebKit/}
SAFARI_REGEXP = %r{Version/.* Safari/}
CHROMIUM_BASED_REGEXP = /Chrom(?:e|ium)/
CHROMIUM_VERSION_REGEXP = %r{Chrom[^ /]+/(\d+)[.\d]* }
MAC_EMBEDDED_REGEXP = %r{^Mozilla/[.\d]+ \(Macintosh;.*Mac OS X [_\d]+\) AppleWebKit/[.\d]+ \(KHTML, like Gecko\)$}
UC_BROWSER_REGEXP = %r{UCBrowser/}
UC_BROWSER_VERSION_REGEXP = %r{UCBrowser/(\d+)\.(\d+)\.(\d+)[.\d]* }

def webkit_same_site_bug?(useragent)
return true if ios_version?(12, useragent)
Expand Down
4 changes: 2 additions & 2 deletions app/models/application_redis_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def self.connection_pool
end
delegate :connection_pool, to: 'self.class'

def self.with_connection(&block)
RedisStore.with_connection(&block)
def self.with_connection(&)
RedisStore.with_connection(&)
end
delegate :with_connection, to: 'self.class'

Expand Down
4 changes: 2 additions & 2 deletions lib/redis_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.before_fork
end
end

def self.with_connection(&block)
connection_pool.with(&block)
def self.with_connection(&)
connection_pool.with(&)
end
end

0 comments on commit 1ec5a18

Please sign in to comment.