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

27941 Коммитов

Автор SHA1 Сообщение Дата
marcandre f02c29ee4f * numeric.c: Extract ruby_float_step_size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:14:16 +00:00
marcandre ce0bf9f43d * struct.c: Support for Struct's enumerators #size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:14:02 +00:00
marcandre 17c0aff0d6 * hash.c: Support for enumerators created by ENV:
each, each_value, ...
  [Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:13:48 +00:00
marcandre 19ed71c8d0 * hash.c: Support for enumerators created by Hash:
delete_if, reject!, ...
  [Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:13:33 +00:00
marcandre cef054d5b2 * enum.c (enum_cycle): Support for Enumerable#cycle.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:13:19 +00:00
marcandre fe9386cdcb * enum.c (enum_each_cons): Support for Enumerable#each_cons.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:13:04 +00:00
marcandre df8451e606 * enum.c (enum_each_slice): Support for Enumerable#each_slice.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:12:50 +00:00
marcandre c82ad6d207 * enum.c: Support for enumerators created by Enumerable with forwarding:
find_all, reject, ...
  [Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:12:35 +00:00
marcandre 727024fbac * vm_eval.c (rb_f_loop): Support for loop.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:12:20 +00:00
marcandre b8b01ab995 * array.c (rb_ary_cycle): Support for Array#cycle.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:12:05 +00:00
marcandre ba59365db9 * array.c (rb_ary_repeated_combination): Support for repeated_combination.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:11:51 +00:00
marcandre 68c90c4a2d * array.c (rb_ary_repeated_permutation): Support for repeated_permutation.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:11:36 +00:00
marcandre 6bbf668d6e * array.c (rb_ary_combination): Support for Array#combination.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:11:21 +00:00
marcandre 1cb9f27c13 * array.c (rb_ary_permutation): Support for Array#permutation.size
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:11:06 +00:00
marcandre 55fb13eff9 * array.c: Support for Enumerator#size in trivial cases:
each, each_index, reverse_each, sort_by, collect,
  collect!, select, select!, keep_if, reject, reject!, delete_if
  [Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:50 +00:00
marcandre 57d596cdb4 * enumerator.c: Support #size for enumerators created from enumerators
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:35 +00:00
marcandre acfd34a6a9 * enumerator.c (obj_to_enum): Have #to_enum accept a block
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:20 +00:00
marcandre 610eeffa46 * enumerator: New method #size; constructor accepts size
[Feature #6636]

* include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of
  sized enumerators

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:06 +00:00
svn 2f4769a874 * 2012-11-07
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:09:49 +00:00
marcandre c73b6bd7eb * enumerator.c (enumerator_initialize): Warn when using deprecated form
[Feature #6636]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:09:43 +00:00
tenderlove ac7f5157ac * object.c (rb_mod_const_get): Fix constant missing exception class
and message to maintain backwards compatibility. Constant search
  should start at Object when constant starts with '::'

* test/ruby/test_module.rb: test for fixes

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 11:42:24 +00:00
glass e5e5d0c55e * ChangeLog: add link to redmine and ruby-core
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 09:46:30 +00:00
glass 31f72cf518 * lib/tempfile.rb: fix confusing inspect.
previous Tempfile#inspect says it is a File, but actually
  it is not a File.

    t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
    t.is_a? File #=> false

  now Tempfile#inspect returns like:

    t = Tempfile.new("foo")
    #=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 08:06:21 +00:00
ngoto e2418e3fca * atomic.h: add #include <sys/atomic.h> for the workaround of
header file name conflict of atomic.h with /usr/include/atomic.h
  on Solaris 10. [ruby-dev:46414] [Bug #7287]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 07:30:49 +00:00
usa bba3ceafa5 * test/win32ole/test_win32ole.rb: follow other test files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 05:43:47 +00:00
usa f2fc82fc2a * test/win32ole/test_win32ole.rb: now source encoding is UTF-8, so
binary strings in old scripts are dangerous.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 05:39:36 +00:00
nobu 510148e995 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 05:31:14 +00:00
naruse ccd7a805cc * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):
don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 05:30:17 +00:00
naruse a6ec258452 * string.c (rb_str_b): Add String#b, returning a copied string
whose encoding is ASCII-8BIT. [ruby-dev:45992] [Feature #6767]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 00:50:02 +00:00
naruse 58ef0f06c6 * ruby.c (load_file_internal): set default source encoding as
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]

* parse.y (parser_initialize): set default parser encoding as
  UTF-8 instead of US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 00:49:57 +00:00
shirosaki c9fc6b08ae * test/ruby/test_require.rb
(TestRequire#test_require_to_path_redefined_in_load_path,
   TestRequire#test_require_to_str_redefined_in_load_path):
  Suppress method redefined warning when test-all with RUBYOPT=-w.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 20:55:30 +00:00
kosaki 4e73323a60 * thread_pthread.c (rb_reserved_fd_p): fix typo in macro check
that prevented the ifdef ever being true.
  [Bug #7281] [ruby-core:48940]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 16:43:32 +00:00
shirosaki d33b9a8a72 Fix compatibility of cached expanded load path
* file.c (rb_get_path_check_to_string): extract from
  rb_get_path_check(). We change the spec not to call to_path of
  String object.

* file.c (rb_get_path_check_convert): extract from rb_get_path_check().

* file.c (rb_get_path_check): follow the above change.

* file.c (rb_file_expand_path_fast): remove check_expand_path_args().
  Instead we call it in load.c.

* file.c (rb_find_file_ext_safe): use rb_get_expanded_load_path() to
  reduce expand cost.

* file.c (rb_find_file_safe): ditto.

* internal.h (rb_get_expanded_load_path): add a declaration.

* internal.h (rb_get_path_check_to_string, rb_get_path_check_convert):
  add declarations.

* load.c (rb_construct_expanded_load_path): fix for compatibility.
  Same checks in rb_get_path_check() are added. We don't replace
  $LOAD_PATH and ensure that String object of $LOAD_PATH are frozen.
  We don't freeze non String object and expand it every times. We add
  arguments for expanding load path partially and checking if load path
  have relative paths or non String objects.

* load.c (load_path_getcwd): get current working directory for checking
  if it's changed when getting load path.

* load.c (rb_get_expanded_load_path): fix for rebuilding cache properly.
  We check if current working directory is changed and rebuild expanded
  load path cache. We expand paths which start with ~ (User HOME) and
  non String objects every times for compatibility. We make this
  accessible from other source files.

* load.c (rb_feature_provided): call rb_get_path() since we changed
  rb_file_expand_path_fast() not to call it.

* load.c (Init_load): initialize vm->load_path_check_cache.

* vm.c (rb_vm_mark): mark vm->load_path_check_cache for GC.

* vm_core.h (rb_vm_struct): add vm->load_path_check_cache to store data
  to check load path cache validity.

* test/ruby/test_require.rb (TestRequire): add tests for require
  compatibility related to cached expanded load path.
  [ruby-core:47970] [Bug #7158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:27:08 +00:00
shirosaki 9823c46189 Cache the expanded load path
* load.c (rb_get_expanded_load_path): cache the expanded load
  path.  This saves 4KB of allocation and some stats for every
  element of the load path (so nearly a MB in my Rails app)
  on every require.

* load.c (rb_construct_expanded_load_path): ensure that $LOAD_PATH
  entries are frozen strings.  The user must mutate $LOAD_PATH
  itself rather than its individual entries.

* vm_core.h (rb_vm_struct): add fields.

* vm.c (rb_vm_mark): mark new fields.

* ruby.c (process_options): modify $LOAD_PATH directly rather than
  its elements.
  Patch by Greg Price.
  [ruby-core:47970] [Bug #7158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:27:05 +00:00
shirosaki b56a2afc14 Index $LOADED_FEATURES so that require isn't so slow
* load.c (rb_feature_p, rb_provide_feature): index $LOADED_FEATURES
  so that require isn't so slow.

* load.c (rb_provide_feature, get_loaded_features_index): ensure
  that $LOADED_FEATURES entries are frozen strings.  The user
  must mutate $LOADED_FEATURES itself rather than its individual
  entries.

* load.c (reset_loaded_features_snapshot): add a new function to reset
  vm->loaded_features_snapshot.

* load.c (get_loaded_features_index_raw): add a new function to get
  the loaded-features index.

* load.c (features_index_add_single): add a new function to add to the
  loaded-features index a single feature.

* load.c (features_index_add): add a new function to add to the
  loaded-features index all the required entries for `feature`.

* vm_core.h (rb_vm_struct): add fields.

* vm.c (rb_vm_mark): mark new fields.

* include/ruby/intern.h (rb_hash_clear): declare function.

* hash.c (rb_hash_clear): make function non-static.
  Patch by Greg Price.
  [ruby-core:47970] [Bug #7158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:27:01 +00:00
svn 2a7d349eb4 * 2012-11-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:24:08 +00:00
shirosaki e575070f2f Expose whether two arrays are shared
* array.c (rb_ary_shared_with_p): new function.
  Expose whether two arrays are shared (read-only, C only).

* include/ruby/intern.h (rb_ary_shared_with_p): declare.
  Patch by Greg Price.
  [ruby-core:47970] [Bug #7158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:24:07 +00:00
shirosaki 4d414c9f68 Clarify and explain loaded_feature_path and rb_feature_p
* load.c (loaded_feature_path): clarify and briefly comment
  function.  These clarifications have no effect on the behavior
  of the function.

* load.c (rb_feature_p): explain the search loop.  Especially
  useful because the logic is complicated as described in the
  second paragraph.
  Patch by Greg Price.
  [ruby-core:47970] [Bug #7158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 15:24:03 +00:00
shirosaki 9bb55f7633 * ext/dl/win32/lib/Win32API.rb (Win32API#call): use 64bit pointer for x64
Windows. This would fix
  TestSecureRandom#test_s_random_bytes_without_openssl error.
  [ruby-core:47451] [Bug #6990]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 14:00:41 +00:00
shirosaki 868ab650eb * cygwin/GNUmakefile.in (uncommon.mk): link *.res.o.
EXTOBJES is defined in uncommon.mk. *.res.o setting should be below
  uncommon.mk.
  [ruby-core:48858] [Bug #7277]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 14:00:35 +00:00
kosaki 9da62b63d9 * thread_pthread.c (native_thread_init, native_thread_destroy):
removed HAVE_PTHREAD_CONDATTR_INIT check because this silly
  #ifdef makes use-uninitialized-var issue and (2) native_cond_initialize()
  already have a right platform and caller don't need any additional care.
  [Bug #6825]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 02:46:41 +00:00
naruse 0ba4526d06 * lib/cgi/core.rb: check if Tempfile is defined before use it.
* lib/cgi/core.rb: remove tempfiles only if tempfiles exist

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 02:34:17 +00:00
zzak 0ba78cb2f7 * lib/uri/http.rb (URI::HTTP.build): Fix example
Patch by Carina C. Zona
  [Fixes #209 Github]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 01:19:09 +00:00
xibbar 1362d81a22 Mon Nov 5 09:55:05 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* lib/cgi/core.rb: remove tempfile more early.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 00:57:45 +00:00
xibbar d5528ec358 Mon Nov 5 09:50:28 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* NEWS: add a news about html5 tagmaker
  and rename CGI#header to CGI#http_header

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 00:57:41 +00:00
svn a8aaf1eb14 * 2012-11-05
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04 21:14:23 +00:00
naruse b5c5b980dd Don't redefine methods
If HTML5 element methods are already defined, don't redefine them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04 21:14:19 +00:00
kou 8519a2d581 * ChangeLog: Remove garbages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04 12:37:11 +00:00
xibbar 6837f3dc54 Sun Nov 4 20:41:28 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to
    CGI#http_header,
    add  and update HTML5 tag generater.  [Bug #7110]
    Patch provided by Marcus Stollsteimer, thank you !

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04 11:48:05 +00:00
glass 2142287c86 * lib/fileutils.rb (module FileUtils): repatch [ruby-core:39622]
[Feature #5337]. improve performance of FileUtils.compare_stream.
  [ruby-core:47545] [Feature #7028]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-04 02:56:11 +00:00