aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* require "irb/output-method" for StdioOutputMethodnobu2016-12-131-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use URI.decode_www_form_component [Bug #10774]naruse2016-12-121-5/+5
| | | | | | | `parser` refered RFC2396_Parser, but it is separated. test is contributed by Dominik Menke git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add missing :nodoc: commentnaruse2016-12-101-2/+2
| | | | | | | | | | We were missing a `:nodoc:` magic comment that was making automated tools show that this method was missing documentation, when it really didn't need to be documented. by Devon Estes <devon.c.estes@gmail.com> https://github.com/ruby/ruby/pull/1482 fix GH-1482 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby-lex.rb: fix for labelnobu2016-12-081-1/+1
| | | | | | | | * lib/irb/ruby-lex.rb (identify_identifier): treat identifier just followed by a colon as a lable. this is not a precise solution but enough for the time being. [ruby-core:78526] [Bug #13012] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Delay Utils.getservername until needed.shugo2016-12-071-3/+9
| | | | | | | | There is no need to call Utils.getservername when the :ServerName option is specified, so delay Utils.getservername until needed to avoid unnecessary DNS lookups. [ruby-core:78492] [Bug #13007] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: REXML::Element#[] accepts String or Symbol as attribute namekou2016-12-061-0/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of ambiguous parentheses warningsnobu2016-11-292-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of test failures on CI introduced at r56927usa2016-11-291-3/+3
| | | | | | | * lib/matrix.rb: now ruby warns ambiguous parentheses after a space in method definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress warnings.shugo2016-11-291-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/ftp: add a new option ssl_handshake_timeout to Net::FTP.new.shugo2016-11-291-2/+14
| | | | | | | | | | The TLS handshake timeout can be specified independently, because the TLS handshake doesn't start just after the underlying connection is established, but after the AUTH command is completed. It's also useful for testing purposes. However, if ssl_handshake_timeout is not specified, open_timeout is used instead for convenience. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/ftp: close the socket directly when an error occurs during TLS handshake.shugo2016-11-291-1/+1
| | | | | | Otherwise, @sock.read in Net::FTP#close hungs until read_timeout exceeded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/ftp: close the connection if the TLS handshake timeout is exceeded.shugo2016-11-291-1/+1
| | | | | | Otherwise, file descriptor leaks may occur in Net::FTP.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/ftp: support timeout for TLS handshake.shugo2016-11-261-2/+2
| | | | | | Net::FTP inherits ssl_socket_connect from Net::Protocol to implement timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* resolv: use safe navigation operator to avoid extra hash lookupsnormal2016-11-231-3/+1
| | | | | | | | | | @addr2name is a private Hash and never changes its default_proc, so only pay the hash lookup cost once; we know missing entries in the hash will be nil. * lib/resolv.rb (each_name): use safe navigation operator git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/server: use symbol procnormal2016-11-231-1/+1
| | | | | | | | | Symbol proc is less code and avoids confusion from variable naming. * lib/webrick/server.rb (shutdown): use symbol proc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add CR/LF check to Net::FTP#status.shugo2016-11-231-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/ftp: fix typonormal2016-11-231-1/+1
| | | | | | * lib/net/ftp.rb (shutdown): fix typo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Disconnect immediately even if Net::FTP#close is called without quit.shugo2016-11-231-0/+16
| | | | | | | | | In that case, BufferedSSLSocket#read in FTP#close exceeded timeout because BufferedSSLSocket#shutdown did nothing. So BufferedIO#rbuf_fill is overridden in BufferedSSLSocket to raise an EOFError if the connection is shut down. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add a new optinal argument pathname to FTP#stat.shugo2016-11-231-4/+6
| | | | | | | Based on the patch by soleboxy. [Fix GH-1478] [ruby-core:78240] [Feature #12965] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use `&.` instead of `if` and `? :`kazu2016-11-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use `&.` and `||=` instead of if guardsnobu2016-11-221-9/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* IOError does not happenkazu2016-11-221-6/+1
| | | | | | | * IOError does not happen even if another thread closes io * Use symbol proc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use `&.` instead of modifier ifkazu2016-11-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add BufferedSSLSocket#send.shugo2016-11-221-0/+5
| | | | | | | SSLSocket#send is not defined, so use #write instead. flags and dest are ignored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/server: simplify Daemon.startnormal2016-11-221-8/+2
| | | | | | | | | Process.daemon exists since Ruby 1.9.1 and does most of what we need. * lib/webrick/server.rb (Daemon.start): simplify [Misc #12937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* resolv: use symbol proc when possiblenormal2016-11-211-7/+3
| | | | | | | | This reduces both human code and bytecode. lib/resolv.rb (sender_for, Config.parse_resolv_conf): use symbol proc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/open3: favor symbol proc when possiblenormal2016-11-211-6/+6
| | | | | | | | | It reduces both human and machine code; as well as reducing the confusion from variable naming. * lib/open3.rb (popen_run, pipeline, pipeline_run): avoid capture git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/*: remove closed checksnormal2016-11-2112-27/+23
| | | | | | | | | | | | | | | | | | | | Follow r56795. Since Ruby 2.2, calling #close on a closed socket no longer raises exceptions. * lib/cgi/session.rb (update): remove closed? check * lib/net/http.rb (finish, transport_request): ditto * lib/net/imap.rb (disconnect): ditto * lib/net/pop.rb (do_start, do_finish): ditto * lib/net/smtp.rb (do_start, do_finish): ditto * lib/open3.rb (popen_run, pipeline_run): ditto * lib/pstore.rb (transaction): ditto * lib/shell/process-controller.rb (sfork): * lib/tempfile (_close, call, Tempfile.create): ditto * lib/webrick/httpauth/htdigest.rb (flush): ditto * lib/webrick/httpauth/htpasswd.rb (flush): ditto * lib/webrick/server.rb (start_thread, cleanup_shutdown_pipe): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ftp.rb: fix typo [ci skip]nobu2016-11-211-1/+1
| | | | | | | * lib/net/ftp.rb (Net::FTP#initialize): [DOC] fix type in option name, :username is used but :use is not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add new options open_timeout and read_timeout to Net::FTP.new.shugo2016-11-211-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use dynamic dispatch instead of is_a?.shugo2016-11-211-14/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/http: avoid writing/reading from unstarted SSL socketrhe2016-11-211-30/+33
| | | | | | | | | | | | | | | | When net/http connects to an HTTPS server through a CONNECT proxy, it writes the CONNECT request to an unconnected OpenSSL::SSL::SSLSocket. OpenSSL::SSL::SSLSocket traditionally fallbacks to a method call on the underlying IO object if a read/write method is called before the TLS connection is established. So it automagically works correctly, emitting the "SSL session is not started yet" warning. This is not obvious at first glance. The warning is also noisy. Let's just write to the plain socket instead of relying on the SSLSocket's behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove an unused variable to suppress a warning.shugo2016-11-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* forwardable/impl.rbnobu2016-11-202-15/+30
| | | | | | | | * lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remote_address should be called on @bare_sock.shugo2016-11-201-1/+1
| | | | | | Because @sock.remote_address fails if @sock is an SSLSocket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* shutdown(2) should not be called for SSLSocket.shugo2016-11-201-4/+6
| | | | | | | SSLSocket#stop is a private method and cannot be called, but explicit calls are not necessary because SSL_shutdown() is called from SSLSocket#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Socket instead of TCPSocket/TCPServer.shugo2016-11-191-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Expand abbreviated option names.shugo2016-11-191-17/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Shut down TLS connections gracefully.shugo2016-11-191-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove garbage.shugo2016-11-191-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-11-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support TLS and hash styles options for Net::FTP.new.shugo2016-11-191-22/+140
| | | | | | | | If the :ssl options is specified, the control connection is protected with TLS in the manner described in RFC 4217. Data connections are also protected with TLS unless the :private_data_connection is set to false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* logger.rb: fix next rotate timenobu2016-11-161-1/+5
| | | | | | | | | | * lib/logger.rb (Logger::LogDevice#initialize): calculate next rotate time based on the mtime of the last existing file. [ruby-dev:49881] [Bug #12948] Author: Tsukasa Oishi <tsukasa.oishi@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ftp.rb: use Addrinfo interfacesshugo2016-11-151-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ftp.rb: use Addrinfonobu2016-11-151-6/+6
| | | | | | | * lib/net/ftp.rb (sendport, makeport, makepasv, BufferedSocket): use Addrinfo interfaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/ftp.rb: kwargsnobu2016-11-141-3/+1
| | | | | | * lib/net/ftp.rb (Net::FTP#open_socket): use keyword argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/protocol.rb: kwargsnobu2016-11-145-18/+14
| | | | | | | * lib/net/protocol.rb (Net::BufferedIO#initialize): add keyword arguments for initial attributes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable the document for Kernel[#.]pp.akr2016-11-111-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix undefined method 'dump' for nil:NilClass (NoMethodError)a_matsuda2016-11-081-1/+3
| | | | | | | | | Patch by: Dmitry Vorotilin <d.vorotilin@gmail.com> (@route) Signed-off-by: Akira Matsuda <ronnie@dio.jp> closes #1475 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix grammar errorsa_matsuda2016-11-081-12/+12
| | | | | | | | | | | Patch by: Chris Tweedie <cltweedie@gmail.com> (@cltweedie) Signed-off-by: Akira Matsuda <ronnie@dio.jp> closes #1074 [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e