summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-12-18Requiring pp is not required now [ci skip]nobu
- Followup of https://bugs.ruby-lang.org/issues/14123 From: Prathamesh Sonpatki <csonpatki@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15lib/erb: Update doc [ci-skip] [doc]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14webrick 1.4.0 releasenormal
* lib/webrick/version.rb: change VERSION to 1.4.0 * lib/webrick/webrick.gemspec: require_relative for version, update date and contact info [Feature #13173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14Fix a command injection vulnerability in Net::FTP.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14Use string instead of regexpnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14Allow empty path components in a URI [Bug #8352]knu
* generic.rb (URI::Generic#merge, URI::Generic#route_to): Fix a bug where a sequence of slashes in the path part gets collapsed to a single slash. According to the relevant RFCs and WHATWG URL Standard, empty path components are simply valid and there is no special treatment defined for them, so we just keep them as they are. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13Bump version to csv-1.0.0 as default gems.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13webrick: compile RE correctly for beginning and end matchnormal
Using ^ and $ in regexps means we can accidentally get fooled by "%0a" in HTTP request paths being decoded to newline characters. Use \A and \z to match beginning and end-of-string respectively, instead. Thanks to mame and hsbt for reporting. * lib/webrick/httpserver.rb (MountTable#compile): use \A and \z instead of ^ and $ * lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $ * test/webrick/test_httpserver.rb (test_cntrl_in_path): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Avoid creating a Thread for shutting down a DRbServereregon
* lib/drb/drb.rb: avoid creating a Thread and call the shutdown logic directly. Do not try to kill or join the current Thread. Thread.new { stop_service } caused "can't alloc thread (ThreadError)", which is shown with Thread.report_on_exception = true. [Bug #14171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Remove unnecessary `:`kazu
Before: `.../irb/init.rb:280: warning: :LoadError: cannot load such file -- hoge` After: `.../irb/init.rb:280: warning: LoadError: cannot load such file -- hoge` [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Use printf instead of puts and sprintfkazu
[ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb/init.rb: make sure ARGV refers to toplevel onek0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb.rb: preserve ARGV on binding.irbk0kubun
This is not perfectly good solution (at least we don't want to have ARGV as default value of `argv` argument), but unfortunately IRB.setup and IRB.parse_opts are public methods and we can't make breaking change to those methods. We may deprecate using them and then make them private in the future, but the removal should not be in Ruby 2.5. So I kept their interface for now. [Bug #14162] [close GH-1770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Bump version to fileutils-1.0.1.hsbt
Update source code url metadata on rubygems.org. [Feature #13197][ruby-core:79455] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Bump version to fileutils-1.0.0 as default gems.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Ignore gemspec under the lib directory for documentation.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Merge 1-16-stable branch of bundler.hsbt
It's rc version for bundler-1.16.1. I'm going to update it version after official release from bundler team. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11Bump version to scanf-1.0.0 as default gems.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11lib/pp.rb: remove alias for suppressing a redefinition warning.mame
Because there is now the same guard in prelude.rb (alias pp pp). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11Bump version to cmath-1.0.0 as default gems.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11bccwin is no longer supportedusa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11depend on win32.h on Windowsusa
* lib/mkmf.rb (depend_rules): all objs should depend on win32.h on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11Ignore to generate documentation for template files of bundler.hsbt
[Bug #14163][ruby-core:84141] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08webrick: allow shutdown after StartCallbacknormal
We must to ensure the @status ivar is set to :Running before running StartCallback, otherwise Webrick::Server#stop will not change the @status to :Shutdown properly. Note: I have not been able to reproduce the original issue but understood at least part of the problem and fixed it with this commit. However, the original reporter (Peak Xu) was still able to reproduce the problem on 1.9.2 p180 on Windows, so I'm not sure what else might be going on. Ruby threading and synchronization primitives have changed a lot since 1.9.2, so maybe that was fixed elsewhere. * lib/webrick/server.rb: call StartCallback sooner [Bug #4841] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08lib/pp.rb: no rdoc of alias to suppress a warningnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08pp.rb: rdocnobu
* lib/pp.rb (pp): move pp alias before its rdoc, not to prevent parsing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05Bump version to rdoc-6.0.0.hsbt
There is no changes from rdoc-6.0.0.bebta4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Append "//" if empty host for file or postgres URInaruse
https://url.spec.whatwg.org/#url-serializing > Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output. URL spec doesn't says anything about postgres, but assume the same thing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Replace Kernel#pp after PP class is defined.akr
Avoid a race condition which a context switch occur after replacing Kernel#pp but before defining PP class. Following patch, inserting sleep, makes this problem reproducible. ``` Index: lib/pp.rb =================================================================== --- lib/pp.rb (revision 60960) +++ lib/pp.rb (working copy) @@ -26,6 +26,7 @@ module Kernel end undef __pp_backup__ if method_defined?(:__pp_backup__) module_function :pp + sleep 1 # thread context switch end ## ``` With the above patch, "uninitialized constant Kernel::PP" can happen as as follows. ``` % ./ruby -w -Ilib -e ' t1 = Thread.new { Thread.current.report_on_exception = true pp :foo1 } t2 = Thread.new { Thread.current.report_on_exception = true sleep 0.5 pp :foo2 } t1.join rescue nil t2.join rescue nil ' #<Thread:0x000055dbf926eaa0@-e:6 run> terminated with exception: Traceback (most recent call last): 3: from -e:9:in `block in <main>' 2: from /home/ruby/tst2/ruby/lib/pp.rb:22:in `pp' 1: from /home/ruby/tst2/ruby/lib/pp.rb:22:in `each' /home/ruby/tst2/ruby/lib/pp.rb:23:in `block in pp': uninitialized constant Kernel::PP (NameError) :foo1 ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01prelude.rb: suppress redefinition warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01lib/pp.rb (Kernel#pp): Fix a race conditionmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-30prelude.rb: Add Kernel#pp, a trigger for lib/pp.rbmame
[Feature #14123] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-28Merge rubygems-2.7.3.hsbt
http://blog.rubygems.org/2017/11/28/2.7.3-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27Merge rdoc-6.0.0.beta4 from upstream.hsbt
It version applied `frozen_string_literal: true` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix TOCTTOU and avoid to read existing unreadable filekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24workspace.rb: one more spacenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24workspace.rb: fix SCRIPT_LINES__nobu
* lib/irb/workspace.rb (code_around_binding): `SCRIPT_LINES__` values are arrays of lines. get file and line at once. moved loop-invariant format string. join without extra strings by `$,`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24irb.rb: show source around binding.irb on startk0kubun
[Feature #14124] [ruby-dev:50319] [close GH-1764] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-22lib/set.rb: [DOC] remove empty commentsstomar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-22set.rb: improve docs for Setstomar
* lib/set.rb: [DOC] add examples for Set#replace, add examples for creating a set from a hash with duplicates, simplify and fix style of some other examples, fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20[DOC] Fix example result [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20lib/matrix: Add hadamard_product/entrywise_product.marcandre
Based on a patch by Charley Hutchison. [GH-674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20lib/matrix: Add Matrix{.|#}combinemarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20lib/matrix: accept vectors in {h|v}stackmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-20lib/matrix: Add explicit coercion #to_matrixmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-17Fix typo in `Timeout` doc [ci skip]kazu
Author: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1760 [Fix GH-1760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-17Add examples to Set documentation [ci skip]knu
GitHub PR: https://github.com/ruby/ruby/pull/1752 [Fix GH-1752] Submitted by: @Ana06 <anamma06@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-15tmpdir.rb: merged make_tmpname to createnobu
* lib/tmpdir.rb (Dir::Tmpname#create): try conversion of prefix and suffix just once before loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e