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

4166 Коммитов

Автор SHA1 Сообщение Дата
ryan 9bec8ef50c Imported minitest 2.6.2 (r6712)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 20:34:21 +00:00
emboss 65ca601ba6 * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
binary data.
* test/openssl/test_ssl.rb: Add test for it.

Thanks to Niklas Baumstark for reporting the issue!

[Ruby 1.9 - Bug #5233] [ruby-core:39120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 20:05:21 +00:00
nobu 039f12b5bb * ext/pty/pty.c (pty_check): should return nil until the child
terminates or stops.  [ruby-dev:44600] [Bug #2642]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-14 03:14:00 +00:00
nahi a31495b170 * test/openssl/test_ssl.rb: Move duplicated tests for SSL::Session to
test_ssl_session.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-12 14:41:19 +00:00
ktsj a30fd3b660 * test/psych/test_yamldbm.rb: don't run test if the system
don't support yaml/dbm.

* test/syck/test_yamldbm.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-09 02:18:18 +00:00
nobu d5e7b3972c * test/-ext-/symbol/test_inadvertent_creation.rb (noninterned_name):
sigil of global, instance and class variable names should be
  followed by non-numeric.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-07 11:29:37 +00:00
nobu 881891fb2f * test/-ext-/symbol/test_inadvertent_creation.rb: moved tests from
test_module.rb and test_symbol.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-07 08:57:42 +00:00
nobu 89fef02f13 * vm_eval.c (make_no_method_execption): extract from
raise_method_missing().
* vm_eval.c (send_internal): remove inadvertent symbol creation
  from public_send.  based on a patch by Jeremy Evans <code AT
  jeremyevans.net> in [ruby-core:38576]. [Feature #5112]
* vm_insnhelper.c (vm_call_method): remove inadvertent symbol
  creation from send and __send__, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-06 07:29:33 +00:00
naruse 0a5ac6a448 Revert r33407; half-baked patch.
"* numeric.c (ruby_float_step): improve floating point calculations."

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-05 07:36:28 +00:00
naruse a635de7dcb * numeric.c (ruby_float_step): improve floating point calculations.
[ruby-core:35753] [Bug #4576]

* numeric.c (ruby_float_step): correct the error of floating point
  numbers on the excluding case.
  patched by Masahiro Tanaka [ruby-core:39608]

* numeric.c (ruby_float_step): use the end value when the current
  value is greater than or equal to the end value.
  patched by Akira Tanaka [ruby-core:39612]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-05 07:35:27 +00:00
tenderlove 137c547c3e * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
message attributes during parse failure.
* ext/psych/parser.c: Update parser to raise exception with correct
  values.
* test/psych/test_exception.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 17:53:41 +00:00
naruse 4eb497d90b * lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.
Reported by Christopher Eberz. [ruby-core:39903] Bug #5399

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 07:37:11 +00:00
naruse 356c7cbfb6 * gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 02:44:55 +00:00
naruse f65cdf797f Fix test of gc introduced in r33379.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 01:25:04 +00:00
drbrain 90dfc8f99e * lib/rubygems: Update to RubyGems 1.8.11. Move Deprecate into the
Gem namespace.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 22:15:47 +00:00
tenderlove 1c60db55ac * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
* ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
  in order to avoid YAML::ENGINE switching from replacing this method.
* test/psych/helper.rb: fix tests for method name change.
* test/psych/test_document.rb: ditto
* test/psych/visitors/test_emitter.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:31:43 +00:00
tenderlove bd3b0d470c * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
floating point spec defined in YAML to avoid erronious parses.
* test/psych/test_numeric.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:21:31 +00:00
nagachika 3973e70d92 * gc.c (rb_gc_set_params): output GC parameter change messages only
if -w/-v options are specified. these messages are output to stderr,
  not to stdout. [ruby-core:39795] [Bug #5380]

* test/ruby/test_gc.rb (test_gc_parameter): add test for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 15:02:58 +00:00
ayumin 051aa44240 * test/psych/test_yamldbm.rb: add test case.
* test/syck/test_yamldbm.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-02 03:18:39 +00:00
nobu 5e7ff0511e * test/mkmf/test_framework.rb: test for r33372.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-02 01:27:00 +00:00
nagachika 3d2451d996 * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when
heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS.
  [ruby-core:39777] [Bug #5380]

* test/ruby/test_gc.rb (test_gc_parameter): add test for it.

* test/ruby/envutil.rb (assert_normal_exit): add :child_env option to
  enable pass environemnt variables to child process.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01 01:00:40 +00:00
nobu 0003d051dd * test/ruby/test_bignum.rb: use more descriptive assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30 19:50:38 +00:00
nobu f212df564a * test/ruby/test_bignum.rb (TestBignum#test_interrupt): fix for
faster CPU.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30 19:50:25 +00:00
naruse 7fe9a24a0d Fix wrong expectaion of r33363.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30 00:18:18 +00:00
nobu 813f358569 * array.c (ary_join_1): should not copy the encoding of non-string
element after string element.  [ruby-core:39776] [Bug #5379]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29 18:18:03 +00:00
ayumin 2865b450e0 * test/psych/test_yamlstore.rb: use tmpdir for tmpfile.
* test/syck/test_yamlstore.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-27 19:44:02 +00:00
ayumin 38fe7da841 Oops! fix psych -> syck
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 19:01:48 +00:00
ayumin 379d519f0b * test/rexml/test_sax.rb: add require 'rexml/document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 18:52:10 +00:00
ayumin 375d9f9112 * test/psych/test_yamldbm.rb (require): fix #setup and #terdown.
[Bug #5370] [ruby-core:39730]
* test/syck/test_yamldbm.rb (require): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 18:37:26 +00:00
emboss 8b7e10879e * ext/openssl/ossl_asn1.c: fix int_ossl_asn1_decode0_cons when being
fed arbitrary string values.
  Clearly distinguish between the cases "universal, infinite and
  not a SEQUENCE or SET" and "universal SEQUENCE or SET, possibly
  infinite". Raise error for universal tags that are not infinite.
* test/openssl/test_asn1.rb: add a test for this.

  Thanks to Hiroshi Yoshida for reporting this bug.
  [Bug #5363] [ruby-dev:44542]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25 14:51:20 +00:00
ayumin 3255adcd0c * test/syck/test/yamldbm.rb: add test for Syck::DBM.
* test/psych/test_yamldbm.rb: add test for Psych::DBM.
* test/psych/test_yamlstore.rb: add test for Psych::PStore.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25 12:05:06 +00:00
nobu fecda0d9f7 * encoding.c (require_enc): reject only loading from untrusted
load paths.  [ruby-dev:44541] [Bug #5279]
* transcode.c (load_transcoder_entry): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25 07:54:35 +00:00
naruse 73220a234e * enum.c (slice_before_i): use rb_attr_get to surpress wrong warning
for internal instance variable slicebefore_initial_state.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-24 18:43:32 +00:00
emboss e2694c597d * test/openssl/test_ssl_session.rb: execute test_session_exts_read
only for OpenSSL versions >= 0.9.8k. Thanks, Eric Wong, for
  reporting this.
  [Bug #4961] [ruby-core:37726]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-23 04:51:19 +00:00
emboss e3af0655e2 * test/openssl/test_ssl_session.rb: ensure server calls callbacks in
test_ctx_server_session_cb. Thanks to Eric Wong for the patch.
  [Bug #5336] [ruby-core:39619]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-23 03:14:24 +00:00
usa f48ef8bb9e * test/io/wait/test_io_wait.rb (TestIOWait#setup): of course, the
behavior of mingw is just same with mswin.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-21 08:02:03 +00:00
naruse 3a902c4dbd Skip patented algorithms: IDEA and RC5 on NetBSD.
On NetBSD, if it uses patented algorithms without explicit option,
openssl will abort.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-20 07:18:37 +00:00
naruse c7b58831a3 Explicitly close the tcp connection.
Without this, the connection will be alive without GC after exit
the block and the test will fail as "TCPServer was closed and SSLServer
is still alive" on 64bit Unix: at least CentOS, Ubuntu, and FreeBSD.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-20 01:23:33 +00:00
naruse fbf4c1d277 OepnSSL supports TLS extension from 0.9.8f.
http://www.openssl.org/news/changelog.html
Reported by  Eric Wong. [ruby-core:39617] [Bug #4961]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-19 18:30:23 +00:00
kosaki d4db53a0e0 * test/-ext-/old_thread_select/test_old_thread_select.rb:
select() with timeout may return early in old Linux kernels
  with 250 Hz tickrate and no dynticks, so skip everything older
  than 2.6.32 (which has long term support).
  And, Make the timing assertions consistently use assert_operator with
  timing difference in error message
  Patch by Eric Wong. [Bug #5335] [ruby-core:39618]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-19 09:47:27 +00:00
drbrain 7c371d4658 * test/openssl/test_ssl.rb (class OpenSSL): Test
OpenSSL::SSL::SSLSocket#session and #session=.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-19 00:28:41 +00:00
nobu 125b62e76d * object.c (rb_obj_clone): singleton class should be attached
singleton object to.  a patch by Satoshi Shiba <shiba AT rvm.jp>
  at [ruby-dev:44460].  [Bug #5274]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-18 22:54:25 +00:00
nobu c4d77cb4ad * parse.y (parser_data_type): inherit the core type in ripper so
that checks in core would work.  [ruby-core:39591] [Bug #5331]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-17 14:34:13 +00:00
nobu 4e7c8bbe03 * lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-13 11:21:52 +00:00
nobu f7081431f2 * lib/pstore.rb (PStore): always open in binary mode even if
default encodings are set.  [Bug #5311] [ruby-core:39503]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-13 06:02:59 +00:00
kosaki 2c9375ba69 * thread.c (rb_thread_select): fix to ignore an argument
modification of rb_thread_fd_select().
  based on a patch by Eric Wong. [Bug #5306] [ruby-core:39435]
* thread.c (rb_fd_rcopy): New. for reverse fd copy.

* test/-ext-/old_thread_select/test_old_thread_select.rb
(test_old_select_false_positive): test for bug5306.

* ext/-test-/old_thread_select/old_thread_select.c (fdset2array):
  New. convert fdsets to array.
* ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
  return 'read', 'write', 'except' argument of rb_thread_select()
  to ruby script.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12 11:36:06 +00:00
nobu a458e72e7c * test/ruby/test_exception.rb (TestException#test_exit_success_p):
assert also the cases when exiting with true and false.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12 03:42:39 +00:00
naruse 39ec2f6864 Revert test fixes.
This reverts r33233, r33234, and r33235.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-10 10:34:15 +00:00
naruse cf8626a082 Run GC.start before test_too_long_path.
NoMemoryError is raised in MiniTest#exception_details where exception
is made, and no effect. Run GC.start before running to keep the room.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 06:29:36 +00:00
naruse 6199181b09 Catch NoMemoryError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 02:26:31 +00:00
naruse dcea3a0fb2 Decide by majority.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 02:26:28 +00:00
sorah 73a1e841d6 * test/rubygems/test_gem_commands_help_command.rb: Add one
`require` because if run test-all with test/unit parallel
  running, sometimes this test fails by some constants not found.
  The error reason is some worker doesn't require the file needed by
  this test. This issue is related to [ruby-core:36168].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 02:08:44 +00:00
nobu 61b062ba6d * thread.c (rb_thread_select): fix a typo to initialize efds
properly.  [Bug #5299] [ruby-core:39380]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09 01:22:06 +00:00
ayumin 32b81702d7 fix test/rexml/test_encoding.rb failure
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 18:03:23 +00:00
kou 2bb6fcb6fd * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
allow a single hyphen in comment. [Bug 5278]
  Reported by Thomas Fritzsche. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 14:42:44 +00:00
naruse 6b3feab965 Remove assertion which depends the load order
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 10:36:11 +00:00
naruse f2bd0ce993 * lib/yaml.rb: explicitly specify ::Object to avoid the collision with
Syck::Object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-07 08:28:42 +00:00
sorah 7e04b19d22 * lib/test/unit.rb (_run_suites): Now reports are written the
following order: Skip, Failure, Error. [Feature #5282]

* test_sorting.rb: test for above.

* test4test_sorting.rb: Ditto.

* lib/test/unit.rb (run): Put RUBY_DESCIPTION before quitting.
  [Feature #5282]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06 12:20:17 +00:00
naruse 90c33c2198 Use assert_operator to show clear message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06 08:11:21 +00:00
nobu 3a6c3a672f * encoding.c (load_encoding): predefined encoding names are safe.
[ruby-dev:44469] [Bug #5279]
* transcode.c (load_transcoder_entry): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06 04:15:49 +00:00
nobu a1c5ebe787 * transcode.c: enabled econv newline option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06 03:07:16 +00:00
seki 319531524b * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures
[ruby-dev:44430] [Ruby 1.9 - Bug #372]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05 20:39:54 +00:00
nobu ff2c5c161c * test/ruby/test_float.rb (TestFloat#test_round): show the number in question.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05 08:46:44 +00:00
naruse 522c16e84c * test/rubygems/test_gem_security.rb
(test_class_build_self_signed_cert): reset opt[:trust_dir] to apply
  temporary Gem.user_home.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05 06:06:31 +00:00
shugo 26f73a5117 * lib/net/imap.rb (default_port, default_imap_port,
default_tls_port, default_ssl_port, default_imaps_port):
  added methods for consistency with Net::POP.
  based on the patch by art lussos.  [ruby-core:38997] [Bug #5198]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04 13:33:14 +00:00
ktsj 7c9b9977b0 * test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
add a test. Unlike TestThread#test_no_valid_cfp,
  this test succeeds even if win32ole is required (see r33153).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 15:54:44 +00:00
nobu bc2a1f2a98 * variable.c (rb_const_set): show the previous definition
location.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 15:11:53 +00:00
nobu 74f724de1a * io.c (argf_next_argv): open in default text mode.
[ruby-core:39234] [Bug #5268]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 14:52:18 +00:00
nagachika a46d29bb4e * lib/thread.rb (SizedQueue#max=) raise ArgumentError if max is not
positive number. patch by Masaki Matsushita.
  [ruby-dev:44449] [Bug #5259]

* test/thread/test_queue.rb (test_sized_queue_initialize,
  test_sized_queue_assign_max): add tests for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 09:46:51 +00:00
nobu b31c817782 * test/ruby/test_encoding.rb (test_find): mingw is not Unix, of course.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03 04:49:43 +00:00
nobu 7dddaf6807 * vm_insnhelper.c (vm_search_const_defined_class): search
ancestors only when global scope.  [ruby-core:39227] [Bug #5264]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 05:36:49 +00:00
nobu 5e14b97947 * parse.y (parser_tokadd_string, parser_yylex): ignore a backslash
which prefixes an non-ascii character, which has no escape
  syntax.  [ruby-core:39222] [Ruby 1.9 - Bug #5262]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02 00:58:10 +00:00
tenderlove 8659de2e0f * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
ascii-8bit as binary in YAML.
* test/psych/test_string.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 19:07:44 +00:00
nobu c4eb2983ba * numeric.c (flo_round): substitute machine dependent magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 16:07:16 +00:00
nobu 43284b6bf8 * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see
also inherited constants for classes without superclass and
  modules.  [ruby-core:37698] [Bug #3423]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 08:31:24 +00:00
nahi d3507e3ea6 * Release GVL while OpenSSL's public key generation.
t = Thread.new { print "."; sleep 0.1 }
    key = OpenSSL::PKey::RSA.new(2048)
    #=> Thread t works in parallel with public key generation if
        OS/machine allows it.

  This works with OpenSSL >= 0.9.8. From this version, it has new 
  public key generation function which allows us to interrupt the
  execution while pkey generation iterations.

* ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
  generation function. (DH_generate_parameters_ex,
  DSA_generate_parameters_ex and RSA_generate_key_ex.

* ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
  ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
  generation which handles Thread interruption by Ruby.
  ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
  sets a stop flag. New pkey generation callback ossl_generate_cb_2
  checks the stop flag at each iterations of OpenSSL and interrupts
  pkey generation when the flag is set.

* ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
  rb_thread_blocking_region with the above unblock function to release
  GVL while pkey generation.

* ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.

* ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.

* test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 07:42:29 +00:00
usa ca3b4133fd * test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip when
win32ole is required.  in such case, win32ole redefines
  Thread#initialize, and the block argument becomes to be not the top
  of the thread, then this testcase always fails.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 05:09:29 +00:00
usa 9cdc7f9db0 * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test
  committed in r33144.  I'd misunderstood the spec of ruby's universal
  newline.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 01:22:58 +00:00
naruse 91e4b4f6d8 Remove tests of json/add/{complex, rational}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 00:23:20 +00:00
nahi cfe8ed5cbc * Re-apply r33078, thread-safe autoload which is reverted at r33093.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 08:28:19 +00:00
usa 8b74d0c3fb * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,
default_mode_on_unix,text_mode,binary_mode}): tests for [Bug # 5164].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 07:29:57 +00:00
naruse c06658feba * ext/json: Merge json gem v1.5.4 (3dab4c5a6a97fac03dac).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31 06:56:16 +00:00
usa 13a77870de * test/-ext-/old_thread_select/test_old_thread_select.rb
(TestOldThreadSelect#test_old_select_read_timeout): if the machine
  is fast enough, the time used by code around IO.select may be smaller
  than Time implement threshold.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:34:54 +00:00
usa 34e65bee79 * ext/-test-/old_thread_select/old_thread_select.c (old_thread_select):
typo.

* test/-ext-/old_thread_select/test_old_thread_select.rb
  (TestOldThreadSelect#test_old_select_signal_safe): use SIGINT instead
  of SIGUSR1 because the former is general and the latter is platform
  dependent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:07:21 +00:00
nagachika 527be1b25a * test/dl/test_callback.rb (test_callback_with_string): prevents
temporary string from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 13:39:31 +00:00
naruse b14c060dda * ext/json: Merge json gem 1.5.4+ (2149f4185c598fb97db1).
[Bug #5173] [ruby-core:38866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 02:23:12 +00:00
kosaki 0cebfad20a * thread.c (rb_thread_select): rewrite by using
rb_thread_fd_select(). old one is EINTR unsafe.
  Patch by Eric Wong. [Bug #5229] [ruby-core:39102]

* test/-ext-/old_thread_select/test_old_thread_select.rb:
  a testcase for rb_thread_select().
* ext/-test-/old_thread_select/old_thread_select.c: ditto.
* ext/-test-/old_thread_select/depend: ditto.
* ext/-test-/old_thread_select/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 00:33:05 +00:00
mrkn 9742dec279 * test/ruby/test_numeric.rb (test_num2long): modify a test agaist the
change by r33108.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29 14:24:31 +00:00
naruse 733e371c2a Use psych_yaml_as to avoid collision with Syck.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29 05:54:03 +00:00
mrkn 640420f704 * numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted for
bitwise arithmetic with a Fixnum.  #1792
* test/ruby/test_fixnum.rb: add tests for the above change.
* bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for
 bitwise arithmetic with a Bignum.  #1792
* test/ruby/test_bignum.rb: add tests for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29 01:07:15 +00:00
ryan 4c66fc0890 Imported minitest 2.5.1 (r6596)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27 20:30:57 +00:00
naruse 23b2808693 * strftime.c (rb_strftime_with_timespec): get enc argument to specify
the encoding of the format. On Windows (at least Japanese Windows),
  Time#strftime("%Z") includes non ASCII in locale encoding (CP932).
  So convert locale to default internal. [ruby-core:39092] [Bug #5226]

* strftime.c (rb_strftime): ditto.

* strftime.c (rb_strftime_timespec): ditto.

* internal.h (rb_strftime_timespec): follow above.

* time.c (rb_strftime_alloc): ditto.

* time.c (strftimev): ditto.

* time.c (time_strftime): ditto.

* time.c (time_to_s): the resulted string of Time#to_s is always
  ascii only, so this should be US-ASCII.

* time.c (time_asctime): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27 09:18:18 +00:00
nahi 4d033a11c5 * Revert r33078. It caused a Rails application NoMethodError.
/home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/utils.rb:157: warning: toplevel constant ScanError referenced by Regin::Parser::ScanError
  /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/vendor/regin/regin/parser.rb:17:in `parse_regexp': undefined method `scan_str' for #<Regin::Parser:0x00000002344548> (NoMethodError)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27 02:19:42 +00:00
nahi 1e7f99dddf * variable.c: Make autoload thread-safe. See #921.
What's the problem?
    autoload is thread unsafe. When we define a constant to be
    autoloaded, we expect the constant construction is invariant. But
    current autoload implementation allows other threads to access the
    constant while the first thread is loading a file.

  What's happening inside?
    The current implementation uses Qundef as a marker of autoload in
    Constant table. Once the first thread find Qundef as a value at
    constant lookup, it starts loading a defined feature. Generally a
    loaded file overrides the Qundef in Constant table by module/class
    declaration at very beginning lines of the file, so other threads
    can see the new Module/Class object before feature loading is
    finished. It breaks invariant construction.

  How to solve?
    To ensure invariant constant construction, we need to override
    Qundef with defined Object after the feature loading. For keeping
    Qundef in Constant table, I expanded autoload_data struct in
    Module to have a slot for keeping the defined object while feature
    loading. And changed Module's constant lookup/update logic a
    little so that the slot is only visible from the thread which
    invokes feature loading. (== the first thread which accessed the
    autoload constant)

  Evaluation?
    All test passes (bootstrap test, test-all and RubySpec) and added
    8 tests for threading behavior. Extra logics are executed only
    when Qundef is found, so no perf drop should happen except
    autoloading.

* variable.c (rb_autoload): Prepare new autoload_data struct.

* variable.c (rb_autoload_load): Load feature and update Constant
  table after feature loading is finished. 

* variable.c (rb_const_get_0): When the fetched constant is under
  autoloading, it returns the object only for the thread which starts
  autoloading.

* variable.c (rb_const_defined_0): Ditto.

* variable.c (rb_const_set): When the specified constant is under
  autoloading, it sets the object only for the thread which starts
  autoloading. Otherwise, simply overrides Qundef with constant
  override warning.

* vm_insnhelper.c (vm_get_ev_const): Apply same change as
  rb_const_get_0 in variable.c.

* test/ruby/test_autoload.rb: Added tests for threading behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26 10:27:20 +00:00
drbrain e93d882d96 * lib/rubygems: Update to RubyGems 1.8.10. Fixes security issue in
creating ruby-format gemspecs.  Fixes Gem.dir not being at the front
  of Gem.path to fix uninstall and cleanup commands.  Fixes gem
  uninstall stopping on the first missing gem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26 01:10:50 +00:00
tenderlove 4544b3824c * time.c (strftimev): Make Time#to_s default to US-ASCII encoding but
respect Encoding.default_internal. [ruby-core:39092]
* test/ruby/test_time.rb (class TestTime): Corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25 23:24:33 +00:00
tenderlove 34f6671d68 * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
UTF-8.
* test/psych/test_encoding.rb: test yaml dump encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 21:14:44 +00:00
ngoto 8b8c7fd386 * test/fileutils/test_fileutils.rb (test_chmod_symbol_mode): Solaris
seems to behave the same as FreeBSD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 16:41:12 +00:00
ngoto 073f94e24f * test/ruby/test_rubyoptions.rb (test_script_from_stdin): slave pty
should be manipulated because master pty may not be a tty on some
  environment (e.g. Solaris). [Bug:#5222] [ruby-dev:44420]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 16:23:23 +00:00
ko1 4f03f0cb67 * insns.def (defined): fix to checking class variable.
A patch by Magnus Holm <judofyr@gmail.com>.  Thanks!
* test/ruby/test_variable.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 00:52:04 +00:00
drbrain 61920a128a * lib/rdoc: Update to RDoc 3.9.3. Fixes RDoc with `ruby -Ku`. Allows
HTTPS image paths to be turned into <img> tags.  Prevents special
  markup inside <tt> from being processed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 23:53:49 +00:00
drbrain cede48fd40 * lib/rubygems: Update to RubyGems 1.8.9. Fixes uninstalling multiple
gems and gem cleanup.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 22:58:06 +00:00
ryan d1919daa42 fixed tests broken by new minitest mixin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 22:34:13 +00:00
ryan 2c43b9664b Imported minitest 2.5.0 (r6557)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 21:47:25 +00:00
mame 54163e2b52 * thread.c (update_coverage): skip coverage count up if the current
line is out of the way.  rb_sourceline() is unreliable when source
  code is big.  [ruby-dev:44413]

* test/coverage/test_coverage.rb: add a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 15:44:26 +00:00
nahi e3e985064a * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
gzip header is readable to avoid SEGV.

* test/zlib/test_zlib.rb (test_corrupted_header): Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 02:36:13 +00:00
ktsj 5cb16a55f5 * iseq.c (iseq_s_disasm): fix a bug that may cause SEGV.
* test/ruby/test_method.rb (test_body): add a test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-20 04:26:20 +00:00
nobu dcb7cc1a8b * ext/stringio/stringio.c (strio_read): return new string if nil
is explicitly given as a buffer ([Bug #5207]), otherwise set the
  encoding.  also removed dead code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-20 01:43:26 +00:00
shugo 2bd37c7183 * lib/net/imap.rb (idle): raises a Net::IMAP::Error when the
connection is closed.  based on the patch by Hugo Barauna.
  [Bug #5190] [ruby-core:38930]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-19 05:16:20 +00:00
shugo 28b5db007f * lib/net/imap.rb (msg_att): accepts extra space before ')'.
based on the patch by art lussos.  [Bug #5163] [ruby-core:38820]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-19 02:32:59 +00:00
mrkn 4e8d6c105c Merge branch '5172_bigdecimal_gc_issue' into trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17 06:35:21 +00:00
mrkn b30d203fed * rational.c (nurat_coerce): Rational#coerce should converts itself
into Complex if the argument is a Complex with non-zero imaginary
  part.  [Bug #5020] [ruby-dev:44088]
* test/ruby/test_rational.rb (test_coerce): test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17 01:24:22 +00:00
emboss 1be5789eed * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
* test/openssl/test_ssl.rb: Add a test for it.
  Thanks to Eric Wong for the patch.
  [Ruby 1.9 - Feature #5183] [ruby-core:38911]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-15 01:10:26 +00:00
akr 4db0c519f5 * test/socket/test_socket.rb (test_connect_timeout): added a test
based on a patch by Eric Wong.  [ruby-core:38910]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 20:58:11 +00:00
tadf c67712ef63 * test/date/test_*.rb: added tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:41:10 +00:00
tenderlove 5339bbe2dc * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
[ruby-core:38913]
* test/psych/test_yaml.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:27:44 +00:00
drbrain 5caef67a6f * lib/rake: Update to Rake 0.9.2.2. Prevent pollution of toplevel
namespace by Commands.  Remove unused variable and debugging
  statement in tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-12 16:56:48 +00:00
drbrain 73f0448e98 * lib/rdoc: Import RDoc 3.9.2. Fixes TIDYLINK for HTML output.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-11 18:31:49 +00:00
mrkn 2e2fabc433 * complex.c (nucomp_rationalize): calls rationalize of real part if
imaginary part is exactly zero.  The patch is made by Marc-Andre
  Lafortune.  fixes [Bug #5178] [ruby-core:38885]
* test/ruby/test_complex.rb (test_rationalize): add a test for the
  above change.
* complex.c (nucomp_to_r): fix RDoc comment.  The patch is made by
  Marc-Andre Lafortune.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-10 10:35:08 +00:00
ngoto 321be14fe7 * test/fiddle/helper.rb (libc_so, libm_so): Solaris support added.
* test/dl/test_base.rb (libc_so, libm_so): on Solaris, remove libc
  and libm version numbers for detecting default libc and libm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 03:36:18 +00:00
kosaki f2f14f572d * time.c (rb_strftime_alloc): raise ERANGE if width is too large.
Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285]

* test/ruby/test_time.rb (class TestTime): add a test for the
  above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-07 14:38:17 +00:00
knu 39eea54cfe * test/test_syslog.rb (TestSyslog#test_log): Do not be too
specific about the log line format.  Fixes #5081.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 08:26:42 +00:00
nobu 1ded4dbd11 * test/ruby/test_object.rb: tests that respond_to? returns false.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 06:55:36 +00:00
shugo c3a750ebee * lib/xmlrpc/client.rb, lib/xmlrpc/server.rb: should use
String#bytesize instead of String#size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 04:35:28 +00:00
nobu 55148a2501 * vm_eval.c (check_funcall): try respond_to? first if redefined.
[Bug #5158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 03:18:25 +00:00
drbrain 3434676e9e * lib/rubygems: Import RubyGems 1.8.7:
Added missing require for `gem uninstall --format-executable`.

	  The correct name of the executable being uninstalled is now displayed
	  with --format-executable.

	  Fixed `gem unpack uninstalled_gem` default version picker.

	  RubyGems no longer claims a nonexistent gem can be uninstalled.

	  `gem which` no longer claims directories are requirable files.

	  `gem cleanup` continues cleaning up gems if one can't be uninstalled
	  due to permissions.  Issue #82.

	  Gem repository directories are no longer created world-writable.
	  Patch by Sakuro OZAWA.  [Ruby 1.9 - Bug #4930]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 01:00:01 +00:00
nobu 5fd10124aa * test/io/console/test_io_console.rb (test_noctty): daemon() on
OpenBSD seems not to detach the controlling terminal, when the
  argument noclose is non-zero.  ref: [Bug #5135]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04 22:00:36 +00:00
nahi c8c02c9cc3 Cosmetic change of Hash literal.
'BindAddress: var' => ':BindAddress => var' according to other configurations.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 15:38:44 +00:00
usa f9e9eee677 * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
[Bug #5153] [ruby-core:38736]

* io.c (argf_next_argv): remove the call of above function.

* ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
  extension module because this is only for testsing ruby_add_suffix().

* LEGAL: remove the mention about a part of util.c, because now we
  removed the part.

* io.c (argf_next_argv): now the new filename is not guranteed to
  use, so should check the return value of rename(2).

* test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
  now we expect same result with other platforms on no_safe_rename
  platforms (=Windows).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 07:10:56 +00:00
shyouhei deb0024af1 * test/xmlrpc/webrick_testing.rb (WEBrick_Testing#start_server):
Like r32795, bind address should be specified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 00:22:08 +00:00
nobu a0b9f48674 * encoding.c (enc_find): mistakenly remained !. [Bug #5150]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02 22:46:34 +00:00
sorah 9864da84f6 * test/testunit/test_parallel.rb: pass "--ruby" option to
test/testunit/tests_for_parallel/runner.rb. [Bug #5132] [ruby-dev:44303]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02 11:18:58 +00:00
nobu 86bbfdadf3 * hash.c (recursive_hash): hash value of emptied hash should be
equal to an empty hash.  [ruby-core:38650]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02 03:03:18 +00:00
nobu 48fd404ffe * parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02 02:42:17 +00:00
shyouhei fa25f26095 * test/net/http/test_http.rb (TestNetHTTP_version_1_1_methods#test_timeout_during_HTTP_session):
If you connect to localhost, you should listen localhost.

* test/net/http/test_https.rb (TestNetHTTPS#test_timeout_during_SSL_handshake):
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 22:35:05 +00:00
luislavena 9e49d29e08 Correct RubyGems bin check on Windows. Bug #5111
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 21:22:13 +00:00
usa b8d546db64 * test/ruby/test_process.rb (TestProcess#windows?): new method.
* test/ruby/test_process.rb (TestProcess#*): use above method.

* test/ruby/test_process.rb (TestProcess#test_execopts_redirect):
  windows doesn't support FD_CLOEXEC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 11:23:44 +00:00
drbrain f209dc7242 * test/rake/test_rake_functional.rb: Don't assume the binary name of
ruby is "ruby".  [Ruby 1.9 - Bug #5114]
	* test/rake/helper.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 06:45:43 +00:00
shyouhei 6851f29bb7 * test/io/console/test_io_console.rb (TestIO_Console#test_sync):
Skip when PTY allocation failed (that's not our failt).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 06:36:09 +00:00
shyouhei 3237f7dc9a * test/xmlrpc/test_webrick_server.rb (Test_Webrick#setup_http_server):
XMLRPC::Client.new3(), when called without host: argument, tries
  to  connect to  a host  where "localhost"  resolves to.   On the
  other  hand  a  WEBrick::HTTPServer.new(), when  called  without
  BindAddress:  argument, tries  to listen  all the  address where
  getaddrinfo(AF_UNSPEC) resolves to.   This is a mismatch because
  "localhost" might not resolve to one of those listening sockets.
  We  would  better explicitly  specify  "localhost"  here and  if
  failed, just skip the whole test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 06:22:05 +00:00
drbrain a429cafc4d * lib/rdoc.rb: Import RDoc 3.9.1. Fixes bugs in the RDoc::Markup
parser.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-01 05:25:13 +00:00
ktsj 70189a8cfd * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31 02:32:48 +00:00
drbrain 89b601d176 * lib/rdoc: Update to RDoc 3.9. Fixed `ri []`, stopdoc creating an
object reference, nodoc for class aliases, verbatim === lines.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-31 00:19:00 +00:00
mrkn 8a74797f13 * test/bigdecimal/test_bigdecimal.rb (test_version): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30 16:24:35 +00:00
nobu 321346cfa5 * io.c (rb_io_each_byte): rbuf can be refreshed during yield.
[Bug #5119]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30 14:14:46 +00:00
suke 3761e00f87 * test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
* test/win32ole/test_win32ole_variant_outarg.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30 08:36:47 +00:00
nagachika d6ec675236 * test/ruby/test_process.rb (test_rlimit_nofile): fix r32734.
move return statement again.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 13:14:59 +00:00
naruse 18f03623a3 Fix r32731: position of definition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 08:01:45 +00:00
naruse b7c350d963 Run test_popen_fork on FreeBSD because it can run.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 07:17:37 +00:00
naruse 0a4a5b20db Use setrlimit(NOFILE,1) on OpenBSD.
Because on OpenBSD it freezes if limit=0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-29 07:17:35 +00:00
nahi e7e87b3c4e * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible
SEGV from AES encryption/decryption. Processing data by
  Cipher#update without initializing key (meaningless usage of Cipher
  object since we don't offer a way to export a key) could cause SEGV.

  In OpenSSL, the EVP which has EVP_CIPH_RAND_KEY flag (such as DES3) 
  allows uninitialized key, but other EVPs (such as AES) does not
  allow it. Calling EVP_CipherUpdate() without initializing key causes
  SEGV so we set the data filled with "\0" as the key by default. See
  #2768.

* test/openssl/test_cipher.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 13:48:05 +00:00
nobu eda13c7ee2 * ext/dl/cptr.c (rb_dlptr_aref, rb_dlptr_aset): check NULL pointer
dereference.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:32:52 +00:00
seki e2b800113c the code that depends on timing. [Bug #372] [Bug #4160]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 03:25:55 +00:00
nobu 9f3914aba6 * ext/dl/cfunc.c (dlcfunc_mark), ext/dl/cptr.c (dlptr_mark):
workaround to mark wrapped object.  this is not a true fix,
  because [Bug #4929] is caused by the interface design of DL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 17:15:09 +00:00
nobu 5c815b733d * test/ruby/test_symbol.rb (test_no_inadvertent_symbol_creation):
remove an assertion depending on default respond_to_missing?.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 16:18:54 +00:00
nobu a99ef20400 * test/ruby/test_symbol.rb (test_no_inadvertent_symbol_creation3):
remove an assertion depending on default const_missing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 15:52:23 +00:00
naruse d7138d72db * test/fileutils/test_fileutils.rb: add OpenBSD case.
patched by Jeremy Evans [ruby-core:38530] see #5097

* test/ruby/test_process.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 15:30:11 +00:00
nobu 969ae329ee * test/ruby/test_symbol.rb (test_inspect): use %W to enable
escape.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 14:55:40 +00:00
nagachika dddc9485da * test/rinda/test_rinda.rb (test_remote_array_and_hash):
add local variables to protect objects from GC. [ruby-dev:44253]
  [Bug #5104]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 13:49:43 +00:00
naruse e29d58970b Use ::Syck explicitly.
lib/rubygems/requirement.rb defines YAML::Syck.
So explicitly specify the top level one.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 05:21:33 +00:00
drbrain 55b81eb9e6 * lib/rubygems/uninstaller.rb: Add missing require and update
messaging to avoid confusion with uninstall --format-executable.
	  [Ruby 1.9 - Bug #4062]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 03:33:45 +00:00
nobu c553ee2db8 * test/ruby/test_symbol.rb (TestSymbol#test_inspect): workaround for
ruby-mode.el.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 02:04:39 +00:00
drbrain 035ef0a347 * lib/rubygems: Update to RubyGems 1.8.6.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 01:40:07 +00:00
emboss b9c485aa0d * test/openssl/test_pkcs12.rb: Add test and intermediate certificates.
[ Ruby 1.9 - Feature #3793 ] [ruby-core:32088]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 00:31:43 +00:00
nobu 8603c5934a * eval_error.c (rb_print_undef_str): new function to raise
NameError for undefined method.
* load.c (rb_mod_autoload_p), object.c (rb_mod_const_get),
  variable.c (rb_f_untrace_var, set_const_visibility), vm_method.c
  (rb_mod_{remove,undef,alias}_method, set_method_visibility):
  remove inadvertent symbol creation.  based on the first patch by
  Jeremy Evans at [ruby-core:38447].  [Feature #5089]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 16:05:35 +00:00
nobu 298349d03b * vm_method.c (obj_respond_to): fix the respond_to_missing? override
case.  based on the patch by Jeremy Evans at [ruby-core:38417].
  [Feature #5072]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 16:05:30 +00:00
mrkn dca0b41777 * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
zero or negative precision is error.  fixes #5098.
  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:49:47 +00:00
mrkn 079fb8d4c3 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
specifying precision.  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:48:25 +00:00
mrkn 2fcb91c74c * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
for symmetry to BigDecimal() function with an Integer.
  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:46:42 +00:00
mrkn 5ba05758fe * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
for adapting other Numeric subclasses.  [ruby-dev:44245]
* test/bigdecimal/test_bigdecimal_util.rb: test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:40:27 +00:00
mrkn a238140726 * bigdecimal/bigdecimal.c (VpDup) a new function for duplicating
a BigDecimal.

* bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
  BigDecimal from another BigDecimal using BigDecimal global function
  or constructor.  [ruby-dev:44245]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:40:23 +00:00
usa 71ff558ed0 * test/rake/test_rake_directory_task.rb (TestRakeDirectoryTask#
test_directory_win32): fixed wrong test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 14:40:19 +00:00
nahi f23ad92a95 * forgot to add a test fixture file in r32666.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 13:23:45 +00:00
nahi 2fff0f4f71 * lib/xmlrpc/client.rb: Fix possible HTTP header formatting failure by
'Basic' header. Long username caused the base64 String truncation in
  HTTP header which is not allowed. See #5046.

* test/xmlrpc/test_webrick_server.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 13:21:49 +00:00
drbrain 6b3ec75c7f * lib/rubygems/specification.rb: Restore behavior of
Gem::Specification#loaded.  [Ruby 1.9 - Bug #5032]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 16:05:19 +00:00
nobu 4dc1a21809 * error.c (rb_name_error_str): new function to raise NameError
with the name string but not ID.
* object.c, proc.c, variable.c: more removal of inadvertent symbol
  creation.  [Feature #5079]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 15:05:03 +00:00
naruse fe4ceb25b9 * test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
directory. Current directory is not the top source directory when
  the building process runs on other than there.

* test/rake/test_rake_rake_test_loader.rb: ditto.

* test/rake/test_rake_task_argument_parsing.rb
  (test_terminal_width_using_hardcoded_80): hardcoded 80 is used
  when app.unix? is false.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 11:21:55 +00:00
suke e845e35fa3 * test/win32ole/test_err_in_callback.rb (test_err_in_callback):
skip test if ADODB.connection is not available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 10:13:53 +00:00
naruse 65658ea0d4 * parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
valid symbols, so they should be inspected with quotes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 10:03:30 +00:00
drbrain c93ed570a2 * test/rake*: Remove dependencies on flexmock and session gems.
[Ruby 1.9 - Bug #4987]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 05:38:50 +00:00
nobu d9242d5966 * parse.y (rb_check_id): conversion condition was inverse.
[Bug #5084]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 03:12:28 +00:00
nobu 34918aa832 * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
avoid inadvertent symbol creation in reflection methods.  based
  on a patch by Jeremy Evans at [ruby-core:38367].  [Feature #5072]
* vm_method.c (rb_mod_method_defined)
  (rb_mod_{public,private,protected}_method_defined)
  (obj_respond_to): ditto.
* parse.y (rb_check_id): new function returns already interned ID
  or 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 12:06:42 +00:00
kazu b8a1e15ef1 * test/ruby/test_object.rb (TestObject#test_respond_to_missing):
2nd argument of respond_to_missing? is not optional.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 11:37:06 +00:00
emboss 84e835fe4a * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference.
* test/openssl/test_engine.rb: Add a test for it.
  Thanks to Ippei Obayashi for providing the patch.
  [ Ruby 1.9 - Bug #5062 ] [ruby-dev:44173]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 00:13:07 +00:00
marcandre 616cae1090 * lib/csv.rb: Do not modify CSV.generate's argument [ruby-core:38356]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21 21:37:43 +00:00
mame 9752864b88 * thread.c (set_trace_func, thread_set_trace_func_m): reset tracing
state when set_trace_func hook is removed.  This is workaround patch
  to force to reset tracing state that is broken by continuation call.
  a patch from James M. Lawrence.  [Feature #4347] [ruby-core:34998]

* test/ruby/test_continuation.rb (class TestContinuation): add a test
  for above.  a patch from James M. Lawrence.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21 11:09:52 +00:00
naruse 2dfc9e1626 * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):
Allow HTTP/0.9 request which doesn't has any header or body.
  patched by Felix Jodoin. [ruby-core:38040] [Bug #5022]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-21 08:27:08 +00:00
naruse 4aa9e1ace0 Add test for r32586.
FreeBSD (at least 7.2 to 7.2) calls nsdispatch(3) when it calls
getaddrinfo(3). And nsdispatch(3) doesn't call dlerror(3) even if
it calls _nss_cache_cycle_prevention_function with dlsym(3).
So our DL::Handle#sym must call dlerror(3) before call dlsym.
In general uses of dlerror(3) should call it before use it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 15:20:14 +00:00
tenderlove dc22968239 * ext/psych/lib/psych.rb: define a new BadAlias error class.
* ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
  deserializing an alias that does not exist.
* test/psych/test_merge_keys.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-18 04:38:37 +00:00
nobu e2fd80b3d3 * error.c (rb_check_trusted): new function to check an object is
trusted.
* struct.c (rb_struct_modify), time.c (time_modify): check by the
  above function to show proper class names.  [Bug #5036]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 07:26:45 +00:00
nobu 18f0a65018 * error.c (rb_warn_m): accept multiple args in like puts. rdoc
patch by Erik Price at [ruby-core:38119].  [Feature #5029]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 06:30:10 +00:00
nobu 1297cc615c * test/ruby/test_module.rb (TestModule#test_method_{undefined,removed}):
tests for method_undefined and method_removed.  Bug#5015

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 03:17:17 +00:00
emboss f8a538495e * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS
extensions. Use this as the default for the tests to ensure
  compatibility with OpenSSL 0.9.7.
  [ Ruby 1.9 - Bug #4961 ] [ruby-core:37726]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-16 23:02:42 +00:00
kosaki 6270ce85ed * time.c (time_dup): used rb_obj_class() instead of CLASS_OF().
The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071]

* test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass):
  added a new test for eigenclass of time object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 16:06:53 +00:00
nahi e56f2abe4b * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
Error caused by unalignment access on Sparc-Solaris (and possibly on
  other similar environment.) This patch just do memcpy always instead
  of checking architecture. I see no perf drop on my 64bit env. For
  more details, see #4320.

* test/digest/test_digest.rb: add test for unalignment access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 03:03:31 +00:00
nahi ab86f1cffb * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from
verify callback of SSLContext and X509Store and make the 
  verification fail normally. Raising exception directly from callback
  causes orphan resouces in OpenSSL stack. Patched by Ippei Obayashi. 
  See #4445.

* test/openssl/test_ssl.rb
  (test_exception_in_verify_callback_is_ignored): test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-14 05:41:05 +00:00
kosaki 55b3bfbc4c * signal.c (reserved_signal_p): reverted a part of r32523.
chikanaga noticed trap(:CHLD) has some realworld usecase.
* test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
  ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 11:04:58 +00:00
kosaki 89e2951bde * signal.c (sig_trap): don't permit to change a signal handler which
the interpreter reserved.
* signal.c (reserved_signal_p): ditto.
  [Bug #2616] [ruby-core:27625]

* test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
  added a test for reserved signal.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 04:55:50 +00:00
mrkn 99f8f14d89 * ext/bigdecimal/bigdecimal.c (rmpd_power_by_big_decimal): fix
precision treatment errors.
* test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
  fix precision treatment errors.
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument
  should be optional for its compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 14:05:07 +00:00
nobu 577c03c713 * parse.y (var_ref): distinguish vcall from local variable
references.  based on a patch by Michael Edgar michael.j.edgar
  AT dartmouth.edu.  Bug #5002

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 13:38:17 +00:00