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

27941 Коммитов

Автор SHA1 Сообщение Дата
kou a7322e3678 * lib/rexml/parsers/baseparser.rb: Fix a bug that UTF-8 is used
for UTF-16XX encoded XML that doesn't have encoding="UTF-16" in
  XML declration.
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:42:37 +00:00
kou a750424cab * test/rexml/test_document.rb: Group tests that they parse
UTF-16XX encoded XML that has encoding="UTF-16" in XML declaration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:39:37 +00:00
kou 2a42c1bd3a * lib/rexml/source.rb (REXML::IOSource#initialize): Reduce
@line_break initialize code. It should be done only in #encoding=.
* lib/rexml/parsers/baseparser.rb: Don't set UTF-16 encoding to
  source by encoding="UTF-16" in XML declaration because UTF-16XX
  source encoding should be set in Source#initialize or
  IOSource#intialize. They should handle BOM. Parser should not
  consider about it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:31:20 +00:00
kou 100b3be9ae * test/rexml/test_document.rb: Add tests for parsing XML encoded
by UTF-16 with BOM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 12:19:58 +00:00
kou f774c96beb Revert r37358
* lib/rexml/source.rb (REXML::IOSource#initialize): Use
  encode("UTF-16XX") instead of UTF-16XX encoded byte string by
  hand.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 11:20:45 +00:00
kou 054ae037e6 * lib/rexml/source.rb (REXML::IOSource#initialize): Use
encode("UTF-16XX") instead of UTF-16XX encoded byte string by
  hand.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 10:57:01 +00:00
tadf 9f773625e5 * ext/date/date_parse.c (iso8601_{ext,bas}_time): should not match
empty string.
- この行以下は無視されます --

M    ChangeLog
M    ext/date/date_parse.c
M    test/date/test_date_parse.rb


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 10:16:02 +00:00
tadf b4c6d6a3a5 * ext/date/date_parse.c (date__parse): revised the tight parser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 09:53:08 +00:00
kou af83fcfe4d * lib/rexml/document.rb (REXML::Document#write): Add :encoding option
to support custom XML encoding.
  [Feature #4872] (work in progress)
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 06:43:38 +00:00
kou 292c659b5c * lib/rexml/document.rb (REXML::Document#write): Remove needless
indent in document.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 06:01:06 +00:00
kou de2e09e0bc * lib/rexml/document.rb (REXML::Document#write): Accept options
Hash as argument.
* test/rexml/test_document.rb: Add tests for the above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 05:59:59 +00:00
kou 134ded5d77 * lib/rexml/document.rb (REXML::Document#write): Fix wrong usage
in document.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 05:10:07 +00:00
kou 64c4647665 * lib/rexml/document.rb (REXML::Document#write): Fix wrong method
names in document.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 05:05:18 +00:00
tenderlove f8d34b2a75 * ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
same thing on every call.

* test/psych/visitors/test_yaml_tree.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 01:13:09 +00:00
tenderlove dbe6250af2 * ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
be able to take an emitter object as it's output.

* test/psych/visitors/test_yaml_tree.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 01:06:09 +00:00
ko1 f3e5f2cd75 * bignum.c (bignew_1): Bignum instances are frozen.
Feature #3222
* include/ruby/ruby.h: Fixnum instances are also frozen.
* class.c (singleton_class_of): check Bignum before
  singleton cheking.
* test/ruby/test_bignum.rb: add a test.
* test/ruby/test_fixnum.rb: ditto.
* test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb,
  test/ruby/test_object.rb: catch up above changes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 00:03:20 +00:00
ko1 5dc9855a4f vm_insnhelper.c: fix indentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 23:22:10 +00:00
ko1 2731767b5d * vm.c (vm_define_method): remove type and frozen checking.
Checking is done in `rb_singleton_class()'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 19:47:58 +00:00
svn 492fcfda8b * 2012-10-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 15:49:17 +00:00
nobu e672994d14 parse.y: warn static content assign in cond
* parse.y (assign_in_cond): warn for static content object asignments
  in conditional statements.  [ruby-dev:43083] [Feature #4299]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 15:49:09 +00:00
eregon 1fe5783104 * gc.c (gc_profile_result, gc_profile_report): use internal structures
to avoid allocations and progressively print the output for #report.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 14:36:22 +00:00
ktsj 493d253300 * struct.c: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 11:06:46 +00:00
ko1 180c744b3b * numeric.c (rb_float_new_in_heap), include/ruby/ruby.h:
make all Float objects frozen.
  [ruby-dev:46081] [ruby-trunk - Feature #6936]
  Most part of patch by NARUSE, Yui  <naruse@ruby-lang.org>.
* class.c (singleton_class_of): raise TypeError when
  trying to define a singleton method on Float objects.
* vm.c (vm_define_method): ditto.
* test/ruby/marshaltestlib.rb: catch up above changes.
* test/ruby/test_class.rb: ditto.
* test/test_pp.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 02:10:53 +00:00
tenderlove 909bc583a4 * object.c (rb_mod_const_get): make sure the constant name is
converted to a string before searching. [ruby-core:48405]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 01:51:58 +00:00
shyouhei d090f17f21 * iseq.c (rb_iseq_compile_with_option): Instead of testing
respond_to, just check if the argument is actually a file,
  because by calling user-defined gets something weired can
  happen.  Patch by Glass_saga. [ruby-dev:40202] [Bug #2861]

* parse.y (ripper_initialize): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 01:16:25 +00:00
nobu 197e7b812c parse.y: bit field lex_state
* parse.y (enum lex_state_e): [EXPERIMENTAL] lex_state as bit field /
  IS_lex_state() macro.  based on the patch by Dave B in
  [ruby-core:23503].  [Feature #1493]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 01:07:59 +00:00
nobu 854c5ec470 win32.h: fstat on mingw32
* include/ruby/win32.h (fstat): use _fstati64() instead of fstati64()
  on mingw32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-27 01:05:06 +00:00
svn bc9428b732 * 2012-10-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 21:31:36 +00:00
tenderlove 82af182e74 * object.c (rb_mod_const_get): const_get accepts qualified constant
strings.  e.g. Object.const_get("Foo::Bar::Baz") [ruby-core:41404]

* test/ruby/test_module.rb: tests for new behavior

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 21:31:23 +00:00
svn 8ee4f0ad80 * 2012-10-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 04:24:36 +00:00
nobu e7576a777c parse.y: concatenated literals
* parse.y (literal_concat_gen): merge fixed strings across
  concatenated literals, after an interpolation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-26 04:24:29 +00:00
nobu e6c5b9f308 revert r37326 "remove string literal concatenation"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 14:06:31 +00:00
naruse c6629c48e6 Revert r37316
The commit introduces too many failures and disturbs release engineering.
Re-commit it with fixed tests.

Thu Oct 25 13:09:01 2012  NAKAMURA Usaku  <usa@ruby-lang.org>

       * parse.y: show a warning for concatenating string literals because
         it will be deprecated in the future.
         patched by mame (Yusuke Endoh) at [ruby-core:44207].
         [ruby-core:44156] [Feature #6265]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 11:50:20 +00:00
nobu db1f7079b6 remove string literal concatenation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 10:07:22 +00:00
usa acd82f6e24 * win32/win32.c (has_redirection): should use shell (cmd.exe) when
the commandline containts '&'.
  reported by Roger Pack at [ruby-core:47912] [Bug #7143], and
  patched by Heesob Park at [ruby-core:47931].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 08:50:55 +00:00
ko1 9dc3a7d7a5 * include/ruby/ruby.h, class.c: remove (revert)
`rb_add_method_cfunc_frameless()' API.
  This API is not mature to become an offical API.
  For example, we can not use this API with
  `rb_define_private_method()'.
* method.h, vm_method.c (rb_add_method_cfunc_frameless): removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 06:03:53 +00:00
usa 8ca58751c1 * tool/mkconfig.rb: remove string literal concatenation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 04:36:15 +00:00
svn 70e7d07329 * 2012-10-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 04:22:25 +00:00
usa 4a309b765e * parse.y: show a warning for concatenating string literals because
it will be deprecated in the future.
  patched by mame (Yusuke Endoh) at [ruby-core:44207].
  [ruby-core:44156] [Feature #6265]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-25 04:22:21 +00:00
nobu e59e5e90c0 objspace.c: enum ruby_value_type
* ext/objspace/objspace.c (type2sym, count_objects_size): use enum
  instead of size_t which may be larger than actual values.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 09:49:18 +00:00
nobu aaf346059d vm_insnhelper.c: inline
* vm_insnhelper.c: declare as inline, to match with the definitions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 09:48:32 +00:00
ko1 9b68747be0 * benchmark/driver.rb: add `-x' or `--exclude' option
to specify exclude benchmark name pattern.
  You can specify "-x foo" if you want to exclude the benchmarks
  if the name of benchmark contains `foo'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 08:46:01 +00:00
nari a4ba41a29d rename it to a more fitting name
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 04:29:53 +00:00
nari bda726223f fix the function name which is not grammatically correct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 04:14:22 +00:00
nari f0a435c187 * gc.c (free_object_aquire): rename to match the behavior of this
function.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 03:55:46 +00:00
ko1 04c177e277 * ext/objspace/objspace.c (reachable_object_from_i): change data
structure of the result of reachable objects. Keys of table
  contains object_id of each reachable objects. Value of table
  is an object itself or an instance of InternalObjectWrapper.
  To avoid duplication, we use st_table and object_id keys.
* ext/objspace/objspace.c (type2sym): bug fix.
  Should use `i' instead of `type'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 03:00:39 +00:00
ko1 aab12ec054 * gc.c (garbage_collect, gc_marks): move the location of
clear and restore rb_objspace_t::mark_func_data
  from garbage_collect() to gc_marks().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 01:39:45 +00:00
ko1 6cbd18d7ef * ext/objspace/objspace.c (Init_objspace): add a new method
`ObjectSpace::InternalObjectWrapper#internal_object_id' which returns
  an object id of a wrapped internal object.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 01:21:13 +00:00
ko1 6c6dece7f1 * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):
internal object support.
  If given object `obj' has references to internal objects
  (such as T_NODE objects), then this method returns instances of
  `ObjectSpace::InternalObjectWrapper' instead of that internal objects.
  This instance contains a refereance to an internal object and you can
  check the type of internal object using
  `ObjectSpace::InternalObjectWrapper#type' method.
  Rdoc of `InternalObjectWrapper' is not prepared yet.
* gc.c (rb_objspace_reachable_objects_from), gc.h: change
  an interface of 'rb_objspace_reachable_objects_from()'
* gc.c, gc.h: add two APIs
  - rb_objspace_markable_object_p(obj): check markable or not.
  - rb_objspace_internal_object_p(obj): check internal or not.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24 00:04:56 +00:00
ko1 e1d772c801 * vm_insnhelper.c (vm_call_method): remove `default' and
add a case for `VM_METHOD_TYPE_UNDEF'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-23 20:53:35 +00:00