ruby-changes:66343
From: Hiroshi <ko1@a...>
Date: Thu, 27 May 2021 14:42:36 +0900 (JST)
Subject: [ruby-changes:66343] be2e2b4805 (master): Promote net-smtp to the bundled gems
https://git.ruby-lang.org/ruby.git/commit/?id=be2e2b4805 From be2e2b480540bcc38aaf75f1767dfff1b8199097 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Wed, 26 May 2021 15:58:26 +0900 Subject: Promote net-smtp to the bundled gems --- doc/maintainers.rdoc | 6 +- doc/standard_library.rdoc | 2 +- gems/bundled_gems | 1 + lib/net/net-smtp.gemspec | 37 -- lib/net/smtp.rb | 1128 -------------------------------------- misc/expand_tabs.rb | 1 - test/net/smtp/test_response.rb | 100 ---- test/net/smtp/test_smtp.rb | 302 ---------- test/net/smtp/test_ssl_socket.rb | 99 ---- test/net/smtp/test_sslcontext.rb | 129 ----- test/net/smtp/test_starttls.rb | 122 ----- tool/sync_default_gems.rb | 6 - 12 files changed, 4 insertions(+), 1929 deletions(-) delete mode 100644 lib/net/net-smtp.gemspec delete mode 100644 lib/net/smtp.rb delete mode 100644 test/net/smtp/test_response.rb delete mode 100644 test/net/smtp/test_smtp.rb delete mode 100644 test/net/smtp/test_ssl_socket.rb delete mode 100644 test/net/smtp/test_sslcontext.rb delete mode 100644 test/net/smtp/test_starttls.rb diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc index 591b5c4..dc893ec 100644 --- a/doc/maintainers.rdoc +++ b/doc/maintainers.rdoc @@ -158,10 +158,6 @@ Yukihiro Matsumoto (matz) https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc#L158 NARUSE, Yui (naruse) https://github.com/ruby/net-http https://rubygems.org/gems/net-http -[lib/net/smtp.rb] - TOMITA Masahiro (tmtm) - https://github.com/ruby/net-smtp - https://rubygems.org/gems/net-smtp [lib/net/protocol.rb] _unmaintained_ https://github.com/ruby/net-protocol @@ -385,6 +381,8 @@ Yukihiro Matsumoto (matz) https://github.com/ruby/ruby/blob/trunk/doc/maintainers.rdoc#L381 https://github.com/ruby/net-imap [net-pop] https://github.com/ruby/net-pop +[net-smtp] + https://github.com/ruby/net-smtp [matrix] https://github.com/ruby/matrix [prime] diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc index 089b253..1d35801 100644 --- a/doc/standard_library.rdoc +++ b/doc/standard_library.rdoc @@ -47,7 +47,6 @@ OptionParser:: Ruby-oriented class for command-line option analysis https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L47 Logger:: Provides a simple logging utility for outputting messages Mutex_m:: Mixin to extend objects to be handled like a Mutex Net::HTTP:: HTTP client api for Ruby -Net::SMTP:: Simple Mail Transfer Protocol client library for Ruby Observable:: Provides a mechanism for publish/subscribe pattern in Ruby Open3:: Provides access to stdin, stdout and stderr when running other programs OpenStruct:: Class to build custom data structures, similar to a Hash @@ -109,6 +108,7 @@ RSS:: Family of libraries that support various formats of XML "feeds" https://github.com/ruby/ruby/blob/trunk/doc/standard_library.rdoc#L108 Net::FTP:: Support for the File Transfer Protocol Net::IMAP:: Ruby client api for Internet Message Access Protocol Net::POP3:: Ruby client library for POP3 +Net::SMTP:: Simple Mail Transfer Protocol client library for Ruby Matrix:: Represents a mathematical matrix. Prime:: Prime numbers and factorization library RBS:: RBS is a language to describe the structure of Ruby programs diff --git a/gems/bundled_gems b/gems/bundled_gems index 48477ec..32b62fe 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -8,6 +8,7 @@ rss 0.2.9 https://github.com/ruby/rss 0.2.9 https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L8 net-ftp 0.1.2 https://github.com/ruby/net-ftp net-imap 0.2.1 https://github.com/ruby/net-imap net-pop 0.1.1 https://github.com/ruby/net-pop +net-smtp 0.2.1 https://github.com/ruby/net-smtp matrix 0.4.1 https://github.com/ruby/matrix prime 0.1.2 https://github.com/ruby/prime typeprof 0.14.1 https://github.com/ruby/typeprof diff --git a/lib/net/net-smtp.gemspec b/lib/net/net-smtp.gemspec deleted file mode 100644 index 3c21042..0000000 --- a/lib/net/net-smtp.gemspec +++ /dev/null @@ -1,37 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L0 -# frozen_string_literal: true - -name = File.basename(__FILE__, ".gemspec") -version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir| - break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line| - /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1 - end rescue nil -end - -Gem::Specification.new do |spec| - spec.name = name - spec.version = version - spec.authors = ["Yukihiro Matsumoto"] - spec.email = ["matz@r..."] - - spec.summary = %q{Simple Mail Transfer Protocol client library for Ruby.} - spec.description = %q{Simple Mail Transfer Protocol client library for Ruby.} - spec.homepage = "https://github.com/ruby/net-smtp" - spec.licenses = ["Ruby", "BSD-2-Clause"] - spec.required_ruby_version = ">= 2.5.0" - - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = spec.homepage - - spec.files = %w[ - LICENSE.txt - lib/net/smtp.rb - net-smtp.gemspec - ] - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - - spec.add_dependency "net-protocol" - spec.add_dependency "digest" - spec.add_dependency "timeout" -end diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb deleted file mode 100644 index 56820be..0000000 --- a/lib/net/smtp.rb +++ /dev/null @@ -1,1128 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L0 -# frozen_string_literal: true -# = net/smtp.rb -# -# Copyright (c) 1999-2007 Yukihiro Matsumoto. -# -# Copyright (c) 1999-2007 Minero Aoki. -# -# Written & maintained by Minero Aoki <aamine@l...>. -# -# Documented by William Webber and Minero Aoki. -# -# This program is free software. You can re-distribute and/or -# modify this program under the same terms as Ruby itself. -# -# $Id$ -# -# See Net::SMTP for documentation. -# - -require 'net/protocol' -require 'digest/md5' -require 'timeout' -begin - require 'openssl' -rescue LoadError -end - -module Net - - # Module mixed in to all SMTP error classes - module SMTPError - # This *class* is a module for backward compatibility. - # In later release, this module becomes a class. - end - - # Represents an SMTP authentication error. - class SMTPAuthenticationError < ProtoAuthError - include SMTPError - end - - # Represents SMTP error code 4xx, a temporary error. - class SMTPServerBusy < ProtoServerError - include SMTPError - end - - # Represents an SMTP command syntax error (error code 500) - class SMTPSyntaxError < ProtoSyntaxError - include SMTPError - end - - # Represents a fatal SMTP error (error code 5xx, except for 500) - class SMTPFatalError < ProtoFatalError - include SMTPError - end - - # Unexpected reply code returned from server. - class SMTPUnknownError < ProtoUnknownError - include SMTPError - end - - # Command is not supported on server. - class SMTPUnsupportedCommand < ProtocolError - include SMTPError - end - - # - # == What is This Library? - # - # This library provides functionality to send internet - # mail via SMTP, the Simple Mail Transfer Protocol. For details of - # SMTP itself, see [RFC2821] (http://www.ietf.org/rfc/rfc2821.txt). - # - # == What is This Library NOT? - # - # This library does NOT provide functions to compose internet mails. - # You must create them by yourself. If you want better mail support, - # try RubyMail or TMail or search for alternatives in - # {RubyGems.org}[https://rubygems.org/] or {The Ruby - # Toolbox}[https://www.ruby-toolbox.com/]. - # - # FYI: the official documentation on internet mail is: [RFC2822] (http://www.ietf.org/rfc/rfc2822.txt). - # - # == Examples - # - # === Sending Messages - # - # You must open a connection to an SMTP server before sending messages. - # The first argument is the address of your SMTP server, and the second - # argument is the port number. Using SMTP.start with a block is the simplest - # way to do this. This way, the SMTP connection is closed automatically - # after the block is executed. - # - # require 'net/smtp' - # Net::SMTP.start('your.smtp.server', 25) do |smtp| - # # Use the SMTP object smtp only in this block. - # end - # - # Replace 'your.smtp.server' with your SMTP server. Normally - # your system manager or internet provider supplies a server - # for you. - # - # Then you can send messages. - # - # msgstr = <<END_OF_MESSAGE - # From: Your Name <your@m...> - # To: Destination Address <someone@e...> - # Subject: test message - # Date: Sat, 23 Jun 2001 16:26:43 +0900 - # Message-Id: <unique.message.id.string@e...> - # - # This is a test message. - # END_OF_MESSAGE - # - # require 'net/smtp' - # Net::SMTP.start('your.smtp.server', 25) do |smtp| - # smtp.send_message msgstr, - # 'your@m...', - # 'his_address@e...' - # end - # - # === Closing the Session - # - # You MUST close the SMTP session after sending messages, by calling - # the #finish method: - # - # # using SMTP#finish - # smtp = Net::SMTP.start('your.smtp.server', 25) - # smtp.send_message msgstr, 'from@address', 'to@address' - # smtp.finish - # - # You can also use the block form of SMTP.start/SMTP#start. This closes - # the SMTP session automatically: - # - # # using block form of SMTP.start - # Net::SMTP.start('your.smtp.server', 25) do |smtp| - # smtp.send_message msgstr, 'from@address', 'to@address' - # end - # - # I strongly recommend this scheme. This form is simpler and more robust. - # - # === HELO domain - # - # In almost all situations, you must provide a th (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/