diff --git a/lib/csv.rb b/lib/csv.rb index 1e179f4edc17b8..65bb3fbad946c7 100644 --- a/lib/csv.rb +++ b/lib/csv.rb @@ -95,14 +95,11 @@ require_relative "csv/fields_converter" require_relative "csv/input_record_separator" -require_relative "csv/match_p" require_relative "csv/parser" require_relative "csv/row" require_relative "csv/table" require_relative "csv/writer" -using CSV::MatchP if CSV.const_defined?(:MatchP) - # == \CSV # \CSV (comma-separated variables) data is a text representation of a table: # - A _row_ _separator_ delimits table rows. diff --git a/lib/csv/delete_suffix.rb b/lib/csv/delete_suffix.rb deleted file mode 100644 index d4577189970198..00000000000000 --- 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 775559a3ebfbe6..00000000000000 --- 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 diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb index 7fe5f0d3abb9dc..9457ccab14fef6 100644 --- a/lib/csv/parser.rb +++ b/lib/csv/parser.rb @@ -2,15 +2,10 @@ require "strscan" -require_relative "delete_suffix" require_relative "input_record_separator" -require_relative "match_p" require_relative "row" require_relative "table" -using CSV::DeleteSuffix if CSV.const_defined?(:DeleteSuffix) -using CSV::MatchP if CSV.const_defined?(:MatchP) - class CSV # Note: Don't use this class directly. This is an internal class. class Parser diff --git a/lib/csv/writer.rb b/lib/csv/writer.rb index 4a9a35c5afc1ad..8cdf96c430a6af 100644 --- a/lib/csv/writer.rb +++ b/lib/csv/writer.rb @@ -1,11 +1,8 @@ # frozen_string_literal: true require_relative "input_record_separator" -require_relative "match_p" require_relative "row" -using CSV::MatchP if CSV.const_defined?(:MatchP) - class CSV # Note: Don't use this class directly. This is an internal class. class Writer