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

26736 Коммитов

Автор SHA1 Сообщение Дата
nobu e6f1e3f49d method transplanting
* proc.c (rb_mod_define_method): allow method transplanting from a
  module to either class or module.  [ruby-core:34267][Feature #4254]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-25 07:57:42 +00:00
nobu 0f0f0f4441 popen: shell commands with envvar
* io.c (is_popen_fork): check if fork and raise NotImplementedError if
  unavailable.
* io.c (rb_io_s_popen): allow shell commands with modified environment
  variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-25 06:42:05 +00:00
usa 0e8395d6cb * internal.h: use rb_pid_t instead of pid_t because of there is no
definition of pid_t here on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-25 02:35:29 +00:00
svn 7563b69cea * 2012-06-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 15:42:25 +00:00
kosaki 1ebe152ede * configure.in (for stack end address): remove human68k specific
check. It is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 15:42:21 +00:00
nobu cc1c97ae31 io.c: spawnv
* io.c (pipe_open): merge win32 code using spawnv().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 14:02:19 +00:00
nobu 5be0ab591c process.c: separate check_exec_fds_1
* process.c (check_exec_fds): separate check_exec_fds_1() since
  nonstatic initializer of an aggregate type is not allowed by C89.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 13:53:44 +00:00
nobu 5cc2112ed1 trailing spaces
* ChangeLog: remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 13:52:50 +00:00
akr 78993d43c7 update async-signal-safe comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-24 13:35:56 +00:00
svn de60be15e2 * 2012-06-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 22:48:17 +00:00
akr 72bbf9822d * internal.h (rb_execarg): options field removed.
* process.c: follow the rb_execarg change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 22:48:11 +00:00
akr 1ad4751aac * process.c (proc_spawn_cmd): unused variable removed to suppress a
warning.
  (save_env): ditto.

  [ruby-core:45797] reported by Luis Lavena.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 14:50:38 +00:00
akr f1734b4287 * internal.h (rb_execarg): add new_pgroup_given and new_pgroup_flag
fields.

* process.c (EXEC_OPTION_NEW_PGROUP): removed.
  (proc_spawn_cmd): take a struct rb_execarg argument.
  use the new fields.
  (rb_execarg_addopt): use the new fields.
  (rb_spawn_process): follow the proc_spawn_cmd change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 14:21:47 +00:00
akr 345ecf3711 * internal.h (rb_execarg): add fd_dup2, fd_close, fd_open,
fd_dup2_child fields.

* process.c (EXEC_OPTION_DUP2): removed.
  (EXEC_OPTION_CLOSE): removed.
  (EXEC_OPTION_OPEN): removed.
  (EXEC_OPTION_DUP2_CHILD): removed.
  (mark_exec_arg): mark the new fields.
  (check_exec_redirect1): change condition for default option.
  (check_exec_redirect): take a struct rb_execarg argument.
  use the new fields.
  (rb_execarg_addopt): follow the check_exec_redirect change.
  (check_exec_fds): use the new fields.
  (save_redirect_fd): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 11:35:32 +00:00
akr fe688f2d30 * process.c (rb_execarg_fixup): fix envopts condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 10:01:46 +00:00
akr 759c214a33 * process.c (check_exec_redirect1): extracted from
check_exec_redirect.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 09:44:43 +00:00
akr 92af9dddc8 * process.c (save_env): don't use EXEC_OPTION_UNSETENV_OTHERS.
(rb_execarg_run_options): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 08:22:53 +00:00
akr 26ecb6cbc4 * internal.h (rb_execarg): add env_modification field.
* process.c (EXEC_OPTION_ENV): removed.
  (mark_exec_arg): mark env_modification field.
  (rb_exec_fillarg): update the new field, instead of options array.
  (rb_execarg_fixup): use the new field.
  (save_env): ditto.
  (rb_execarg_run_options): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 08:18:34 +00:00
akr f732c5046e * internal.h (rb_execarg): add rlimit_limits field.
* process.c (EXEC_OPTION_RLIMIT): removed.
  (mark_exec_arg): mark rlimit_limits field.
  (rb_execarg_addopt): update the new fields, instead of options array.
  (run_exec_rlimit): use the new field.
  (rb_execarg_run_options): clear sarg using MEMZERO.  use the new
  field.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 07:30:26 +00:00
akr b25b9569e5 * internal.h (rb_execarg): add chdir_given and chdir_dir fields.
* process.c (EXEC_OPTION_CHDIR): removed.
  (mark_exec_arg): mark chdir_dir field.
  (rb_execarg_addopt): update the new fields, instead of options array.
  (rb_execarg_run_options): use the new fields.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 06:23:35 +00:00
akr f527ad625d * internal.h (rb_execarg): add close_others_given, close_others_do and
close_others_maxhint fields.

* process.c (EXEC_OPTION_CLOSE_OTHERS): removed.
  (rb_execarg_addopt): update the new fields, instead of options array.
  (check_exec_fds): take eargp as an argument.  update the
  close_others_maxhint field.
  (rb_execarg_fixup): follow the argument change of check_exec_fds.
  (rb_execarg_run_options): use the new fields.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 04:23:03 +00:00
akr 40ae2e0108 * internal.h (rb_execarg): add unsetenv_others_given and
unsetenv_others_do fields.

* process.c (EXEC_OPTION_UNSETENV_OTHERS): removed.
  (rb_execarg_addopt): update the new fields, instead of options array.
  (rb_execarg_fixup): use the new fields.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 01:43:51 +00:00
akr 2a15a26c57 * process.c: use the variable name "soptions" for sargp->options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 00:36:42 +00:00
akr 5c25fad66d * process.c: use the name "sargp" for struct rb_execarg variables
consistently for saving process attributes. 

* io.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-23 00:18:32 +00:00
tadf 0b3b2e885b revert some tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 23:30:17 +00:00
akr 3eafc1660f * process.c: use the name "eargp" for struct rb_execarg variables
consistently except for saving process attributes. 

* io.c: ditto.

* ext/pty/pty.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 23:09:16 +00:00
nagachika f7fc42a7af * ChangeLog: fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 17:26:04 +00:00
svn f120641e65 * 2012-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 15:51:49 +00:00
nobu 5a7db50517 .gdbinit: improve rp for class
* .gdbinit (rp): improve for class/iclass/module so print content of
  RClass.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 15:51:41 +00:00
nobu 91fcdd1865 [Bug #6540]
* test/ruby/test_rand.rb (TestRand#test_initialize_frozen): add
  missing test for [Bug #6540]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 13:37:16 +00:00
nobu 48fc312150 lib/test/unit.rb: show file count in parallel mode
* lib/test/unit.rb (Test::Unit::Runner#_run_parallel): show file count
  in parallel mode.  since worker processes run tests per files, the
  parent process cannot tell how many tests will be run in advance.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 12:45:12 +00:00
nobu 6e4c82607b lib/test/unit.rb: initialize ivar
* lib/test/unit.rb (Test::Unit::Runner#del_status_line): initialize
  @status_line_size if needed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 12:45:08 +00:00
yugui 5e06b53953 * common.mk: Add missing dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 12:05:11 +00:00
akr bcadfd9c08 * internal.h (rb_execarg): add pgroup_given and pgroup_pgid fields.
* process.c (EXEC_OPTION_PGROUP): removed.
  (rb_execarg_addopt): update the new fields, instead of options array.
  (run_exec_pgroup): take a struct rb_execarg argument.  refer the new
  fields.
  (rb_execarg_run_options): follow run_exec_pgroup change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 11:30:29 +00:00
kou 7b036a8ea7 * README.EXT, README.EXT.ja: use "sval" for the third argument
name of Data_Wrap_Struct().
  Suggested by @satoh_fumiyasu. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 09:52:32 +00:00
ko1 c4bc9b5758 * iseq.c, vm_eval.c: set th->base_block properly.
th->base_block is information for (a) parsing, (b) compiling
  and (c) setting up the frame to execute the program passed by
  `eval' method.  For example, (1) parser need to know up-level
  variables to detect it is variable or method without paren.
  Befor (a), (b) and (c), VM set th->base_block by passed bindng
  (or previous frame information).  After execute (a), (b) and (c),
  VM should clear th->base_block.  However, if (a), (b) or (c)
  raises an exception, then th->base_block is not cleared.
  Problem is that the uncleared value th->balo_block is used for
  irrelevant iseq compilation.  It causes SEGV or critical error.
  I tried to solve this problem: to clear them before exception,
  but finally I found out that it is difficult to do it (Ruby
  program can be run in many places).
  Because of this background, I set th->base_block before
  compiling iseq and restore it after compiling.
  Basically, th->base_block is dirty hack (similar to global
  variable) and this patch is also dirty.
* bootstraptest/test_eval.rb: add a test for above.
* internal.h: remove unused decl.
* iseq.c (rb_iseq_compile_with_option): add base_block parameter.
  set th->base_block before compation and restore it after
  compilation.
* ruby.c (require_libraries): pass 0 as base_block instead of
  setting th->base_block
* tool/compile_prelude.rb (prelude_eval): apply above changes.
* vm.c, vm_eval.c: ditto.
* vm_core.h: add comments.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 09:32:56 +00:00
akr 471d8d2586 * process.c: pass struct rb_execarg value instead of its options
field for saving process attribute changing functions.
  (save_redirect_fd): take a struct rb_execarg argument.
  (run_exec_dup2): ditto.
  (run_exec_close): ditto.
  (run_exec_open): ditto.
  (run_exec_dup2_child): ditto.
  (run_exec_pgroup): ditto.
  (run_exec_rlimit): ditto.
  (save_env): ditto.
  (rb_execarg_run_options): follow the above functions change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 09:24:21 +00:00
ko1 a359da8420 * test/ruby/test_backtrace.rb: decrease recursion depth
to reduce consuming stack size.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 08:58:29 +00:00
nobu 407e32746e marshal.c: io_needed
* marshal.c (io_needed): extract from marshal_dump and marshal_load.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 05:22:46 +00:00
nobu 0b0dea752c random.c: check initialize and load
* random.c (random_init, random_load): cannot initialize frozen object
  again, nor with tainted/untrusted object.  [Bug #6540]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 04:36:54 +00:00
nobu 77898c33e3 error.c: rb_check_copyable
* 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
2012-06-22 04:32:39 +00:00
nobu 47c6131b29 process.c: constant expression
* process.c (rb_exec_async_signal_safe): use a constant expression
  instead of a macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 03:07:26 +00:00
nobu 52d85c1014 variable.c: fix indent
* variable.c (rb_ivar_count, rb_autoloading_value): fix indent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22 03:07:22 +00:00
svn fb120181f6 * 2012-06-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 20:56:35 +00:00
drbrain 62df750a4b * eval.c (ruby_cleanup): Fixed typo. Patch by Trever Dawe.
Fixes #131 (github).  [ruby-trunk - Bug #6619]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 20:56:23 +00:00
akr c7a68e8d9d needless RB_GC_GUARD removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 13:46:14 +00:00
akr 13ffa4c6ee remove garbage line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 12:46:34 +00:00
akr ed8040a62b * process.c (rb_execarg_addopt): take a VALUE argument instead of
struct rb_execarg.
  (rb_exec_arg_addopt): follow the rb_execarg_addopt change.
  (check_exec_options_i): ditto.

* io.c (pipe_open): follow the rb_execarg_addopt change.

* internal.h (rb_execarg_addopt): follow the definition change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 12:18:40 +00:00
akr 511e25b2d5 * process.c (rb_exec_fillarg): take a VALUE argument instead of
struct rb_execarg.
  (rb_check_exec_options): ditto.
  (check_exec_options_i): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 11:36:25 +00:00
akr 1b2c2316a5 * process.c (rb_exec_async_signal_safe): use rb_execarg_run_options
instead of rb_run_exec_options_err.
  (rb_spawn_process): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-21 10:48:48 +00:00