From 5d482d2a6be306c75f64549c944a5a85457b2400 Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Wed, 30 Jul 2025 15:10:33 +0200 Subject: [PATCH 1/8] Update to ruby 3.4 and activesupport 7-8 --- .rubocop.yml | 2 +- .ruby-version | 2 +- CHANGELOG.md | 4 ++++ airship-ruby.gemspec | 4 ++-- lib/airship/version.rb | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4354d0b..76f1530 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ require: - rubocop-rspec AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.4 inherit_from: - https://dbdrive.github.io/triebwerk/rubocop_common.yml diff --git a/.ruby-version b/.ruby-version index be94e6f..4d9d11c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.4.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c09cb..b8fd3c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## [0.2.2] - 2025-07-30 +- Update to ruby 3.4 +- Ready for rails 8 + ## [0.2.1] - 2023-12-22 - Bugfix: Following named user listings across multiple pages diff --git a/airship-ruby.gemspec b/airship-ruby.gemspec index 0c4d992..af4b827 100644 --- a/airship-ruby.gemspec +++ b/airship-ruby.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/ioki-mobility/airship-ruby' spec.license = 'MIT' - spec.required_ruby_version = '>= 2.7.5' + spec.required_ruby_version = '>= 3.4.0' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. @@ -39,7 +39,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'activesupport', '>= 6.1', '< 8.0' + spec.add_dependency 'activesupport', '>= 7.1', '< 9.0' spec.add_dependency 'faraday', '~> 2.7' spec.add_dependency 'rake', '~> 13.0' diff --git a/lib/airship/version.rb b/lib/airship/version.rb index 4a7e309..5006a14 100644 --- a/lib/airship/version.rb +++ b/lib/airship/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Airship - VERSION = '0.2.1' + VERSION = '0.2.2' end From 4a23f2205533ef83ff06a5f9642be7c6b7ff68d1 Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Mon, 17 Nov 2025 13:21:49 +0100 Subject: [PATCH 2/8] Lower min version of activesupport --- airship-ruby.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airship-ruby.gemspec b/airship-ruby.gemspec index af4b827..3cae039 100644 --- a/airship-ruby.gemspec +++ b/airship-ruby.gemspec @@ -39,7 +39,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_dependency 'activesupport', '>= 7.1', '< 9.0' + spec.add_dependency 'activesupport', '>= 6.1', '< 9.0' spec.add_dependency 'faraday', '~> 2.7' spec.add_dependency 'rake', '~> 13.0' From b7110e36c2506720f940ee2919dfaf8c7234ae3e Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Mon, 17 Nov 2025 13:28:49 +0100 Subject: [PATCH 3/8] Remove old ruby versions in build strategy --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ae3e7e..816fe04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,8 @@ jobs: strategy: matrix: ruby: - - '2.7.5' - - '3.0.3' - - '3.1.2' - '3.2.2' + - '3.4.2' steps: - uses: actions/checkout@v3 From 7d12f2a3f9bebd0bbdd80de0e147cb1a9046b5ec Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Tue, 18 Nov 2025 10:39:35 +0100 Subject: [PATCH 4/8] Add base64 as require --- .github/workflows/main.yml | 3 +++ lib/airship.rb | 1 + spec/spec_helper.rb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 816fe04..c9c6a6c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,9 @@ jobs: strategy: matrix: ruby: + - '2.7.5' + - '3.0.3' + - '3.1.2' - '3.2.2' - '3.4.2' diff --git a/lib/airship.rb b/lib/airship.rb index 5feb444..7506087 100644 --- a/lib/airship.rb +++ b/lib/airship.rb @@ -2,6 +2,7 @@ require_relative 'airship/version' +require 'base64' require 'active_support/configurable' module Airship diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 323c9c7..0743f71 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'bundler/setup' -require 'airship' require 'faraday' require 'active_support' require 'active_support/core_ext/string' @@ -12,6 +11,7 @@ require 'active_support/deprecation' if ActiveSupport::VERSION::MAJOR > 6 require 'active_support/isolated_execution_state' if ActiveSupport::VERSION::MAJOR > 6 require 'webmock/rspec' +require 'airship' Dir['./spec/support/**/*.rb'].sort.each { |f| require f } Time.zone = 'UTC' From 60dd6b6ff32534b29df1a0108af74dd848ad7df0 Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Tue, 18 Nov 2025 10:46:37 +0100 Subject: [PATCH 5/8] Set target ruby version back to 2.7 --- .rubocop.yml | 5 +++-- Gemfile | 4 ++-- airship-ruby.gemspec | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 76f1530..b007bc0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,9 @@ -require: +plugins: - rubocop-rspec + - rubocop-factory_bot AllCops: - TargetRubyVersion: 3.4 + TargetRubyVersion: 2.7 inherit_from: - https://dbdrive.github.io/triebwerk/rubocop_common.yml diff --git a/Gemfile b/Gemfile index ebe47da..fe808a1 100644 --- a/Gemfile +++ b/Gemfile @@ -7,8 +7,8 @@ gemspec group 'development' do gem 'guard', '~> 2.18' gem 'guard-rspec', require: false - gem 'rspec', '~> 3.0' - gem 'rubocop', '~> 1.35' + gem 'rspec', '~> 3.7' + gem 'rubocop', '~> 1.81' gem 'rubocop-rspec' gem 'webmock' end diff --git a/airship-ruby.gemspec b/airship-ruby.gemspec index 3cae039..a272c1f 100644 --- a/airship-ruby.gemspec +++ b/airship-ruby.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/ioki-mobility/airship-ruby' spec.license = 'MIT' - spec.required_ruby_version = '>= 3.4.0' + spec.required_ruby_version = '>= 2.7.5' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. From 673fc02817a0a785ab5984fb4117102ddded0e11 Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Tue, 18 Nov 2025 12:30:08 +0100 Subject: [PATCH 6/8] Remove version 2.7 --- .github/workflows/main.yml | 1 - .rubocop.yml | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9c6a6c..87bb6e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: ruby: - - '2.7.5' - '3.0.3' - '3.1.2' - '3.2.2' diff --git a/.rubocop.yml b/.rubocop.yml index b007bc0..5e969fe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,12 +1,11 @@ -plugins: +require: - rubocop-rspec - - rubocop-factory_bot AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 inherit_from: - - https://dbdrive.github.io/triebwerk/rubocop_common.yml + - rubocop_common.yml RSpec/NestedGroups: Exclude: From 5701d2f85dc8e69a136870699f17feea380ded45 Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Tue, 18 Nov 2025 12:30:59 +0100 Subject: [PATCH 7/8] Add local rubocop file --- .rubocop.yml | 2 +- .rubocop_common.yml | 409 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 .rubocop_common.yml diff --git a/.rubocop.yml b/.rubocop.yml index 5e969fe..a75bcc7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: TargetRubyVersion: 3.0 inherit_from: - - rubocop_common.yml + - .rubocop_common.yml RSpec/NestedGroups: Exclude: diff --git a/.rubocop_common.yml b/.rubocop_common.yml new file mode 100644 index 0000000..b91d0b3 --- /dev/null +++ b/.rubocop_common.yml @@ -0,0 +1,409 @@ +plugins: + - rubocop-rspec + +AllCops: + NewCops: enable + Exclude: + - 'bin/**/*' + - 'config/**/*' + - 'db/**/*' + - 'node_modules/**/*' + - 'tmp/**/*' + - 'vendor/**/*' + - 'utils/**/*' + SuggestExtensions: false + +########## BUNDLER +Bundler/OrderedGems: + Enabled: false + +########## FACTORY BOT + +FactoryBot/SyntaxMethods: + Enabled: false + +########## LAYOUT +Layout/DotPosition: + EnforcedStyle: leading + +Layout/EmptyLinesAroundModuleBody: + Enabled: false + +Layout/EmptyLinesAroundClassBody: + Enabled: false + +Layout/ExtraSpacing: + # We use extra spacing deliberately to make table-like information more + # readable. This cop is not smart enough to always recognize the intent. + Enabled: false + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/HashAlignment: + EnforcedColonStyle: table + EnforcedHashRocketStyle: table + +Layout/LineLength: + AutoCorrect: false + Max: 120 + AllowedPatterns: ['\A\s*#'] + +Layout/MultilineMethodCallIndentation: + EnforcedStyle: indented + +Layout/SpaceBeforeBrackets: + # We are using a lot of method calls without parentheses and use an array as + # an argument. Those calls would be broken + Enabled: false + +########## LINT +# Disabled as a suggestion from https://github.com/rubocop-hq/rubocop/issues/4222 +Lint/AmbiguousBlockAssociation: + Exclude: + - 'spec/**/*.rb' + +Lint/EmptyWhen: + Enabled: false + +Lint/DuplicateElsifCondition: + Enabled: false + +Lint/DuplicateRequire: + Enabled: false + +Lint/DuplicateRescueException: + Enabled: false + +Lint/EmptyConditionalBody: + Enabled: false + +Lint/EmptyFile: + Enabled: false + +Lint/FloatComparison: + Enabled: false + +Lint/HashCompareByIdentity: + Enabled: false + +Lint/IdentityComparison: + Enabled: false + +Lint/MissingSuper: + Enabled: false + +Lint/MixedRegexpCaptureTypes: + Enabled: false + +Lint/NoReturnInBeginEndBlocks: + Enabled: false + +Lint/OutOfRangeRegexpRef: + Enabled: false + +Lint/RedundantSafeNavigation: + Enabled: false + +Lint/SelfAssignment: + Enabled: false + +Lint/SymbolConversion: + # Both "string_#{interpolation}".to_sym and :"string_#{interpolation}"" have their place. + Enabled: false + +Lint/TopLevelReturnWithArgument: + Enabled: false + +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false + +Lint/UnreachableLoop: + Enabled: false + +Lint/UselessMethodDefinition: + Enabled: false + +Lint/UselessTimes: + Enabled: false + +########## METRICS +Metrics/AbcSize: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Metrics/ClassLength: + Enabled: false + +Metrics/BlockLength: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +########## NAMING +Naming/InclusiveLanguage: + Enabled: false + Severity: info + +Naming/PredicatePrefix: + # Renaming `has_something?` to `something?` obfuscates whether it is a "is-a" or + # a "has-a" relationship. + Enabled: false + +Naming/PredicateMethod: + # Too many false positives in our code base. + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/VariableNumber: + Enabled: false + +Naming/MemoizedInstanceVariableName: + Exclude: + - 'app/controllers/**/*' + - 'spec/controllers/**/*' + +########## STYLE +Style/Documentation: + Enabled: false + +Style/EmptyElse: + EnforcedStyle: empty + +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Exclude: + - 'spec/**/*' + +Style/IfUnlessModifier: + Enabled: false + +# Requires Ruby 3.1 +Style/NestedFileDirname: + Enabled: false + +Style/NumericPredicate: + EnforcedStyle: comparison + +Style/SymbolArray: + EnforcedStyle: brackets + +Style/NegatedIf: + Enabled: false + +Style/EmptyMethod: + Enabled: false + +Style/EmptyStringInsideInterpolation: + Enabled: false + +Style/CollectionQuerying: + Enabled: false + +Style/FormatStringToken: + Enabled: false + +Style/GuardClause: + Enabled: false + +Style/MultilineTernaryOperator: + Enabled: false + +Style/DoubleNegation: + Enabled: false + +Style/SingleLineBlockParams: + Enabled: false + +Style/RedundantCondition: + Enabled: false + +Style/TrailingUnderscoreVariable: + Enabled: false + +Style/MultilineBlockChain: + Enabled: false + +Style/AsciiComments: + Enabled: false + +Style/RedundantReturn: + Enabled: false + +Style/ZeroLengthPredicate: + Enabled: false + +Style/TernaryParentheses: + EnforcedStyle: require_parentheses_when_complex + +Style/FloatDivision: + Enabled: false + +Style/CommentedKeyword: + Enabled: false + +Style/AccessorGrouping: + Enabled: false + +Style/BisectedAttrAccessor: + Enabled: false + +Style/CaseLikeIf: + Enabled: false + +Style/ClassEqualityComparison: + Enabled: false + +Style/CombinableLoops: + Enabled: false + +Style/ExplicitBlockArgument: + Enabled: false + +Style/ExponentialNotation: + Enabled: false + +Style/GlobalStdStream: + Enabled: false + +Style/HashAsLastArrayItem: + Enabled: false + +Style/HashLikeCase: + Enabled: false + +Style/KeywordParametersOrder: + Enabled: false + +Style/OptionalBooleanParameter: + Enabled: false + +Style/RedundantArgument: + Enabled: false + +Style/RedundantAssignment: + Enabled: false + +Style/RedundantFetchBlock: + Enabled: false + +Style/RedundantFileExtensionInRequire: + Enabled: false + +Style/RedundantRegexpCharacterClass: + Enabled: false + +Style/RedundantRegexpEscape: + Enabled: false + +Style/RedundantSelfAssignment: + Enabled: false + +Style/SignalException: + # When running rubocop with autocorrect (-a) + # this changes our tests for failing operations + # it { is_expected.to fail.with_error(:foobar) } + # to + # it { is_expected.to raise.with_error(:foobar) } + # + # which of course does not work ... + Exclude: + - '**/*_spec.rb' + - 'spec/support/*.rb' + +Style/SingleArgumentDig: + Enabled: false + +Style/SlicingWithRange: + Enabled: false + +Style/SoleNestedConditional: + Enabled: false + +Style/StringConcatenation: + Enabled: false + +Style/WordArray: + Enabled: false + +Style/RegexpLiteral: + Enabled: false + +Style/YodaExpression: + Enabled: false + +# ----------------------------------------------------------------------------- +# RuboCop RSpec +RSpec/AnyInstance: + Enabled: false + +RSpec/BeEmpty: + Enabled: false + +RSpec/BeEql: + Enabled: false + +RSpec/ContextWording: + Enabled: false + +RSpec/EmptyLineAfterFinalLet: + Enabled: false + +RSpec/ExampleLength: + Enabled: false + +RSpec/ImplicitSubject: + EnforcedStyle: single_statement_only + +RSpec/IndexedLet: + Enabled: false + +RSpec/LetSetup: + Enabled: false + +RSpec/MatchArray: + Enabled: false + +RSpec/MessageSpies: + EnforcedStyle: receive + +RSpec/MultipleExpectations: + Enabled: false + +RSpec/MultipleMemoizedHelpers: + Enabled: false + +RSpec/NamedSubject: + Enabled: false + +RSpec/ReceiveMessages: + Enabled: false + +RSpec/SortMetadata: + Enabled: false + +RSpec/StubbedMock: + Enabled: false + +RSpec/VariableName: + EnforcedStyle: snake_case + AllowedPatterns: + - '^X-' + - 'Authorization' + +# ----------------------------------------------------------------------------- +# RuboCop FactoryBot +FactoryBot/ExcessiveCreateList: + # We know what we're doing. + Enabled: false From b7c9cbc476a32e9eea57262cc129843eb34199ac Mon Sep 17 00:00:00 2001 From: Patrick Kocurek Date: Tue, 18 Nov 2025 12:34:58 +0100 Subject: [PATCH 8/8] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8fd3c3..efbaa5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [0.2.2] - 2025-07-30 - Update to ruby 3.4 - Ready for rails 8 +- Remove support for Ruby 2.7 ## [0.2.1] - 2023-12-22 - Bugfix: Following named user listings across multiple pages