The previous git clone command is not work, the protocol in URL should be https
[fix GH-1772]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Because top_stmts is generated from none (not "/* none */"),
@0 is not set by YYLLOC_DEFAULT. So @0 is a meaningless location.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
* Avoids the thread-safety issues mentioned in r61192,
when thread concurrently modify default Encodings or $VERBOSE.
Their state will always be the original one once the test finishes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* It is not thread-safe: if two threads call it concurrently,
the default_internal Encoding might not be restored, which causes
many problems. The same applies for $VERBOSE, which might also not be
restored to its original value but to the new value instead.
This happens because reading the original value might capture the
value already changed by EnvUtil.with_default_internal in another
Thread. One solution could be to capture the value of these globals
before running the test.
* Reverts part of r54522.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Check that Encoding.default_internal and Encoding.default_external
are the same before and after every test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* It was originally th.join(0.2), but th.join never returns nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Otherwise it produces a warning with Thread.report_on_exception=true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The warnings are shown by Thread.report_on_exception defaulting to
true. [Feature #14143] [ruby-core:83979]
* Improves tests by narrowing down the scope where an exception
is expected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/rinda/test_rinda.rb (test_take_bug_8215): add rescue for
expected exception, which removes the warning by
Thread.report_on_exception [Feature #14143].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
* [Feature #14143] [ruby-core:83979]
* vm.c (vm_init2): Set Thread.report_on_exception to true.
* thread.c (thread_start_func_2): Add indication the message is caused
by report_on_exception = true.
* spec/ruby: Specify the new behavior.
* test/ruby/test_thread.rb: Adapt and improve tests for
Thread.report_on_exception and Thread#report_on_exception.
* test/ruby/test_thread.rb, test/ruby/test_exception.rb: Unset
report_on_exception for tests expecting no extra output.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
of keyword_init option. [DOC] [ci skip]
It's implemented to take Hash, but it's just implementation detail and
it's intended to behave in the same way as keyword arguments (for
:keyword_init option too).
Also I unified coding style of r61137 with other places.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for debugging if it's specified for the Struct class.
This follows up r61137.
We don't provide a method to check it because I don't think of any use
case, but showing this to inspect would be helpful for debugging if
someone is debugging whether keyword_init is properly enabled or not.
In this commit, I didn't show `keyword_init: false` because of backward
compatibility. Ideally any application should not depend on the behavior
of inspect, but I don't have strong motivation to break it too.
[close GH-1773]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Change the last location of none to be
equal to the first location of none.
Sometimes none has length (`parser->tokp` does not
match `lex_p` when none is generated).
This leads to invalid code_ranges.
e.g. The locations of the NODE_CALL (:sort) is fixed:
```
x.sort.join(" ")
```
* Before
```
NODE_CALL (line: 1, code_range: (1,0)-(1,7))
```
* After
```
NODE_CALL (line: 1, code_range: (1,0)-(1,6))
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit 90de118a75.
The environment of mswinci couldn't handle https download.
(It's certificates problem, We should upgrade its environment)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Currently the location of do_body is set
by new_do_body. Sometimes the last part of do_body is
none, because bodystmt ends with opt_ensure.
Token keyword_end has been looked ahead when a tokenizer
generates none, so the last location of opt_ensure matches
the last location of `end`. But this relation will be
broken when we change the last location of none to be equal to
the first location of none. So set locations of nd_body in
NODE_ITER explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is not changed.
At first `ARGV.unshift('something')` was suggested for r61149,
but it wasn't sufficient because it modifies $0.
Not only to preserve ARGV, but also r61149 intends to preserve $0.
This test prevents future breakage of the behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the intention. Follows up r61137.
They were forgotten to be renamed when :keyword_args is renamed to
:keyword_init.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/coverage/coverage.c (test_method_coverage_for_define_method):
Add test cases for method coverages which test do-end block
define_method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It's unrelated to rb_execution_context_t during writing the patch
r61154
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
Add a method to retrieve a String expression of an exception,
formatted in the same way that Ruby prints an uncaught exception out.
[Feature #14141]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e