ruby-changes:57830
From: Hiroshi <ko1@a...>
Date: Fri, 20 Sep 2019 12:43:38 +0900 (JST)
Subject: [ruby-changes:57830] 67a6662032 (master): Removed Scanf from the ruby repository.
https://git.ruby-lang.org/ruby.git/commit/?id=67a6662032 From 67a6662032d0a7c4af07f44c2046cd0ed2d7d253 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Fri, 20 Sep 2019 12:42:53 +0900 Subject: Removed Scanf from the ruby repository. diff --git a/NEWS b/NEWS index 365e18b..459d205 100644 --- a/NEWS +++ b/NEWS @@ -329,6 +329,7 @@ RubyGems:: https://github.com/ruby/ruby/blob/trunk/NEWS#L329 * Removed unmaintained libraries. * CMath + * Scanf === Stdlib compatibility issues (excluding feature bug fixes) diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc index 370dce5..c2e3600 100644 --- a/doc/maintainers.rdoc +++ b/doc/maintainers.rdoc @@ -220,9 +220,6 @@ Zachary Scott (zzak) https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc#L220 [lib/rss.rb, lib/rss/*] Kouhei Sutou (kou) https://github.com/ruby/rss -[lib/scanf.rb] - David A. Black (dblack) - https://github.com/ruby/scanf [lib/shell.rb, lib/shell/*] Keiju ISHITSUKA (keiju) https://github.com/ruby/shell diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc index b11ca93..3edfa8a 100644 --- a/doc/standard_library.rdoc +++ b/doc/standard_library.rdoc @@ -87,7 +87,6 @@ Racc:: A LALR(1) parser generator written in Ruby. https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L87 RDoc:: Produces HTML and command-line documentation for Ruby REXML:: An XML toolkit for Ruby RSS:: Family of libraries that support various formats of XML "feeds" -Scanf:: A Ruby implementation of the C function scanf(3) Shell:: An idiomatic Ruby interface for common UNIX shell commands Synchronizer:: A module that provides a two-phase lock with a counter ThreadsWait:: Watches for termination of multiple threads diff --git a/lib/scanf.gemspec b/lib/scanf.gemspec deleted file mode 100644 index e845427..0000000 --- a/lib/scanf.gemspec +++ /dev/null @@ -1,24 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L0 -# coding: utf-8 -# frozen_string_literal: true - -Gem::Specification.new do |spec| - spec.name = "scanf" - spec.version = "1.0.0" - spec.authors = ["David Alan Black"] - spec.email = ['dblack@s...'] - - spec.summary = "scanf is an implementation of the C function scanf(3)." - spec.description = "scanf is an implementation of the C function scanf(3)." - spec.homepage = "https://github.com/ruby/scanf" - spec.license = "BSD-2-Clause" - - spec.files = ["lib/scanf.rb"] - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.3.0" - - spec.add_development_dependency "bundler", "~> 1.14" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "test-unit" -end diff --git a/lib/scanf.rb b/lib/scanf.rb deleted file mode 100644 index 23ebbbd..0000000 --- a/lib/scanf.rb +++ /dev/null @@ -1,776 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L0 -# frozen_string_literal: false -# scanf for Ruby -# -#-- -# $Release Version: 1.1.2 $ -# $Revision$ -# $Id$ -# $Author$ -#++ -# -# == Description -# -# scanf is an implementation of the C function scanf(3), modified as necessary -# for Ruby compatibility. -# -# The methods provided are String#scanf, IO#scanf, and -# Kernel#scanf. Kernel#scanf is a wrapper around STDIN.scanf. IO#scanf -# can be used on any IO stream, including file handles and sockets. -# scanf can be called either with or without a block. -# -# Scanf scans an input string or stream according to a <b>format</b>, as -# described below in Conversions, and returns an array of matches between -# the format and the input. The format is defined in a string, and is -# similar (though not identical) to the formats used in Kernel#printf and -# Kernel#sprintf. -# -# The format may contain <b>conversion specifiers</b>, which tell scanf -# what form (type) each particular matched substring should be converted -# to (e.g., decimal integer, floating point number, literal string, -# etc.) The matches and conversions take place from left to right, and -# the conversions themselves are returned as an array. -# -# The format string may also contain characters other than those in the -# conversion specifiers. Whitespace (blanks, tabs, or newlines) in the -# format string matches any amount of whitespace, including none, in -# the input. Everything else matches only itself. -# -# Scanning stops, and scanf returns, when any input character fails to -# match the specifications in the format string, or when input is -# exhausted, or when everything in the format string has been -# matched. All matches found up to the stopping point are returned in -# the return array (or yielded to the block, if a block was given). -# -# -# == Basic usage -# -# require 'scanf' -# -# # String#scanf and IO#scanf take a single argument, the format string -# array = a_string.scanf("%d%s") -# array = an_io.scanf("%d%s") -# -# # Kernel#scanf reads from STDIN -# array = scanf("%d%s") -# -# == Block usage -# -# When called with a block, scanf keeps scanning the input, cycling back -# to the beginning of the format string, and yields a new array of -# conversions to the block every time the format string is matched -# (including partial matches, but not including complete failures). The -# actual return value of scanf when called with a block is an array -# containing the results of all the executions of the block. -# -# str = "123 abc 456 def 789 ghi" -# str.scanf("%d%s") { |num,str| [ num * 2, str.upcase ] } -# # => [[246, "ABC"], [912, "DEF"], [1578, "GHI"]] -# -# == Conversions -# -# The single argument to scanf is a format string, which generally -# includes one or more conversion specifiers. Conversion specifiers -# begin with the percent character ('%') and include information about -# what scanf should next scan for (string, decimal number, single -# character, etc.). -# -# There may be an optional maximum field width, expressed as a decimal -# integer, between the % and the conversion. If no width is given, a -# default of `infinity' is used (with the exception of the %c specifier; -# see below). Otherwise, given a field width of <em>n</em> for a given -# conversion, at most <em>n</em> characters are scanned in processing -# that conversion. Before conversion begins, most conversions skip -# whitespace in the input string; this whitespace is not counted -# against the field width. -# -# The following conversions are available. -# -# [%] -# Matches a literal `%'. That is, `%%' in the format string matches a -# single input `%' character. No conversion is done, and the resulting -# '%' is not included in the return array. -# -# [d] -# Matches an optionally signed decimal integer. -# -# [u] -# Same as d. -# -# [i] -# Matches an optionally signed integer. The integer is read in base -# 16 if it begins with `0x' or `0X', in base 8 if it begins with `0', -# and in base 10 other- wise. Only characters that correspond to the -# base are recognized. -# -# [o] -# Matches an optionally signed octal integer. -# -# [x, X] -# Matches an optionally signed hexadecimal integer, -# -# [a, e, f, g, A, E, F, G] -# Matches an optionally signed floating-point number. -# -# [s] -# Matches a sequence of non-white-space character. The input string stops at -# whitespace or at the maximum field width, whichever occurs first. -# -# [c] -# Matches a single character, or a sequence of <em>n</em> characters if a -# field width of <em>n</em> is specified. The usual skip of leading white -# space is suppressed. To skip whitespace first, use an explicit space in -# the format. -# -# [[] -# Matches a nonempty sequence of characters from the specified set -# of accepted characters. The usual skip of leading whitespace is -# suppressed. This bracketed sub-expression is interpreted exactly like a -# character class in a Ruby regular expression. (In fact, it is placed as-is -# in a regular expression.) The matching against the input string ends with -# the appearance of a character not in (or, with a circumflex, in) the set, -# or when the field width runs out, whichever comes first. -# -# === Assignment suppression -# -# To require that a particular match occur, but without including the result -# in the return array, place the <b>assignment suppression flag</b>, which is -# the star character ('*'), immediately after the leading '%' of a format -# specifier (just before the field width, if any). -# -# == scanf for Ruby compared with scanf in C -# -# scanf for Ruby is based on the C function scanf(3), but with modifications, -# dictated mainly by the underlying differences between the languages. -# -# === Unimplemented flags and specifiers -# -# * The only flag implemented in scanf for Ruby is '<tt>*</tt>' (ignore -# upcoming conversion). Many of the flags available in C versions of -# scanf(3) have to do with the type of upcoming pointer arguments, and are -# meaningless in Ruby. -# -# * The <tt>n</tt> specifier (store number of characters consumed so far in -# next pointer) is not implemented. -# -# * The <tt>p</tt> specifier (match a pointer value) is not implemented. -# -# === Altered specifiers -# -# [o, u, x, X] -# In scanf for Ruby, all of these specifiers scan for an optionally signed -# integer, rather than for an unsigned integer like their C counterparts. -# -# === Return values -# -# scanf for Ruby returns an array of successful conversions, whereas -# scanf(3) returns the number of conversions successfully -# completed. (See below for more details on scanf for Ruby's return -# values.) -# -# == Return values -# -# Without a block, scanf returns an array containing all the conversions -# it has found. If none are found, scanf will return an empty array. An -# unsuccessful match is never ignored, but rather always signals the end -# of the scanning ope (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/