From bb4426b443a0bf3b6e9bdc3d5c0fbae11d0ba3e1 Mon Sep 17 00:00:00 2001 From: Aotokitsuruya Date: Wed, 11 Sep 2024 21:09:05 +0800 Subject: [PATCH] Drop Ruby 2.x support --- .github/workflows/main.yml | 6 +++--- .rubocop.yml | 3 ++- boxing.gemspec | 2 +- lib/boxing/generator.rb | 10 +++++----- lib/boxing/package.rb | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9014b0c..c777070 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: pull_request: env: - RUBY_VERSION: '2.7.6' + RUBY_VERSION: '3.3' jobs: rubocop: @@ -27,10 +27,10 @@ jobs: strategy: matrix: ruby: - - 2.6 - - 2.7 - 3.0 - 3.1 + - 3.2 + - 3.3 steps: - uses: actions/checkout@v2 - name: Set up Ruby diff --git a/.rubocop.yml b/.rubocop.yml index 1ed7e81..ef1331c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,7 +10,8 @@ # See https://docs.rubocop.org/rubocop/configuration AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.0 + SuggestExtensions: false NewCops: enable Metrics/BlockLength: diff --git a/boxing.gemspec b/boxing.gemspec index e56b5a0..17f1810 100644 --- a/boxing.gemspec +++ b/boxing.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = 'The zero-configuration Dockerfile generator for Ruby' spec.description = 'The zero-configuration Dockerfile generator for Ruby' spec.homepage = 'https://github.com/elct9620/boxing' - spec.required_ruby_version = '>= 2.5.0' + spec.required_ruby_version = '>= 3.0.0' spec.metadata['homepage_uri'] = spec.homepage spec.metadata['source_code_uri'] = 'https://github.com/elct9620/boxing' diff --git a/lib/boxing/generator.rb b/lib/boxing/generator.rb index d63932e..d7dff5b 100644 --- a/lib/boxing/generator.rb +++ b/lib/boxing/generator.rb @@ -11,12 +11,12 @@ class Generator ASCII_BOLD = "\e[1m" ASCII_RED = "\e[31m" - CREATED_MESSAGE = "#{ASCII_BOLD}create#{ASCII_CLEAR}\t%s" - IDENTICAL_MESSAGE = "#{ASCII_BOLD}identical#{ASCII_CLEAR}\t%s" - CONFLICT_MESSAGE = "#{ASCII_BOLD}#{ASCII_RED}conflict#{ASCII_CLEAR}\t%s" + CREATED_MESSAGE = "#{ASCII_BOLD}create#{ASCII_CLEAR}\t%s".freeze + IDENTICAL_MESSAGE = "#{ASCII_BOLD}identical#{ASCII_CLEAR}\t%s".freeze + CONFLICT_MESSAGE = "#{ASCII_BOLD}#{ASCII_RED}conflict#{ASCII_CLEAR}\t%s".freeze OVERWRITE_MESSAGE = 'Overwrite %s? (enter "h" for help) [Ynqdhm] ' - FORCE_MESSAGE = "#{ASCII_BOLD}force#{ASCII_CLEAR}\t%s" - SKIP_MESSAGE = "#{ASCII_BOLD}skip#{ASCII_CLEAR}\t%s" + FORCE_MESSAGE = "#{ASCII_BOLD}force#{ASCII_CLEAR}\t%s".freeze + SKIP_MESSAGE = "#{ASCII_BOLD}skip#{ASCII_CLEAR}\t%s".freeze MERGE_TOOL_NOT_FOUND = 'Please configure merge.tool in your Git config.' attr_reader :destination, :path diff --git a/lib/boxing/package.rb b/lib/boxing/package.rb index fb83fbe..14f59ea 100644 --- a/lib/boxing/package.rb +++ b/lib/boxing/package.rb @@ -14,7 +14,7 @@ class << self # # @since 0.1.0 def load(path) - data = YAML.safe_load(File.read(path)) + data = YAML.safe_load_file(path) mode = 0b00 mode |= Package::RUNTIME if data['runtime'] mode |= Package::BUILD if data['build']