From 482fc28fdab73d00f15ba94e0432f7c245a1c31d Mon Sep 17 00:00:00 2001 From: Jerome Lacoste Date: Tue, 27 Feb 2024 21:23:12 +0100 Subject: [PATCH] Drop ruby 2.6 support --- .circleci/config.yml | 13 +++--------- .rubocop.yml | 2 +- Gemfile | 6 +----- Gemfile.lock | 6 +++--- appveyor.yml | 3 +-- bin/fastlane | 4 ++-- fastlane.gemspec | 4 ++-- .../plugins/template/%gem_name%.gemspec.erb | 2 +- spaceship/lib/spaceship/spaceauth_runner.rb | 20 +++++-------------- 9 files changed, 19 insertions(+), 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8209622c375..c1c6d463eff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -263,11 +263,6 @@ workflows: version: 2 "Run Tests & Checks": # Name of the workflow, which ends up displayed on GitHub's PR Check jobs: - - tests_macos: - name: 'Execute tests on macOS (Xcode 12.5.1, Ruby 2.6)' - xcode_version: '12.5.1' - ruby_version: '2.6.6' - <<: *important-branches - tests_macos: name: 'Execute tests on macOS (Xcode 12.5.1, Ruby 2.7)' xcode_version: '12.5.1' @@ -312,8 +307,7 @@ workflows: ruby_opt: -W:deprecated - tests_ubuntu: name: 'Execute tests on Ubuntu' - image: 'fastlanetools/ci:0.3.0' - ruby_version: '2.6' + ruby_version: 'cimg/ruby:2.7' - validate_fastlane_swift_generation: name: 'Validate Fastlane.swift generation' xcode_version: '12.5.1' @@ -324,8 +318,7 @@ workflows: ruby_version: '3.2' - lint_source_code: name: 'Lint source code' - image: 'cimg/ruby:2.6' - ruby_version: '2.6' + image: 'cimg/ruby:2.7' - modules_load_up_tests: name: 'Modules load up tests' - image: 'cimg/ruby:2.6' + image: 'cimg/ruby:2.7' \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 60bac9e7364..773c1824126 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,7 +8,7 @@ require: - ./rubocop/is_string_usage.rb AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 NewCops: enable Include: - '**/*.rb' diff --git a/Gemfile b/Gemfile index e2bcfcd7feb..df202250af0 100644 --- a/Gemfile +++ b/Gemfile @@ -19,11 +19,7 @@ gem "fakefs", "1.8" # for file uploads with Faraday gem "mime-types", ['>= 1.16', '< 4.0'] # Fast XML parser and object marshaller. -if RUBY_VERSION < '2.7.0' - gem "ox", "2.13.2" -else - gem "ox", "2.14.16" -end +gem "ox", "2.14.16" # Provides an interactive debugging environment for Ruby. gem "pry" # A plugin for pry that adds step-by-step debugging and stack navigation. diff --git a/Gemfile.lock b/Gemfile.lock index 744377ec302..3b008183432 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -216,7 +216,7 @@ GEM open4 (1.3.4) optparse (0.4.0) os (1.1.4) - ox (2.13.2) + ox (2.14.16) parallel (1.23.0) parser (3.2.2.3) ast (~> 2.4.1) @@ -371,7 +371,7 @@ DEPENDENCIES fastlane-plugin-ruby fastlane-plugin-slack_train (>= 0.2.0) mime-types (>= 1.16, < 4.0) - ox (= 2.13.2) + ox (= 2.14.16) pry pry-byebug pry-rescue @@ -390,4 +390,4 @@ DEPENDENCIES yard (~> 0.9.11) BUNDLED WITH - 2.3.21 + 2.3.13 diff --git a/appveyor.yml b/appveyor.yml index 98ce8674d4c..865d9fe1b4b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,8 +42,7 @@ environment: LANG: en_US.UTF-8 FASTLANE_ITUNES_TRANSPORTER_PATH: C:/tmp matrix: - - ruby_version: 26-x64 - # - ruby_version: 27-x64 + - ruby_version: 27-x64 # - ruby_version: 30-x64 # disabled for now as we only have 1 concurent job # - ruby_version: 31-x64 - ruby_version: 32-x64 diff --git a/bin/fastlane b/bin/fastlane index 2fd9a0060bc..29cf5ca10b4 100755 --- a/bin/fastlane +++ b/bin/fastlane @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -if RUBY_VERSION < '2.0.0' - abort("fastlane requires Ruby 2.0.0 or higher") +if RUBY_VERSION < '2.7.0' + abort("fastlane requires Ruby 2.7.0 or higher") end def self.windows? diff --git a/fastlane.gemspec b/fastlane.gemspec index 88eb92f79cb..24793116a96 100644 --- a/fastlane.gemspec +++ b/fastlane.gemspec @@ -7,7 +7,7 @@ require 'fastlane/version' # Copy over the latest .rubocop.yml style guide require 'yaml' rubocop_config = File.expand_path('../.rubocop.yml', __FILE__) -config = YAML.safe_load(open(rubocop_config)) +config = YAML.safe_load(open(rubocop_config), aliases: true) config['require'] = [ 'rubocop/require_tools', 'rubocop-performance' @@ -62,7 +62,7 @@ Gem::Specification.new do |spec| "source_code_uri" => "https://github.com/fastlane/fastlane" } - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = '>= 2.7' spec.files = Dir.glob("*/lib/**/*", File::FNM_DOTMATCH) + Dir["fastlane/swift/**/*"] + Dir["bin/*"] + Dir["*/README.md"] + %w(README.md LICENSE .yardopts) - Dir["fastlane/lib/fastlane/actions/device_grid/assets/*"] - Dir["fastlane/lib/fastlane/actions/docs/assets/*"] spec.bindir = "bin" diff --git a/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb b/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb index 33e754dc98a..a1adf16eac0 100644 --- a/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +++ b/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb @@ -15,7 +15,7 @@ Gem::Specification.new do |spec| spec.files = Dir["lib/**/*"] + %w(README.md LICENSE) spec.require_paths = ['lib'] spec.metadata['rubygems_mfa_required'] = 'true' - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = '>= 2.7' # Don't add a dependency to fastlane or fastlane_re # since this would cause a circular dependency diff --git a/spaceship/lib/spaceship/spaceauth_runner.rb b/spaceship/lib/spaceship/spaceauth_runner.rb index cd213a4207d..9ac0253c8e0 100644 --- a/spaceship/lib/spaceship/spaceauth_runner.rb +++ b/spaceship/lib/spaceship/spaceauth_runner.rb @@ -68,21 +68,11 @@ def run end def load_cookies(content) - # When Ruby 2.5 support is dropped, we can safely get rid of the latter branch. - if YAML.name == 'Psych' && Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1') - YAML.safe_load( - content, - permitted_classes: [HTTP::Cookie, Time], - aliases: true - ) - else - YAML.safe_load( - content, - [HTTP::Cookie, Time], # classes allowlist - [], # symbols allowlist - true # allow YAML aliases - ) - end + YAML.safe_load( + content, + permitted_classes: [HTTP::Cookie, Time], + aliases: true + ) end def session_string