From 7c8a4774168d5d31b59d2b3a7aa1a0e2c8227041 Mon Sep 17 00:00:00 2001 From: marcandre Date: Fri, 22 Feb 2013 23:33:51 +0000 Subject: * backport r39400-r39407 from trunk. * NEWS: many additions * object.c: Add doc for Module.prepended git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ NEWS | 27 ++++++++++++++++++++++++++- object.c | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f3dc99baa9..f770185e52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Feb 23 08:14:43 2013 Marc-Andre Lafortune + + * backport r39400-r39407 from trunk. + + * NEWS: many additions + + * object.c: Add doc for Module.prepended + Sat Feb 23 06:07:04 2013 Eric Hodel * lib/rubygems/installer.rb (build_extensions): Create extension diff --git a/NEWS b/NEWS index 8693b2ac70..1d058cbd8b 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ with all sufficient information, see the ChangeLog file. === Library updates (outstanding ones only) * builtin classes + * ARGF + * added method: + * added ARGF#codepoints and ARGF#each_codepoint, like the corresponding + methods for IO. * Array * added method: @@ -37,6 +41,7 @@ with all sufficient information, see the ChangeLog file. * added Enumerator#size for lazy size evaluation. * extended method: * Enumerator.new accept an argument for lazy size evaluation. + * new class Enumerator::Lazy for lazy enumeration * ENV * aliased method: @@ -104,6 +109,8 @@ with all sufficient information, see the ChangeLog file. * added Module#prepend which is similar to Module#include, however a method in the prepended module overrides the corresponding method in the prepending module. + * added Module.prepended and Module.prepend_features, similar + to included and append_features. * added Module#refine, which extends a class or module locally. [experimental] * extended method: @@ -125,6 +132,9 @@ with all sufficient information, see the ChangeLog file. * added method: * added nil.to_h which returns {} + * ObjectSpace::WeakMap + * new low level class to hold weak references to objects. + * Proc * incompatible change: * removed Proc#== so two procs are == only when they are @@ -140,6 +150,11 @@ with all sufficient information, see the ChangeLog file. * added Range#bsearch for binary search. * RubyVM (MRI specific) + * added RubyVM::InstructionSequence.of to get the instruction sequence + from a method or a block. + * added RubyVM::InstructionSequence#path, #absolute_path, #label, + #base_label and #first_lineno to retrieve information from where + the instruction sequence was defined. * added Environment variables to specify stack usage: * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation. default: 128KB (32bit CPU) or 256KB (64bit CPU). @@ -187,6 +202,9 @@ with all sufficient information, see the ChangeLog file. pending_interrupt? for asynchronous handling of exceptions * added Thread#backtrace_locations which returns similar information of Kernel#caller_locations. + * new class Thread::Backtrace::Location to hold backtrace location + information. These are returned by Thread#backtrace_locations and + Kernel#caller_locations. * incompatible changes: * Thread#join and Thread#value now raises a ThreadError if target thread is the current or main thread. @@ -421,6 +439,8 @@ with all sufficient information, see the ChangeLog file. * Default source encoding is changed to UTF-8. (was US-ASCII) + * No warning for unused variables starting with '_' + === Compatibility issues (excluding feature bug fixes) * Array#values_at @@ -445,7 +465,6 @@ with all sufficient information, see the ChangeLog file. * IO#bytes * ARGF#lines * ARGF#chars - * ARGF#codepoints * ARGF#bytes * StringIO#lines * StringIO#chars @@ -483,6 +502,12 @@ with all sufficient information, see the ChangeLog file. * Kernel#respond_to? against a protected method now returns false unless the second argument is true. + * Kernel#respond_to_missing? + * Kernel#initialize_clone + * Kernel#initialize_dup + + These methods are now private. + * Dir.mktmpdir in lib/tmpdir.rb See above. diff --git a/object.c b/object.c index ba4f997b3a..b3222e56e7 100644 --- a/object.c +++ b/object.c @@ -790,6 +790,26 @@ rb_obj_tap(VALUE obj) * module Enumerable * include A * end + * # => prints "A included in Enumerable" + */ + +/* + * Document-method: prepended + * + * call-seq: + * prepended( othermod ) + * + * The equivalent of included, but for prepended modules. + * + * module A + * def self.prepended(mod) + * puts "#{self} prepended to #{mod}" + * end + * end + * module Enumerable + * prepend A + * end + * # => prints "A prepended to Enumerable" */ /* -- cgit v1.2.3