From 43b95bafd57d04c8fb401d3a9b52aca3f5b4b0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Mon, 27 Jul 2020 11:15:50 +0900 Subject: delete deprecated IO-like methods This commit deletes {IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which have been deprecated since c47c095b9740e7c19d6fdca29ab661c1089221d4. Note that String also has those methods. They are neither depreacted nor deleted because they are not aliases of counterpart each_something. --- io.c | 117 ------------------------------------------------------------------- 1 file changed, 117 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index ca59729e7a..0182042b39 100644 --- a/io.c +++ b/io.c @@ -3958,19 +3958,6 @@ rb_io_each_line(int argc, VALUE *argv, VALUE io) return io; } -/* - * This is a deprecated alias for #each_line. - */ - -static VALUE -rb_io_lines(int argc, VALUE *argv, VALUE io) -{ - rb_warn_deprecated("IO#lines", "#each_line"); - if (!rb_block_given_p()) - return rb_enumeratorize(io, ID2SYM(rb_intern("each_line")), argc, argv); - return rb_io_each_line(argc, argv, io); -} - /* * call-seq: * ios.each_byte {|byte| block } -> ios @@ -4009,19 +3996,6 @@ rb_io_each_byte(VALUE io) return io; } -/* - * This is a deprecated alias for #each_byte. - */ - -static VALUE -rb_io_bytes(VALUE io) -{ - rb_warn_deprecated("IO#bytes", "#each_byte"); - if (!rb_block_given_p()) - return rb_enumeratorize(io, ID2SYM(rb_intern("each_byte")), 0, 0); - return rb_io_each_byte(io); -} - static VALUE io_getc(rb_io_t *fptr, rb_encoding *enc) { @@ -4163,20 +4137,6 @@ rb_io_each_char(VALUE io) return io; } -/* - * This is a deprecated alias for #each_char. - */ - -static VALUE -rb_io_chars(VALUE io) -{ - rb_warn_deprecated("IO#chars", "#each_char"); - if (!rb_block_given_p()) - return rb_enumeratorize(io, ID2SYM(rb_intern("each_char")), 0, 0); - return rb_io_each_char(io); -} - - /* * call-seq: * ios.each_codepoint {|c| block } -> ios @@ -4294,20 +4254,6 @@ rb_io_each_codepoint(VALUE io) UNREACHABLE_RETURN(Qundef); } -/* - * This is a deprecated alias for #each_codepoint. - */ - -static VALUE -rb_io_codepoints(VALUE io) -{ - rb_warn_deprecated("IO#codepoints", "#each_codepoint"); - if (!rb_block_given_p()) - return rb_enumeratorize(io, ID2SYM(rb_intern("each_codepoint")), 0, 0); - return rb_io_each_codepoint(io); -} - - /* * call-seq: * ios.getc -> string or nil @@ -12754,24 +12700,8 @@ argf_each_line(int argc, VALUE *argv, VALUE argf) return argf; } -/* - * This is a deprecated alias for #each_line. - */ - -static VALUE -argf_lines(int argc, VALUE *argv, VALUE argf) -{ - rb_warn_deprecated("ARGF#lines", "#each_line"); - if (!rb_block_given_p()) - return rb_enumeratorize(argf, ID2SYM(rb_intern("each_line")), argc, argv); - return argf_each_line(argc, argv, argf); -} - /* * call-seq: - * ARGF.bytes {|byte| block } -> ARGF - * ARGF.bytes -> an_enumerator - * * ARGF.each_byte {|byte| block } -> ARGF * ARGF.each_byte -> an_enumerator * @@ -12801,19 +12731,6 @@ argf_each_byte(VALUE argf) return argf; } -/* - * This is a deprecated alias for #each_byte. - */ - -static VALUE -argf_bytes(VALUE argf) -{ - rb_warn_deprecated("ARGF#bytes", "#each_byte"); - if (!rb_block_given_p()) - return rb_enumeratorize(argf, ID2SYM(rb_intern("each_byte")), 0, 0); - return argf_each_byte(argf); -} - /* * call-seq: * ARGF.each_char {|char| block } -> ARGF @@ -12840,19 +12757,6 @@ argf_each_char(VALUE argf) return argf; } -/* - * This is a deprecated alias for #each_char. - */ - -static VALUE -argf_chars(VALUE argf) -{ - rb_warn_deprecated("ARGF#chars", "#each_char"); - if (!rb_block_given_p()) - return rb_enumeratorize(argf, ID2SYM(rb_intern("each_char")), 0, 0); - return argf_each_char(argf); -} - /* * call-seq: * ARGF.each_codepoint {|codepoint| block } -> ARGF @@ -12879,19 +12783,6 @@ argf_each_codepoint(VALUE argf) return argf; } -/* - * This is a deprecated alias for #each_codepoint. - */ - -static VALUE -argf_codepoints(VALUE argf) -{ - rb_warn_deprecated("ARGF#codepoints", "#each_codepoint"); - if (!rb_block_given_p()) - return rb_enumeratorize(argf, ID2SYM(rb_intern("each_codepoint")), 0, 0); - return argf_each_codepoint(argf); -} - /* * call-seq: * ARGF.filename -> String @@ -13555,10 +13446,6 @@ Init_IO(void) rb_define_method(rb_cIO, "each_byte", rb_io_each_byte, 0); rb_define_method(rb_cIO, "each_char", rb_io_each_char, 0); rb_define_method(rb_cIO, "each_codepoint", rb_io_each_codepoint, 0); - rb_define_method(rb_cIO, "lines", rb_io_lines, -1); - rb_define_method(rb_cIO, "bytes", rb_io_bytes, 0); - rb_define_method(rb_cIO, "chars", rb_io_chars, 0); - rb_define_method(rb_cIO, "codepoints", rb_io_codepoints, 0); rb_define_method(rb_cIO, "syswrite", rb_io_syswrite, 1); rb_define_method(rb_cIO, "sysread", rb_io_sysread, -1); @@ -13697,10 +13584,6 @@ Init_IO(void) rb_define_method(rb_cARGF, "each_byte", argf_each_byte, 0); rb_define_method(rb_cARGF, "each_char", argf_each_char, 0); rb_define_method(rb_cARGF, "each_codepoint", argf_each_codepoint, 0); - rb_define_method(rb_cARGF, "lines", argf_lines, -1); - rb_define_method(rb_cARGF, "bytes", argf_bytes, 0); - rb_define_method(rb_cARGF, "chars", argf_chars, 0); - rb_define_method(rb_cARGF, "codepoints", argf_codepoints, 0); rb_define_method(rb_cARGF, "read", argf_read, -1); rb_define_method(rb_cARGF, "readpartial", argf_readpartial, -1); -- cgit v1.2.3