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

5919 Коммитов

Автор SHA1 Сообщение Дата
mrkn 5385ae9af4 * rational.c (numeric_quo): move num_quo in numeric.c to numeric_quo
in rational.c to refer canonicalization state for mathn support.
  [ruby-core:41575] [Bug #5736]

* numeric.c (num_quo): ditto.

* test/test_mathn.rb: add a test for the change at r41109.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 02:50:32 +00:00
akr e0bb10be50 Fix the class name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 23:05:27 +00:00
akr c9c67d2fe0 * bignum.c (rb_int_import): New function.
(int_import_push_bits): Ditto.

* internal.h (rb_int_import): Declared.

* pack.c (pack_unpack): Use rb_int_import for BER compressed integer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 21:20:04 +00:00
mrkn 7708560bb1 * numeric.c (num_quo): Use to_r method to convert the receiver to
rational.  [ruby-core:41575] [Bug #5736]

* test/ruby/test_numeric.rb: add a test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 13:31:22 +00:00
akr 9fea8758e9 * configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
  with RUBY_REPLACE_TYPE.

* internal.h (rb_absint_size): Declared.
  (rb_absint_size_in_word): Ditto.
  (rb_int_export): Ditto.

* bignum.c (rb_absint_size): New function.
  (rb_absint_size_in_word): Ditto.
  (int_export_fill_dd): Ditto.
  (int_export_take_lowbits): Ditto.
  (rb_int_export): Ditto.

* pack.c (pack_pack): Use rb_int_export for BER compressed integer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 11:57:35 +00:00
mrkn febc42d05c * numeric.c (num_quo): should return a Float for a Float argument.
[ruby-dev:44710] [Bug #5515]

* test/ruby/test_fixnum.rb: Add an assertion for the above change.

* test/ruby/test_bignum.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 01:04:11 +00:00
knu 91538a3882 * string.c (String#b): Allow code range scan to happen later so
ascii_only? on a result string returns the correct value.
  [ruby-core:55315] [Bug #8496]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 15:05:48 +00:00
shugo 61b8250adc * lib/net/imap.rb (capability_response): should ignore trailing
spaces.  Thanks, Peter Kovacs.  [ruby-core:55024] [Bug #8415]

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 13:44:17 +00:00
kazu 4a97761c1a add description of test in comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 11:53:02 +00:00
naruse 0094cd8c64 * test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
EACCES for Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-05 00:48:24 +00:00
tadf 551bcc6364 * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reported
by Riley Lynch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 22:09:36 +00:00
drbrain 091c24d51b * lib/rubygems: Update to RubyGems 2.0.3
* test/rubygems:  Tests for the above.
* NEWS:  Added RubyGems 2.0.3 note.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 21:54:58 +00:00
mrkn 1699396fe5 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
of figures.  Patch by Vipul A M <vipulnsward@gmail.com>.
  https://github.com/ruby/ruby/pull/323  fix GH-323

* test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 06:37:44 +00:00
kazu 5be4642395 add EEXIST for Linux
* test/fileutils/test_fileutils.rb (TestFileUtils#test_mkdir): add
  EEXIST for Linux. (suggested by nurse)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 15:46:29 +00:00
kazu 1739ecda3b FileUtils.rmdir use remove_tailing_slash
* lib/fileutils.rb (FileUtils.rmdir): use remove_tailing_slash.
* test/fileutils/test_fileutils.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 15:01:42 +00:00
ayumin cef3f2ebd4 * lib/fileutils.rb: fix behavior when mkdir/mkdir_p accepted "/".
* test/fileutils/test_fileutils.rb: add test for above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-03 14:20:15 +00:00
naruse 284d746392 * vm_insnhelper.c (vm_yield_setup_block_args): partially revert r41019.
The code is not useless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 18:44:33 +00:00
ayumin 233f7d09e3 * test/socket/test_sockopt.rb: change test name. follow r41037.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 16:37:14 +00:00
ayumin 260f6bed23 * test/rinda/test_rinda.rb: rename functions introduced in r41009.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 16:15:51 +00:00
naruse aa26e9d9c0 follow r41034
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 15:59:18 +00:00
naruse dffcadb4ea Suppress warnings: setting Encoding.default_internal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 14:46:43 +00:00
ktsj 166d8dc2d6 * enc/trans/japanese_euc.trans, test/ruby/test_transcode.rb,
tool/transcode-tblgen.rb: change EUC-JP-2004 to EUC-JIS-2004.
  This is follow up to changes in r41024.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 14:36:41 +00:00
knu 6bdfe415df * lib/set.rb (Set#freeze, taint, untaint): Save a "self" by
utilizing super returning self, and add tests while at it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01 09:01:16 +00:00
nobu 4a223fb67f compile.c: not simple if keyword args
* compile.c (iseq_set_arguments): not a simple single argument if any
  keyword arguments exist.  [ruby-core:55203] [Bug #8463]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01 08:25:05 +00:00
nobu 06c7ede259 vm_insnhelper.c: extract keyword arguments after splat
* vm_insnhelper.c (vm_yield_setup_block_args): split single parameter
  if any keyword arguments exist, and then extract keyword arguments.
  [ruby-core:55203] [Bug #8463]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01 08:21:39 +00:00
nobu aa8cc01aa3 zlib.c: check EOF
* ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
  (gzreader_gets): check EOF.  [ruby-core:55220] [Bug #8467]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 23:00:48 +00:00
naruse 984a34bc3f Use custom methods for values whose type is different on platforms
Use Socket::Option#ip_multicast_loop and Socket::Option#ip_multicast_ttl
instead of Socket::Option#int because NetBSD's size is byte though
others' is int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 18:21:00 +00:00
naruse a78e45b5fe * ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
whose value's is byte.

* ext/socket/option.c (sockopt_byte): getter for above.

* ext/socket/option.c (inspect_byte): inspect for above.

* ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of
  the sockopt whose optname is IP_MULTICAST_LOOP.

* ext/socket/option.c (sockopt_ip_multicast_loop): getter for above.

* ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of
  the sockopt whose optname is IP_MULTICAST_TTL.

* ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above.

* ext/socket/option.c (sockopt_inspect): use above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 17:37:55 +00:00
mame 6f9f8d2ef7 * vm_insnhelper.c (vm_callee_setup_keyword_arg,
vm_callee_setup_arg_complex): consider a hash argument for keyword
  only when the number of arguments is more than the expected
  mandatory parameters.  [ruby-core:53199] [ruby-trunk - Bug #8040]

* test/ruby/test_keyword.rb: update a test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-30 10:50:41 +00:00
naruse f85733a7ce GC before running test_copy_stream_socket7
it sometimes occurs NoMemoryError
http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130529T033302Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-29 04:38:38 +00:00
ko1 7453c53b08 * ext/objspace/object_tracing.c: fix a bug reported at
"[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head"
  Care about the case TracePoint#path #=> `nil'.
* ext/objspace/object_tracing.c: add two new methods:
* ObjectSpace.allocation_class_path(o)
* ObjectSpace.allocation_method_id(o)
  They are not useful for Object.new because they are always
  "Class" and :new.
  To trace more useful information, we need to maintain call-tree
  using call/return hooks, which is implemented by
  ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof>
* test/objspace/test_objspace.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 03:36:34 +00:00
ko1 c180e0d880 * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
* ext/-test-/postponed_job/postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 17:08:25 +00:00
nobu f79ddbebe3 test_method.rb: fix for direct invocation
* test/ruby/test_method.rb (TestMethod#test___dir__): use aboslute
  path for the case invoked directly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 16:48:18 +00:00
ko1 e4c58251b7 * include/ruby/ruby.h, gc.c: add new internal event
RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
  after_sweep().
  Time chart with lazy sweep is here:
  (1) Kick RUBY_INTERNAL_EVENT_GC_START
  (2) [gc_marks()]
  (3) [lazy_sweep()]
  (4) [... run Ruby program (mutator) with lazy_sweep() ...]
  (5) [after_sweep()]
  (6) Kick RUBY_INTERNAL_EVENT_GC_END
  (7) [... run Ruby program (mutator), and go to (1) ...]
* ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: modify a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 15:40:27 +00:00
ko1 050dd10d6f * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
Read the following test to know HOWTO.
  This feature is a sample of RUBY_INTERNAL_EVENT.
* test/objspace/test_objspace.rb: add a test.
* ext/objspace/object_tracing.c: ditto.
* gc.c (rb_gc_count): add. THis function returns GC count.
* internal.h: add decl. of rb_gc_count(). Same as `GC.count'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 10:01:45 +00:00
nobu 696d3046d1 * append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 02:16:00 +00:00
ko1 662cbf22fa * test/-ext-/postponed_job/test_postponed_job.rb: fix typo and class name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 00:24:23 +00:00
ko1 680f0b5ba4 * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.
* RUBY_INTERNAL_EVENT_NEWOBJ: object created.
* RUBY_INTERNAL_EVENT_FREE: object freeed.
* RUBY_INTERNAL_EVENT_GC_START: GC started.
  And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'.
  Internal events can not invoke any Ruby program because the tracing
  timing may be critical (under huge restriction).
  These events can be hooked only by C-extensions.
  We recommend to use rb_potponed_job_register() API to call Ruby
  program safely.
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-12
  [Feature #8107]
* include/ruby/debug.h, vm_trace.c: added two new APIs.
* rb_tracearg_event_flag() returns rb_event_flag_t of this event.
* rb_tracearg_object() returns created/freeed object.
* ext/-test-/tracepoint/extconf.rb,
  ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 00:21:02 +00:00
nobu 7f4d09d6a6 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 21:31:05 +00:00
ko1 e2793a908e * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.
Postponed jobs are registered with this API. Registered jobs
  are invoked at `ruby-running-safe-point' as soon as possible.
  This timing is completely same as finalizer timing.
  There are two APIs:
* rb_postponed_job_register(flags, func, data): register a
  postponed job with data. flags are reserved.
* rb_postponed_job_register_one(flags, func, data): same as
  `rb_postponed_job_register', but only one `func' job is
  registered (skip if `func' is already registered).
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-15
  [Feature #8107]
* gc.c: use postponed job API for finalizer.
* common.mk: add dependency from vm_trace.c to debug.h.
* ext/-test-/postponed_job/extconf.rb, postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.
* thread.c: implement postponed API.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 21:30:44 +00:00
ktsj 9421b18662 * test/fiddle/test_handle.rb (Fiddle::TestHandle#test_static_sym): adjust indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 14:29:05 +00:00
ktsj 1dafd4ebf1 * test/fiddle/test_c_struct_entry.rb,
test/fiddle/test_c_union_entity.rb,
  test/fiddle/test_cparser.rb, test/fiddle/test_func.rb,
  test/fiddle/test_handle.rb, test/fiddle/test_import.rb,
  test/fiddle/test_pointer.rb: don't run test if the system
  don't support fiddle.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 14:29:02 +00:00
mame a0b3e03202 * dir.c (bracket): fix copy-paste error. When the first and last
characters of fnmatch range have different length, fnmatch may
  have wrongly matched a path that does not really match.
  Coverity Scan found this bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25 09:32:47 +00:00
charliesome 9885529986 * variable.c (set_const_visibility): use rb_frame_this_func() instead
of rb_frame_callee() for getting the name of the called method

* test/ruby/test_module.rb: add test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 10:33:05 +00:00
naruse c43dd625b6 * ext/strscan/strscan.c (strscan_aref): raise error if given
name reference is not found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24 07:32:45 +00:00
nobu ec04fecda5 * test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): HFS+ seems
not supporting a sparce file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23 03:00:52 +00:00
nobu ded54cb860 test_io.rb: test for write
* test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): add test
  for write part.  [ruby-core:55098] [Bug #8431]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23 02:14:07 +00:00
naruse 7a32434fb6 Fix test failure of binmode from r40879
http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130521T131601Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-22 10:36:28 +00:00
nobu a815b56d84 win32.c: check error of SetFilePointer
* win32/win32.c (setup_overlapped): check the error code in addition
  to the result of SetFilePointer() to determine if an error occurred,
  because INVALID_SET_FILE_POINTER is a valid value.
  [ruby-core:55098] [Bug #8431]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-22 06:19:03 +00:00
naruse ecd5bbe82a * ext/strscan/strscan.c (strscan_aref): support named captures.
patched by Konstantin Haase [ruby-core:54664] [Feature #8343]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-21 13:48:57 +00:00