diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ae3e7e..87bb6e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,10 @@ jobs: strategy: matrix: ruby: - - '2.7.5' - '3.0.3' - '3.1.2' - '3.2.2' + - '3.4.2' steps: - uses: actions/checkout@v3 diff --git a/.rubocop.yml b/.rubocop.yml index 4354d0b..a75bcc7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,10 +2,10 @@ require: - rubocop-rspec AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 inherit_from: - - https://dbdrive.github.io/triebwerk/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 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..efbaa5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +## [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 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 0c4d992..a272c1f 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', '>= 6.1', '< 8.0' + spec.add_dependency 'activesupport', '>= 6.1', '< 9.0' spec.add_dependency 'faraday', '~> 2.7' spec.add_dependency 'rake', '~> 13.0' 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/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 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'