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

4760 Коммитов

Автор SHA1 Сообщение Дата
naruse 4ed06c9cb7 Use assert_normal_exit to avoid stack on buggy implementations.
fix for r36492.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-22 16:48:49 +00:00
naruse ee755e2ce9 * thread.c (rb_threadptr_execute_interrupts_common): increase
running_time_us on THREAD_TO_KILL like on THREAD_RUNNABLE.
  This cause not to siwtch from a thread which is to be killed
  on FreeBSD and Mac OS X. see also the test.
  This issue maybe exist for long time but happens after r36430.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-22 15:04:11 +00:00
naruse 478d37da05 Use 0 for webrick's port and get the actual port. [Bug #6766]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-21 19:07:28 +00:00
naruse 07a6d0e9d1 * lib/net/http.rb (Net::HTTP.newobj): return back for compatibility.
* lib/net/http.rb (Net::HTTP.new): set default_port if proxy port is
  not given.

* lib/net/http.rb (Net::HTTP#initialize): ditto.

* lib/net/http.rb (Net::HTTP#proxy?): return true or false.

* lib/net/http.rb (Net::HTTP#proxy_address): check proxy_uri is not nil.

* lib/net/http.rb (Net::HTTP#proxy_port): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-21 15:45:10 +00:00
sorah 7773a911f5 * lib/test/unit.rb: warn when test_* method is redefined.
Patch by mame (Yusuke Endoh). [Feature #2643] [ruby-core:27790]

* test/testunit/test_redefinition.rb: Test for above.

* test/testunit/test4test_redefinition.rb: Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-21 05:12:32 +00:00
nobu cfb55acaa7 test_array.rb: refine assertions
* test/ruby/test_array.rb: refine assertions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 07:09:22 +00:00
drbrain 9416becda4 * lib/net/http.rb: Net::HTTP now automatically detects and uses
proxies from the environment.  A proxy may also be specified as
  before.

  Net::HTTP::Proxy still creates anonymous classes, but these classes
  are only used to store configuration information.  When an HTTP
  instance is created the configuration is now copied.

  Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP

  [Feature #6546]
* lib/open-uri.rb:  Moved URI::Generic#find_proxy to uri/generic.
* lib/uri/generic.rb:  Imported find_proxy from open-uri.
* test/open-uri/test_open-uri.rb:  Moved proxy-discovery tests to URI.
* test/uri/test_generic.rb:  Imported proxy-discovery tests from
  open-uri.
* test/net/http/test_http.rb:  Added tests for proxy behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 01:56:21 +00:00
drbrain f35b1d0633 * test/socket/test_socket.rb: Ignore IPv6 unique local addresses on OS
X (iCloud Back to my Mac addresses) for test_udp_socket since they do
  not act as loopback addresses.  [Bug #6692]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 00:40:48 +00:00
drbrain 3efea48a70 * ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Added
Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local
  addresses.  Part of #6692
* ext/socket/rubysocket.h:  Add IN6_IS_ADDR_UNIQUE_LOCAL macro if
  missing.
* test/socket/test_addrinfo.rb:  Test for ipv6_unqiue_local?


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 00:32:35 +00:00
drbrain b1a0509b54 * lib/net/http/response.rb: Automatically inflate gzip and
deflate-encoded response bodies.  [Feature #6942]
* lib/net/http/generic_request.rb:  Automatically accept gzip and
  deflate content-encoding for requests.  [Feature #6494]
* lib/net/http/request.rb:  Updated documentation for #6494.
* lib/net/http.rb:  Updated documentation for #6492 and #6494, removed
  Content-Encoding handling now present in Net::HTTPResponse.
* test/net/http/test_httpresponse.rb:  Tests for #6492
* test/net/http/test_http_request.rb:  Tests for #6494
* test/open-uri/test_open-uri.rb (test_content_encoding):  Updated test
  for automatic content-encoding handling.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 22:43:38 +00:00
ko1 f4a8db647a * thread.c (rb_thread_s_control_interrupt,
rb_thread_s_check_interrupt): added for
  Thread.control_intgerrupt and Thread.check_interrupt.
  See details on rdoc.
  I'll make an ticket for this feature.
* test/ruby/test_thread.rb: add a test for Thread.control_intgerrupt.
* thread.c (rb_threadptr_raise): make a new exception object
  even if argc is 0.
* thread.c (rb_thread_kill): kill thread immediately if target thread
  is current thread.
* vm_core.h (RUBY_VM_CHECK_INTS_BLOCKING): added.
  CHECK_INTS while/after blocking operation.
* vm_core.h (RUBY_VM_CHECK_INTS): require rb_thread_t ptr.
* cont.c (fiber_switch): use replaced RUBY_VM_CHECK_INTS().
* eval.c (ruby_cleanup): ditto.
* insns.def: ditto.
* process.c (rb_waitpid): ditto.
* vm_eval.c (vm_call0): ditto.
* vm_insnhelper.c (vm_call_method): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 14:19:40 +00:00
akr 422e8d5adc * test/ruby/test_io.rb: remove temporally files early.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 13:47:08 +00:00
akr ff331d1442 suppress fragile warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 12:14:30 +00:00
shugo 1f03c90dbf * variable.c (rb_mod_class_variables): return inherited variables
except when the optional argument is set to false.
  [ruby-dev:44034] [Bug #4971]

* variable.c (rb_mod_constants): fix typo in documentation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 06:41:47 +00:00
nobu 0e60c71038 test_eval.rb: adjust indent
* test/ruby/test_eval.rb (test_instance_eval_{string,block}_basic):
  adjust indent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 06:06:03 +00:00
nobu f58feecd36 test_eval.rb: use block
* test/ruby/test_eval.rb (forall_TYPE): use block.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 06:05:58 +00:00
usa b72fc09537 * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
re-enable the tests because now it's OK on windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-19 04:29:14 +00:00
akr ac80ad663e * test/ruby/test_file.rb: remove temporally files early.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 23:20:45 +00:00
seki 939b0e9c7d fixed: can't delete unix domain sockets problem
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 22:39:28 +00:00
naruse da78490c80 use localhost for both local and remote. [Bug #6746]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 16:48:54 +00:00
akr c96b913ee0 increment @tmp_count.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 15:23:35 +00:00
nobu c0087df044 pack.c: round down too long uuencode width
* pack.c (pack_pack): round down too long uuencode width.  folding
  width in uuencode format cannot be longer than 63 bytes.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 14:57:40 +00:00
nobu 68a01f9cdf test_syntax.rb: update
* test/ruby/test_syntax.rb (test_warn_grouped_expression): update for
  r36434.  [ruby-core:39050][Bug #5214]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 14:20:09 +00:00
akr 5b7b60bb59 * test/ruby/test_beginendblock.rb: remove temporally files early.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 14:09:21 +00:00
akr bc893dcf07 * test/ruby/test_autoload.rb: remove temporally files early.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 13:43:22 +00:00
akr d5e9b69629 * test/ruby/test_argf.rb: use temporally directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 13:00:57 +00:00
akr 4db96fe42c * test/openssl/test_config.rb: remove temporally files early.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 10:42:40 +00:00
shugo bbaf9b2800 * parse.y (primary): allow an empty grouped expression as the
operand of the not operator (e.g., not ()).
  [ruby-core:45976] [Bug #6674]

* parse.y (parser_yylex): show no warning for a grouped expression
  as the operand of the not operator (e.g., not (a)) or as an
  argument of a method call without parentheses (e.g., foo (a)).
  [ruby-core:39050] [Bug #5214]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 07:05:12 +00:00
naruse 39b33658e3 * lib/benchmark.rb: Fix Benchmark.benchmark output with an empty
caption.  patched by Benoit Daloze. [ruby-core:45719] [Bug #6610]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 03:56:58 +00:00
usa 7a514fc6f1 * test/win32ole/test_win32ole_event.rb (TestWIN32OLE_EVENT): use
standard skip method to skip tests.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18 00:36:01 +00:00
xibbar 08f46f0818 Wed Jul 18 08:01:10 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* test/rss/test_dublincore.rb: update test for CGI.escapeHTML.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 23:04:48 +00:00
xibbar c47cca2f85 Wed Jul 18 07:59:29 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* lib/cgi/util.rb (CGI.escapeHTML,unescapeHTML): Add &apos; for HTML5 escaping.
    [Feature #6620]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 23:04:46 +00:00
naruse 85dc1ab23b Add tests for r36415.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 18:08:40 +00:00
ayumin b69f55a673 * lib/open-uri.rb: delete space.
* test/psych/test_alias_and_anchor.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 16:13:10 +00:00
naruse da74f0f426 Support IPv6 address. [Bug #6746]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 08:41:21 +00:00
tenderlove 7d1f53e782 * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
are properly referenced. Patched by Joe Rafaniello via Github:
    https://github.com/tenderlove/psych/pull/69
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/test_alias_and_anchor.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 19:00:59 +00:00
marcandre 43395d53c9 Revert of r36411, as does not distinguish proc from lambda
* proc.c (rb_proc_arity): Fix Proc#arity in case of optional arguments
  [bug #5694] [rubyspec:b8b259] [rubyspec:184c8100f]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 15:28:34 +00:00
marcandre 466f7f6c81 Revert r33924.
* proc.c (rb_proc_arity): Fix Proc#arity in case of optional arguments
  [bug #5694] [rubyspec:b8b259] [rubyspec:184c8100f]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 15:19:03 +00:00
akr 94735e9e54 * bignum.c (rb_big_float_cmp): compare an integer and float precisely.
[ruby-core:31376] [Bug #3589] reported by Tomasz Wegrzanowski.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 09:08:58 +00:00
ayumin d570a76cba * test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 08:15:08 +00:00
nobu 7a6542400d array.c: fill with nil
* array.c (rb_get_values_at): fill with nil out of range.
  [ruby-core:43678] [Bug #6203]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-14 09:18:51 +00:00
nobu 8d6add973e hash.c: raise on invalid input
* hash.c (rb_hash_s_create): raise an exception, when input elements
  are not one or two elements arrays.  [ruby-core:39945] [Bug #5406]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-14 08:08:15 +00:00
nobu d61dfcc793 array.c: no infection by unused separator
* array.c (rb_ary_join): should not infected by separator if it is not
  used.  [ruby-core:42161][Bug #5902]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-14 07:04:28 +00:00
nobu c3521bf631 test: skip default gems
* test/runner.rb: skip default gems to get rid of loading old versions
  before installation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 03:32:28 +00:00
nobu d744433225 rb_str_new_frozen: new object if tainted/untrusted unmatch
* string.c (rb_str_new_frozen): since the result object should have
  same tainted/untrusted bits with the original object, return new
  object if the shared object unmatch.  [ruby-core:39745][Bug #5374]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 02:44:27 +00:00
usa 8cc3fef898 * test/net/http/test_http.rb (TestNetHTTPLocalBind#test_bind_to_local*):
cannot cross between network interfaces on Windows, so skip this test
  until we find better test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 01:48:23 +00:00
naruse 558edd5192 Use IPv4 address on connecting to 127.0.0.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-12 01:27:42 +00:00
ryan 9696b3eb16 Imported minitest 3.2.0 (r7598). Reviewed by drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-11 23:52:04 +00:00
nobu 35784d1019 defined: me in cfp
* insns.def (defined): use method entry and id in cfp for proper
  superclass, since klass in iseq is shared by dynamically defined
  methods from the same block.  [ruby-core:45831][Bug #6644]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-11 20:11:45 +00:00
naruse 4689853711 * lib/net/http.rb (Net::HTTP#connect): use local_host and local_port
if specified. patched by Ricardo Amorim [Feature #6617]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-11 18:37:18 +00:00