From a0709d0aae9609688f13e16bbae7ef84da78b24b Mon Sep 17 00:00:00 2001 From: Mau Magnaguagno Date: Sat, 18 Jun 2022 10:32:35 -0300 Subject: [ruby/csv] Remove no longer required refinements (https://github.com/ruby/csv/pull/250) Since PR #159, the minimum Ruby version is 2.5.0, a version which no longer requires refinements for String#delete_suffix?, String#match? and Regexp#match?. --- lib/csv/delete_suffix.rb | 18 ------------------ lib/csv/match_p.rb | 20 -------------------- 2 files changed, 38 deletions(-) delete mode 100644 lib/csv/delete_suffix.rb delete mode 100644 lib/csv/match_p.rb (limited to 'lib') diff --git a/lib/csv/delete_suffix.rb b/lib/csv/delete_suffix.rb deleted file mode 100644 index d457718997..0000000000 --- a/lib/csv/delete_suffix.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# This provides String#delete_suffix? for Ruby 2.4. -unless String.method_defined?(:delete_suffix) - class CSV - module DeleteSuffix - refine String do - def delete_suffix(suffix) - if end_with?(suffix) - self[0...-suffix.size] - else - self - end - end - end - end - end -end diff --git a/lib/csv/match_p.rb b/lib/csv/match_p.rb deleted file mode 100644 index 775559a3eb..0000000000 --- a/lib/csv/match_p.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# This provides String#match? and Regexp#match? for Ruby 2.3. -unless String.method_defined?(:match?) - class CSV - module MatchP - refine String do - def match?(pattern) - self =~ pattern - end - end - - refine Regexp do - def match?(string) - self =~ string - end - end - end - end -end -- cgit v1.2.3