[前][次][番号順一覧][スレッド一覧]

ruby-changes:46113

From: nagachika <ko1@a...>
Date: Tue, 28 Mar 2017 02:35:43 +0900 (JST)
Subject: [ruby-changes:46113] nagachika:r58184 (ruby_2_3): merge revision(s) 57352: [Backport #13132]

nagachika	2017-03-28 02:35:38 +0900 (Tue, 28 Mar 2017)

  New Revision: 58184

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58184

  Log:
    merge revision(s) 57352: [Backport #13132]
    
    doc: improve documentation for Binding [ci skip]
    
    * remove explicit return from code examples
    * grammar fixes
    * other small fixes
    
    Patch by: Marcus Stollsteimer <sto.mar@w...>
    
    [ruby-core:79082] [Bug #13132]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/proc.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 58183)
+++ ruby_2_3/version.h	(revision 58184)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.3"
 #define RUBY_RELEASE_DATE "2017-03-28"
-#define RUBY_PATCHLEVEL 293
+#define RUBY_PATCHLEVEL 294
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/proc.c
===================================================================
--- ruby_2_3/proc.c	(revision 58183)
+++ ruby_2_3/proc.c	(revision 58184)
@@ -335,7 +335,7 @@ rb_binding_new(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L335
  *  environment. See also the description of class +Binding+.
  *
  *     def get_binding(param)
- *       return binding
+ *       binding
  *     end
  *     b = get_binding("hello")
  *     eval("param", b)   #=> "hello"
@@ -357,7 +357,7 @@ rb_f_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L357
  *  reporting syntax errors.
  *
  *     def get_binding(param)
- *       return binding
+ *       binding
  *     end
  *     b = get_binding("hello")
  *     b.eval("param")   #=> "hello"
@@ -431,7 +431,7 @@ check_local_id(VALUE bindval, volatile V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L431
  *  call-seq:
  *     binding.local_variables -> Array
  *
- *  Returns the +symbol+ names of the binding's local variables
+ *  Returns the names of the binding's local variables as symbols.
  *
  *	def foo
  *  	  a = 1
@@ -440,7 +440,7 @@ check_local_id(VALUE bindval, volatile V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L440
  *  	  end
  *  	end
  *
- *  This method is short version of the following code.
+ *  This method is the short version of the following code:
  *
  *	binding.eval("local_variables")
  *
@@ -461,7 +461,7 @@ bind_local_variables(VALUE bindval) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L461
  *  call-seq:
  *     binding.local_variable_get(symbol) -> obj
  *
- *  Returns a +value+ of local variable +symbol+.
+ *  Returns the value of the local variable +symbol+.
  *
  *	def foo
  *  	  a = 1
@@ -469,7 +469,7 @@ bind_local_variables(VALUE bindval) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L469
  *  	  binding.local_variable_get(:b) #=> NameError
  *  	end
  *
- *  This method is short version of the following code.
+ *  This method is the short version of the following code:
  *
  *	binding.eval("#{symbol}")
  *
@@ -506,18 +506,19 @@ bind_local_variable_get(VALUE bindval, V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L506
  *  	  bind = binding
  *  	  bind.local_variable_set(:a, 2) # set existing local variable `a'
  *  	  bind.local_variable_set(:b, 3) # create new local variable `b'
- *  	                                 # `b' exists only in binding.
- *  	  p bind.local_variable_get(:a) #=> 2
- *  	  p bind.local_variable_get(:b) #=> 3
- *  	  p a #=> 2
- *  	  p b #=> NameError
+ *  	                                 # `b' exists only in binding
+ *
+ *  	  p bind.local_variable_get(:a)  #=> 2
+ *  	  p bind.local_variable_get(:b)  #=> 3
+ *  	  p a                            #=> 2
+ *  	  p b                            #=> NameError
  *  	end
  *
- *  This method is a similar behavior of the following code
+ *  This method behaves similarly to the following code:
  *
  *    binding.eval("#{symbol} = #{obj}")
  *
- *  if obj can be dumped in Ruby code.
+ *  if +obj+ can be dumped in Ruby code.
  */
 static VALUE
 bind_local_variable_set(VALUE bindval, VALUE sym, VALUE val)
@@ -543,7 +544,7 @@ bind_local_variable_set(VALUE bindval, V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L544
  *  call-seq:
  *     binding.local_variable_defined?(symbol) -> obj
  *
- *  Returns a +true+ if a local variable +symbol+ exists.
+ *  Returns +true+ if a local variable +symbol+ exists.
  *
  *	def foo
  *  	  a = 1
@@ -551,7 +552,7 @@ bind_local_variable_set(VALUE bindval, V https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L552
  *  	  binding.local_variable_defined?(:b) #=> false
  *  	end
  *
- *  This method is short version of the following code.
+ *  This method is the short version of the following code:
  *
  *	binding.eval("defined?(#{symbol}) == 'local-variable'")
  *
@@ -1034,7 +1035,7 @@ iseq_location(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L1035
  *    prc.source_location  -> [String, Fixnum]
  *
  * Returns the Ruby source filename and line number containing this proc
- * or +nil+ if this proc was not defined in Ruby (i.e. native)
+ * or +nil+ if this proc was not defined in Ruby (i.e. native).
  */
 
 VALUE
@@ -2386,7 +2387,7 @@ rb_obj_method_location(VALUE obj, ID id) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L2387
  *    meth.source_location  -> [String, Fixnum]
  *
  * Returns the Ruby source filename and line number containing this method
- * or nil if this method was not defined in Ruby (i.e. native)
+ * or nil if this method was not defined in Ruby (i.e. native).
  */
 
 VALUE
@@ -3016,7 +3017,7 @@ Init_Proc(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/proc.c#L3017
  *         @secret = n
  *       end
  *       def get_binding
- *         return binding()
+ *         binding
  *       end
  *     end
  *

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r57352


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]