Граф коммитов

49099 Коммитов

Автор SHA1 Сообщение Дата
naruse 4b4f7c428c Revert r61054
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 08:38:43 +00:00
hsbt b9426859e7 Bump version to etc-1.0.0 as default gems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 05:52:47 +00:00
hsbt 283bb70fe0 Bump version to csv-1.0.0 as default gems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 05:24:01 +00:00
hsbt 1c6a0d1043 Modify git clone command
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
2017-12-13 02:43:38 +00:00
yui-knk 564dd28616 parse.y: Revert r61196
* 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
2017-12-13 01:10:27 +00:00
normal aac91cb762 webrick: compile RE correctly for beginning and end match
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-13 00:38:08 +00:00
yui-knk 47f1d84215 parse.y: Fix the locations of an empty script
* parse.y: Fix the locations of NODE_BEGIN in
  an empty script.

  ```
  ruby --dump=p -e ''
  ```

  * Before

  ```
  NODE_BEGIN (line: 1, code_range: (1,1)-(1,1))
  ```

  * After

  ```
  NODE_BEGIN (line: 1, code_range: (1,0)-(1,0))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 23:48:50 +00:00
eregon d5874f0fff Capture the values of globals in EnvUtil to restore to the original
* 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
2017-12-12 23:41:50 +00:00
eregon cf4d4c32f3 Revert r61192 and r61193
* More general fix coming.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 23:41:34 +00:00
eregon f356bd817c Use EnvUtil.with_default_external in tests needing it
* Reverts part of r54522.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 22:37:40 +00:00
eregon c32ce5fc27 Do not change Encoding.default_internal in assert_raise_with_message
* 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
2017-12-12 21:51:53 +00:00
eregon c895b54f14 Check that global encodings are not changed in test-all
* 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
2017-12-12 21:32:13 +00:00
eregon 3f2305f15b Remove useless assertion in TestThread#test_handle_interrupt_blocking
* 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
2017-12-12 20:09:36 +00:00
eregon 7cb010e3a5 Handle exception explicitly in TestBignum#test_interrupt_during_to_s
* 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
2017-12-12 19:48:32 +00:00
eregon 15689ed778 Fix test-all tests to avoid creating report_on_exception warnings
* 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
2017-12-12 18:44:49 +00:00
eregon 967eab83e3 Remove extra assert_nil in Rinda tests
* They are never executed since thread_join() raises.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 18:44:33 +00:00
eregon 6671a826ac Fix tests which fail with extra stderr output when a Thread dies
* [Feature #14143] [ruby-core:83979].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 18:44:21 +00:00
eregon 2dfbc64fab Rescue expected Interrupt in TupleSpaceTestModule#test_take_bug_8215
* 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
2017-12-12 18:44:07 +00:00
eregon ca1c3d41fa Avoid creating a Thread for shutting down a DRbServer
* 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-12 18:43:55 +00:00
eregon 5a3c024df0 Set Thread.report_on_exception=true by default to report exceptions in Threads
* [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
2017-12-12 18:43:42 +00:00
k0kubun 2406207cbb struct.c: don't explain implementation details
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
2017-12-12 15:12:05 +00:00
k0kubun 8411f58ed7 struct.c: show `keyword_init: true` on inspect
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
2017-12-12 15:03:45 +00:00
usa 1dcdb86876 set ino at `File.lstat` on Windows
* win32/win32.c (winnt_stat): support symbolic link and others.

* win32/win32.c (w32_stati128, wstati128, name_for_stat, rb_w32_{,ul}stati128,
  wutimensat): follow above change.
  [Feature #14169]

  From: Takehiro Kubo kubo@jiubao.org


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:02:51 +00:00
kazu c9154899e1 Add more example of `Enumerable#one?` [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:13 +00:00
kazu 9982bfd18b pattern and modulo are not keyword argument [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:11 +00:00
kazu 4ea549e839 Fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:10 +00:00
kazu eccdc515d5 atime,mtime,ctime of File::Stat are instance methods
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:08 +00:00
kazu 38054f99aa Remove unnecessary `:`
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-12 15:01:07 +00:00
kazu e03ea9c596 Use printf instead of puts and sprintf
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:04 +00:00
svn 01c051f195 * 2017-12-13
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:03 +00:00
kazu b9253be504 [DOC] Process.last_status may return nil
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 15:01:02 +00:00
yui-knk f6a1ad41db parse.y: Change the last location of none
* 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
2017-12-12 14:47:34 +00:00
yui-knk 3d6d615175 parse.y: Set locations of nd_body in NODE_ITER explicitly
* parse.y: Same as r61168, but for brace_block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 14:21:20 +00:00
hsbt 774f650bbe Revert "switch from http to https for Unicode data file downloads"
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
2017-12-12 14:10:43 +00:00
yui-knk 46e8a8ae37 parse.y: Set locations of nd_body in NODE_ITER explicitly
* 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
2017-12-12 14:10:23 +00:00
k0kubun 89c7e6de44 irb/test_init.rb: add test to ensure $0
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
2017-12-12 13:56:48 +00:00
k0kubun 64bb2b1cc0 test_struct.rb: rename constants to clarify
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
2017-12-12 13:47:46 +00:00
yui-knk bf2321412a ext/coverage/coverage.c: Add test cases
* 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
2017-12-12 13:19:40 +00:00
svn 1711b54b7b * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 13:07:08 +00:00
sorah 6d32595237 NEWS: polish
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 13:07:06 +00:00
ko1 6c49079ea2 ignore lines (to catch up r61155).
* spec/ruby/library/net/ftp/return_code_spec.rb: check message body only.

* spec/ruby/library/net/http/http/set_debug_output_spec.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:40:41 +00:00
sorah d18fb887ea error.c(rb_error_write): Remove ec_ from its name
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
2017-12-12 12:17:38 +00:00
a_matsuda 29e1f56e23 NEWS for Method#===
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:12:40 +00:00
a_matsuda 3baa1d23bc Unneeded assertion
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:12:39 +00:00
a_matsuda 476a539ff6 Add Method#=== that invokes #call
Patch by osyo via [Feature #14142]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:12:38 +00:00
sorah 2ce0847e9e hotfix implicit-function-declaration
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:10:21 +00:00
shyouhei 9fa87ebe7f NEWS entry for [Feature #12882]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 12:10:20 +00:00
shyouhei f2a91397fd Add uplevel keyword to Kernel#warn and use it
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-12 11:56:25 +00:00
sorah 0d7718896c error.c(exc_full_message): Exception#full_message
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
2017-12-12 11:47:16 +00:00
usa 838f23ae34 remove unused variable
thanks kubo-san. c.f. [ruby-dev:50345]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:43:18 +00:00