Age | Commit message (Collapse) | Author |
|
* class.c (rb_prepend_module): prepend module into another module.
* eval.c (rb_mod_prepend): new method Module#prepend. [Feature #1102]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* error.c (rb_check_copyable): new function, to ensure the target is
not frozen and the source is not tainted nor untrusted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
struct rb_exec_arg in intern.h.
* include/ruby/intern.h (struct rb_exec_arg): refer Data object which
contains struct rb_execarg.
* process.c: use struct rb_execarg instead of struct rb_exec_arg
except functions declared in intern.h.
(rb_exec_arg_addopt): extract a pointer to struct rb_execarg from
struct rb_exec_arg.
(rb_exec_arg_init): ditto.
(rb_exec_arg_fixup): ditto.
(rb_run_exec_options_err): ditto.
(rb_run_exec_options): ditto.
(rb_exec_err): ditto.
(rb_exec): ditto.
* io.c: use struct rb_execarg instead of struct rb_exec_arg.
* ext/pty/pty.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
and NAN. Otherwise, strange macro redefinition will occur.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* include/ruby/backward/rubysig.h: fix visibility. [Bug #6607]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* include/ruby/ruby.h: public symbols must have default visibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
for few years because:
* NODE is no longer accessible.
* rb_iseq_eval_main crashes without preparing with rb_thread_t.
* some existing APIs calls exit(3) without giving the opportunity to
finalize or handle errors to the client.
* No general-purpose function to compile a source to an iseq are
published in the public headers.
This commit solves the problems.
* include/ruby/ruby.h: Grouped APIs for embedding CRuby interpreter.
(ruby_setup, ruby_compile_main_from_file,
ruby_compile_main_from_string, ruby_eval_main,
ruby_set_script_name): new APIs to embed CRuby.
(ruby_opaque_t) Opaque pointer to an internal data, to NODE or iseq
in particular.
* eval.c (ruby_setup): Similar to ruby_init but returns an error code
instead of exit(3) on error.
(ruby_eval_main): Similar to ruby_exec_node but returns the
evaluation result.
(ruby_eval_main_internal): renamed from ruby_exec_internal.
* ruby.c (toplevel_context): new helper function.
(PREPARE_EVAL_MAIN): moved.
(process_options): refactored with new functions.
(parse_and_compile_main) new helper funciton.
(ruby_compile_main_from_file, ruby_compile_main_from_string) new API
(ruby_set_script_name): new API.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* include/ruby/win32.h: get rid of C99 style one line comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
(rb_exec_arg_addopt): ditto.
(rb_exec_arg_fixup): ditto.
(rb_run_exec_options): ditto.
(rb_run_exec_options_err): ditto.
* internal.h (rb_execarg_init): declared.
(rb_execarg_addopt): ditto.
(rb_execarg_fixup): ditto.
(rb_execarg_run_options): ditto.
* process.c: call rb_execarg_addopt, rb_execarg_fixup,
rb_execarg_run_options, rb_execarg_init.
(rb_execarg_addopt): renamed from rb_exec_arg_addopt.
(rb_exec_arg_addopt): stub to call rb_execarg_addopt.
(rb_execarg_init): renamed from rb_exec_arg_init.
(rb_exec_arg_init): stub to call rb_execarg_init.
(rb_execarg_fixup): renamed from rb_exec_arg_fixup.
(rb_exec_arg_fixup): stub to call rb_execarg_fixup.
(rb_execarg_run_options): renamed from rb_run_exec_options_err.
(rb_run_exec_options_err): stub to call rb_execarg_run_options.
(rb_run_exec_options): call rb_execarg_run_options.
* io.c: call rb_execarg_addopt, rb_execarg_fixup,
rb_execarg_run_options, rb_execarg_init.
* ext/pty/pty.c (establishShell): call rb_execarg_init and
rb_execarg_fixup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
(rb_exec): ditto.
(rb_exec_err): ditto.
(rb_fork): ditto.
(rb_fork_err): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
return a value.
* process.c (rb_exec_arg_init): return a value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
internal.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
this API wraps an I/O handle (HANDLE or SOCKET) and returns fd.
the second parameter should be combination of O_*, for example,
O_RDWR | O_BINARY | O_NOINHERT.
* win32/win32.c, include/ruby/win32.h (rb_w32_unwrap_io_handle): new
API. this API unwraps an I/O handle and close the fd (not closes
the handle itself).
[Feature #4960] [ruby-core:37227]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* include/ruby/intern.h (rb_proc_exec_n): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
run_exec_dup2 here because it should be async-signal-safe.
(run_exec_dup2): use the temporary buffer.
(run_exec_dup2_tmpbuf_size): new function.
* include/ruby/intern.h (rb_exec_arg): add dup2_tmpbuf field.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* object.c (rb_obj_init_copy): should check if trusted too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* complex.c: ditto.
* rational.c: ditto.
* include/ruby/intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
add use_shell, argv_str and argv_buf fields.
* process.c (rb_proc_exec_e): don't split shell command line arguments
here to avoid memory allocation in a child process.
(rb_exec_fillarg): split shell command line arguments here.
(proc_exec_v): takes argv_str argument instead of argv.
(rb_proc_exec_ne): removed.
(rb_proc_exec_n): removed.
(rb_run_exec_options_err): don't initialize the removed fields.
(rb_exec_err): don't initialize the removed fields.
call proc_exec_v directly instead of rb_proc_exec_ne.
(rb_spawn_process): use use_shell field.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
But now disabled. [experimental]
* complex.c: followed the above.
* rational.c: ditto.
* include/rub/intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
failed. [ruby-core:44093] [ruby-trunk - Bug #6249]
* include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field
to store envp of execve().
* process.c (proc_exec_v): takes envp_str as an argument and use it
for execve().
(rb_proc_exec_ne): extended version of rb_proc_exec_n().
(rb_proc_exec_n): use rb_proc_exec_ne().
(rb_proc_exec): follow proc_exec_v() change.
(fill_envp_buf_i): new function.
(rb_exec_arg_fixup): set up envp_str and envp_buf.
(save_env_i): removed.
(save_env): removed.
(rb_run_exec_options_err): don't modify environment variables.
(rb_exec_err): use rb_proc_exec_ne().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in
rb_enc_vsprintf(). [Feature #5896]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
To avoid buffer overflow when smaller FD_SETSISE is used in ext
libraries.
* win32/win32.c (rb_w32_fdset): this function is not used anymore.
But we leave this for compatibility.
* win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller
FD_SETSISE is used in ext libraries. Dereference of fd_set pointer
causes SEGV.
* test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for
above.
* ext/-test-/win32/fd_setsize/depend: ditto.
* ext/-test-/win32/fd_setsize/extconf.rb: ditto.
* ext/-test-/win32/fd_setsize/fd_setsize.c: ditto.
[ruby-core:44588] [Bug #6352]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
versions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
registered with NUL-terminated C string.
* sprintf.c (rb_str_format): avoid inadvertent symbol creation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
the message in the given encoding. patched by now (Nikolai
Weibull) at [ruby-core:41160]. [Feature #5650]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
new function.
* process.c (enum): add EXEC_OPTION_PGROUP and move the position
above for the usage in proc_spawn_n().
* process.c (proc_spawn_n): add an argument to pass new option
`new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
CreateProcessW(). This flag is necessary for the usage of
Process.kill on the subprocess on Windows.
* process.c (rb_exec_arg_addopt): ditto.
* process.c (rb_spawn_process): ditto.
* process.c (documentation for rb_f_spawn): add documentation for new
option `new_pgroup` of spawn.
* test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
add tests for option `new_pgroup`.
* test/ruby/test_thread.rb
(TestThreadGroup#test_thread_timer_and_interrupt):
add option `new_pgroup: true` to spawn on Windows. It's needed for
Process.kill on a subprocess.
* win32/win32.c (CreateChild): add an argument to pass
dwCreationFlags of CreateProcessW().
* win32/win32.c (rb_w32_spawn): ditto.
* win32/win32.c (rb_w32_aspawn_flags): add new function to pass
dwCreationFlags.
* win32/win32.c (rb_w32_aspawn): refactor to move the content to
rb_w32_aspawn_flags().
[ruby-core:43245][Bug #6131]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
well as String#hex and String#oct. [ruby-core:43566][Bug #6192]
* string.c (rb_must_asciicompat): check if ASCII compatible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
to time_t directly, not to be affected by TZ unnecessarily.
* win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME
simply.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
remove static.
* enumerator.c (lazy_init_iterator, lazy_init_yielder,
lazy_select_func, lazy_reject_func, lazy_grep_func): handle
multiple values correctly.
* enumerator.c (lazy_grep): change the behavior when a block is
given, to be consistent with Enumerable#grep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
accept and to return UTF-8 strings.
* win32/win32.c (rb_w32_getenv): follow above change.
* win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area.
* hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes.
[Bug #5570] [ruby-core:40737]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* array.c: Use rb_check_arity / rb_error_arity
* class.c: ditto
* enumerator.c: ditto
* eval.c: ditto
* file.c: ditto
* hash.c: ditto
* numeric.c: ditto
* proc.c: ditto
* process.c: ditto
* random.c: ditto
* re.c: ditto
* signal.c: ditto
* string.c: ditto
* struct.c: ditto
* transcode.c: ditto
* vm_eval.c: ditto
* vm_insnhelper.c: ditto & implementation of rb_error_arity
* test/ruby/test_arity.rb: tests for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
optional parameters (issue #6085)
* include/ruby/intern.h: define UNLIMITED_ARGUMENTS
* test/ruby/test_arity.rb: test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
arbitrary object as a pointer to rb_encoding, and return NULL if
not found.
* io.c (io_encoding_set): just warn unsupported encodings, but not
exception. [ruby-core:40726] [Bug #5567]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
and st_delete_safe. patched by Sokolov Yura at
https://github.com/ruby/ruby/pull/84
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Yura at https://github.com/ruby/ruby/pull/84
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* error.c (rb_load_fail): use path as a string, not char*.
* internal.h: (rb_load_fail): moved from ruby/intern.h.
* ruby.c (load_file_internal): fname cannot be NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
instance variable to the LoadError exception.
* load.c: call rb_loaderror_with_path so that the missing path is
added to the exception.
* ruby.c: call rb_loaderror rather than raising our own LoadError
exception.
* include/ruby/intern.h: add declaration for rb_loaderror_with_path.
* test/ruby/test_require.rb: add supporting test for LoadError#path
method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
patched by Sokolov Yura <funny.falcon AT gmail.com>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
internal use only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
rb_sys_fail.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[ruby-core:42849]
* include/ruby/ruby.h (UNREACHABLE): fallback definition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
https://github.com/k-takata/Onigmo
cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h
cp oniguruma.h
cp tool/enc-unicode.rb
cp -r enc/
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
(rb_enc_path_last_separator, rb_enc_path_end)
(ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware
path handling functions.
* file.c (rb_home_dir, file_expand_path, rb_realpath_internal)
(rb_file_s_basename, rb_file_dirname, rb_file_s_extname)
(rb_file_join): should respect the encodings of arguments than
file system encoding. [ruby-dev:45145] [Bug #5919]
* dir.c (check_dirname, ruby_glob0): ditto.
* ext/pathname/pathname.c (path_sub_ext): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|