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

213 Коммитов

Автор SHA1 Сообщение Дата
ko1 c39bdb798d `$SAFE` as a process global state. [Feature #14250]
* vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to
  `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state.

* vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc`
  objects don't need to keep `$SAFE` at the creation.
  Also make `is_from_method` and `is_lambda` as 1 bit fields.

* cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation.

* eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access
  `vm->safe_level_` directly.

* eval_jump.c: End procs `END{}` doesn't keep `$SAFE`.

* proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c.

* safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes.

* safe.c (safe_setter): use `rb_set_safe_level()`.

* thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`.
  It should be obsolete.

* transcode.c (load_transcoder_entry): `rb_safe_level()` only returns
  0 or 1 so that this check is not needed.

* vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc.

* vm.c (rb_proc_create): renamed to `proc_create`.

* vm.c (rb_proc_dup): moved from proc.c.

* vm.c (vm_invoke_proc): do not need to set and restore `$SAFE`
  for `Proc#call`.

* vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer
  meaning.

* lib/drb/drb.rb: restore `$SAFE`.

* lib/erb.rb: restore `$SAFE`, too.

* test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests.

* test/rubygems/test_gem.rb: do not set `$SAFE = 1`.

* bootstraptest/test_proc.rb: catch up this change.

* spec/ruby/optional/capi/string_spec.rb: ditto.

* test/bigdecimal/test_bigdecimal.rb: ditto.

* test/fiddle/test_func.rb: ditto.

* test/fiddle/test_handle.rb: ditto.

* test/net/imap/test_imap_response_parser.rb: ditto.

* test/pathname/test_pathname.rb: ditto.

* test/readline/test_readline.rb: ditto.

* test/ruby/test_file.rb: ditto.

* test/ruby/test_optimization.rb: ditto.

* test/ruby/test_proc.rb: ditto.

* test/ruby/test_require.rb: ditto.

* test/ruby/test_thread.rb: ditto.

* test/rubygems/test_gem_specification.rb: ditto.

* test/test_tempfile.rb: ditto.

* test/test_tmpdir.rb: ditto.

* test/win32ole/test_win32ole.rb: ditto.

* test/win32ole/test_win32ole_event.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-28 20:09:24 +00:00
eregon 74f14d6921 Update to ruby/spec@b95d7ed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 21:18:20 +00:00
eregon a34db218ad Update to ruby/spec@0fe33ac
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 16:12:47 +00:00
eregon 76402dfa06 Update to ruby/mspec@5f563e4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 16:12:18 +00:00
nobu e1f834f9b4 spec_helper.rb: libruby.so iff enable-shared
* spec/ruby/optional/capi/spec_helper.rb (compile_extension):
  search libruby.so only when enable-shared.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 07:28:32 +00:00
nobu a1695d9c2c spec_helper.rb: must find libruby.so
* spec/ruby/optional/capi/spec_helper.rb (compile_extension): if
  libruby.so should have been built but is not found, fail early.
  get mtime of the library just once.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-27 01:58:18 +00:00
hsbt 7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
eregon 82d63fcaac Simplify Thread#[]= spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 09:29:18 +00:00
hsbt 4525cf2cd5 Merge release version of bundler-1.16.1 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 09:22:15 +00:00
ko1 b895c402a5 fix threading bug.
* spec/ruby/core/thread/element_set_spec.rb: `t` can be uninitialized.
  Use `Thread.current` explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 23:49:30 +00:00
eregon 494b3aeaea Use syswrite to avoid potential buffering in IO#select spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-18 16:41:48 +00:00
marcandre 907508b25f Integer#{any|all|no}_bits: Fix coercion. Add specs [#12753]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-17 18:19:41 +00:00
eregon 30ed82e772 Update to ruby/spec@595645f
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 17:44:37 +00:00
eregon 60e21a9e93 Update to ruby/mspec@19d929e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-15 17:44:15 +00:00
eregon 2e315baf48 The main Thread should have report_on_exception=true for consistency
* Adapt test and add specs.
* See [Feature #14143] [ruby-core:84227]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 13:08:02 +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
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
k0kubun 02015974a3 struct.c: add keyword_init option to Struct.new
to initialize struct with keyword arguments.

[Feature #11925] [close GH-1771]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 08:12:43 +00:00
svn 0d862f34a8 * remove trailing spaces, append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 06:15:45 +00:00
hsbt a1a20cfaa2 Merge 1-16-stable branch of bundler.
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-12 06:15:44 +00:00
ko1 a1061f557b catch up r61131.
* spec/ruby/core/kernel/autoload_spec.rb: should use FrozenError.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 00:56:24 +00:00
marcandre a9770bac63 Add case equality arity to Enumerable#all?, any?, none? and one?,
and specialized Array#any? and Hash#any?
Based on patch by D.E. Akers [#11286]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10 22:36:28 +00:00
hsbt c02174354e Follow up r60970 for bundler's examples.
r60970 break Gemfile.lock format with file protocol after bundle
  install/update. I addd hostname to these examples.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-07 08:08:56 +00:00
eregon d209b4c0a2 Update to ruby/spec@e2d0d1e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 17:51:16 +00:00
svn 60775cc48a * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 15:41:52 +00:00
eregon 4d7b0b9112 Update to ruby/spec@bacedc5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 15:41:50 +00:00
eregon 821d9a2d30 Update to ruby/mspec@b501ade
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 15:41:23 +00:00
marcandre 87bcbf9ef5 Cherrypick 9f8d3d0 from ruby/spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29 19:46:46 +00:00
nobu b8d15b7e47 spec/ruby/optional/capi/constants_spec.rb: Data is deprecated now
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-29 10:38:36 +00:00
hsbt 6918546499 Ignored `bundle_ruby` example with Ruby core.
It was ignored with Bundler-1.15.x. It's regression at r60603.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27 05:38:48 +00:00
svn 3cac7256e5 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19 15:15:32 +00:00
eregon bd69f8e11c Add specs for concurrent Module#autoload
* When the file does not exist or the constant is not set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19 15:15:31 +00:00
eregon 578e760a8b Reorganize Module#autoload to have similar specs next to each other
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-19 15:15:12 +00:00
nobu 8c15f40acf parse.y: no return in class
* parse.y (k_return): prohibit return in class/module body except
  for singleton class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16 05:36:42 +00:00
kazu 7b7243e5a9 Modify spell miss.
Runing -> Running

Author:    TomoyukiNakagawa <nakagawa.tomoyuki@gmail.com>
[Fix GH-1741] [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-05 15:10:41 +00:00
eregon e7535c6eaa Workaround Travis CI issue by hardcoding localhost
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04 17:48:51 +00:00
nobu 996468de00 load from relative path to __FILE__
* spec/ruby/library/pathname/empty_spec.rb: load spec_helper from
  relative path to `__FILE__` same as other spec files, instead of
  `__dir__` in which symlinks are resolved, to get rid of constant
  redefinition warning when `srcdir` contains symlinks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-04 01:48:45 +00:00
usa f35fb6d36c Support Windows
* spec/bundler/spec_helper.rb: there are no reason to refuse ':' and '-' in the
  path of spec files.  especially, ':' is always contained on Windows.

* spec/bundler/spec/helper.rb: open3.rb is also supported on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02 04:28:30 +00:00
hsbt 0b5432a7bd Fixed syntax error with ignore option order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02 04:27:33 +00:00
svn afdee4fb60 * remove trailing spaces, append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:30:00 +00:00
hsbt be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
ko1 27be4d5adc stop refine_spec because it causes double free error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30 03:58:05 +00:00
eregon 55fd3e15b1 Clarify what is written and read in IO#popen spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 16:20:04 +00:00
eregon 1b17bd3e8f Fix spec which can fail if the pipe is closed before flushing in the subprocess
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29 16:18:50 +00:00
eregon 75ced70f56 Ignore the libruby check if it cannot be found
* ENV['RUBY_EXE'] can be just 'ruby' and is not an absolute path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 20:04:52 +00:00
eregon e6222d1f2e Make sure to compile each extension only once in ruby/spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 17:45:46 +00:00
eregon a53ac0c54f Use ENV['RUBY_EXE'] as RbConfig.ruby might be incorrect
* On a built-but-not-installed-ruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 16:15:46 +00:00
svn 6d0f79454d * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 15:15:52 +00:00
eregon 8c5b60eb22 Update to ruby/spec@a6b8805
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 15:15:48 +00:00
eregon 974e862db9 Update to ruby/mspec@90925d6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-28 15:14:55 +00:00