From fb9d3d3d502118a15a05dc6eff3f63d42ba30b0b Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 22 Aug 2025 17:49:47 +0200 Subject: [PATCH 1/2] Remove redundant encoding This magic comment is not needed anymore because the default encoding of source code files assumed by Ruby 2 is utf-8, and the minimum required Ruby version is 2.6 Auto-fixed via: ``` rubocop -a --only Style/Encoding ``` --- ethon.gemspec | 1 - lib/ethon/loggable.rb | 1 - profile/benchmarks.rb | 1 - spec/ethon/easy/queryable_spec.rb | 1 - 4 files changed, 4 deletions(-) diff --git a/ethon.gemspec b/ethon.gemspec index ed6c1ef8..9cfe0c9f 100644 --- a/ethon.gemspec +++ b/ethon.gemspec @@ -1,4 +1,3 @@ -# encoding: utf-8 # frozen_string_literal: true lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) diff --git a/lib/ethon/loggable.rb b/lib/ethon/loggable.rb index 02b74781..69821c11 100644 --- a/lib/ethon/loggable.rb +++ b/lib/ethon/loggable.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # frozen_string_literal: true module Ethon diff --git a/profile/benchmarks.rb b/profile/benchmarks.rb index 6cd68ca0..66a74bc4 100644 --- a/profile/benchmarks.rb +++ b/profile/benchmarks.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # frozen_string_literal: true require 'ethon' require 'open-uri' diff --git a/spec/ethon/easy/queryable_spec.rb b/spec/ethon/easy/queryable_spec.rb index 89c4d115..99618a16 100644 --- a/spec/ethon/easy/queryable_spec.rb +++ b/spec/ethon/easy/queryable_spec.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # frozen_string_literal: true require 'spec_helper' From 0199e72dc20a20d20fc39ee8f05e3bea00961d62 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 22 Aug 2025 18:29:04 +0200 Subject: [PATCH 2/2] Remove `require_relative` check `require_relative` has been introduced in Ruby 1.9.2 --- spec/spec_helper.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 55bc9ecb..6bf08cc0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,13 +7,8 @@ require "ethon" require 'rspec' -if defined? require_relative - require_relative 'support/localhost_server' - require_relative 'support/server' -else - require 'support/localhost_server' - require 'support/server' -end +require_relative 'support/localhost_server' +require_relative 'support/server' # Ethon.logger = Logger.new($stdout).tap do |log| # log.level = Logger::DEBUG