summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-11-22Use `&.` instead of `if` and `? :`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22Use `&.` and `||=` instead of if guardsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22IOError does not happenkazu
* 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
2016-11-22Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22Add BufferedSSLSocket#send.shugo
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
2016-11-22webrick/server: simplify Daemon.startnormal
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
2016-11-21resolv: use symbol proc when possiblenormal
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
2016-11-21lib/open3: favor symbol proc when possiblenormal
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
2016-11-21lib/*: remove closed checksnormal
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
2016-11-21ftp.rb: fix typo [ci skip]nobu
* 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
2016-11-21Add new options open_timeout and read_timeout to Net::FTP.new.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21Use dynamic dispatch instead of is_a?.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21net/http: avoid writing/reading from unstarted SSL socketrhe
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
2016-11-20Remove an unused variable to suppress a warning.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-20forwardable/impl.rbnobu
* 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
2016-11-20remote_address should be called on @bare_sock.shugo
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
2016-11-20shutdown(2) should not be called for SSLSocket.shugo
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
2016-11-19Use Socket instead of TCPSocket/TCPServer.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Expand abbreviated option names.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Shut down TLS connections gracefully.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Remove garbage.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19Support TLS and hash styles options for Net::FTP.new.shugo
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
2016-11-16logger.rb: fix next rotate timenobu
* 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
2016-11-15ftp.rb: use Addrinfo interfacesshugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-15ftp.rb: use Addrinfonobu
* 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
2016-11-14net/ftp.rb: kwargsnobu
* 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
2016-11-14net/protocol.rb: kwargsnobu
* 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
2016-11-11Enable the document for Kernel[#.]pp.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-08Fix undefined method 'dump' for nil:NilClass (NoMethodError)a_matsuda
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
2016-11-08Fix grammar errorsa_matsuda
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
2016-11-08Update comment about default constanta_matsuda
Patch by: Dave Takahashi <dtcello@gmail.com> (@dtakahas) Signed-off-by: Akira Matsuda <ronnie@dio.jp> closes #1151 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06irb.rb: Binding#irbnobu
* lib/irb.rb (Binding#irb): new method like Binding#pry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06irb.rb: IRB::Irb#runnobu
* lib/irb.rb (IRB::Irb#run): split from IRB.start. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06e2mmap.rb: remove old definitionnobu
* lib/e2mmap.rb (E2MM.def_exception): remove old definition if exists so that works multiple times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05shell.rb: suppress warningsnobu
* lib/shell.rb: initialize class instance variables and remove writer methods to be overwritten soon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05e2mmap.rb: suppress a warningnobu
* lib/e2mmap.rb (bind): eval with the location. undefine predefined method before overwriting to suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05Alias regist_scanner to register_scannera_matsuda
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05fix Resolv::LOC::Coord.create.akr
* lib/resolv.rb (Resolv::LOC::Coord.create): fixed. [ruby-core:72567] [Bug #11912] fixed by Eric Wong and Kazuhiro NISHIYAMA. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* lib/net/http.rb (Net::HTTP.post): new convenience method to send a POST ↵shugo
request. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* lib/net/http.rb (transport_request): other than HTTPContinuenaruse
in 1xx (HTTPInformation) also needs to continue. [Bug #12890] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05Time.parse's "now" argument as nil works again.akr
* lib/time.rb (make_time): "now" argument as nil works again. This is broken since Ruby 2.2. Mathieu Jobin pointed a problem. https://github.com/ruby/ruby/commit/e4b05d91eb0d48fd172abf015c493bb42d755d07#commitcomment-17421387 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05IPAddr#== and IPAddr#<=> no longer raise an exception if coercion failsknu
* lib/ipaddr.rb (IPAddr#==): If coercion fails, return false instead of passing through the exception. [ruby-core:77451] [Bug #12799] * lib/ipaddr.rb (IPAddr#<=>): If coercion fails, return nil instead of passing through the exception. [ruby-core:77451] [Bug #12799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05numeric.c: round to nearest evennobu
* numeric.c (flo_round, int_round): support round-to-nearest-even semantics of IEEE 754 to match sprintf behavior, and add `half:` optional keyword argument for the old behavior. [ruby-core:76273] [Bug #12548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05Add Set#compare_by_identity and Set#compare_by_identity?knu
* lib/set.rb (Set#compare_by_identity, Set#compare_by_identity?): New methods. [Feature #12210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0hsbt
Release note: https://github.com/rdoc/rdoc/blob/b825775647f62c5b525e9780a28ff2fbb1d5bf6f/History.rdoc#500--2016-11-05 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05extract_resources uses each_resource instead of each_answer.akr
* lib/resolv.rb (Resolv::DNS#extract_resources): Use each_resource instead of each_answer. [ruby-core:75461] [Bug#12372] reported by Rafael Fernandez Lopez. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05* lib/net/smtp.rb (tlsconnect): support timeout for TLS handshake.shugo
[ruby-core:76893] [Bug #12678] * lib/net/protocol.rb (ssl_socket_connect): new method to implement timeout for TLS handshake. * lib/net/http.rb (connect): use Net::Protocol#ssl_socket_connect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05Fix the handling of the backslash in double quotesknu
* lib/shellwords.rb (Shellwords#shellsplit): Fix the handling of the backslash in double quotes to conform to the standard. [ruby-core:63807] [Bug #10055] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e