Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys):

  typo fixed.  [ruby-talk:162187]

* ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
  ditto.  [ruby-core:06359]

* ext/enumerator/enumerator.c: applied documentation patch from
  James Edward Gray II <james@grayproductions.net>.
  [ruby-core:06348]


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 79bd8d2ca0db7d6eb9eaa1264fb6becfa90e79c4 1 parent 68d2c67
authored October 24, 2005
20  ChangeLog
... ...
@@ -1,6 +1,20 @@
  1
+Mon Oct 24 07:57:56 2005  Yukihiro Matsumoto  <matz@ruby-lang.org>
  2
+
  3
+	* ext/tk/lib/tk/canvas.rb (TkCanvasItemConfig::__item_val2ruby_optkeys): 
  4
+	  typo fixed.  [ruby-talk:162187]
  5
+
  6
+	* ext/tk/lib/tk/menu.rb (TkMenuEntryConfig::__item_val2ruby_optkeys):
  7
+	  ditto.  [ruby-core:06359]
  8
+
  9
+Sun Oct 23 21:50:15 2005  Yukihiro Matsumoto  <matz@ruby-lang.org>
  10
+
  11
+	* ext/enumerator/enumerator.c: applied documentation patch from
  12
+	  James Edward Gray II <james@grayproductions.net>.
  13
+	  [ruby-core:06348]
  14
+
1 15
 Sun Oct 23 07:11:11 2005  Hidetoshi NAGAI  <nagai@ai.kyutech.ac.jp>
2 16
 
3  
-	* ext/tcltklib/extconf.rb: improbe messages [ruby-core:06325].
  17
+	* ext/tcltklib/extconf.rb: improve messages [ruby-core:06325].
4 18
 
5 19
 	* ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb, 
6 20
 	  ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb, 
@@ -41,6 +55,10 @@ Fri Oct 21 19:21:56 2005  Hirokazu Yamamoto  <ocean@m2.ccsnet.ne.jp>
41 55
 
42 56
 	* rubysig.h (CHECK_INTS): fixed typo. (I believe bit-or is improper)
43 57
 
  58
+Fri Oct 21 17:49:32 2005  Yukihiro Matsumoto  <matz@ruby-lang.org>
  59
+
  60
+	* bin/erb (ERB::Main::run): typo fixed.  [ruby-core:06337]
  61
+
44 62
 Fri Oct 21 15:27:17 2005  Hirokazu Yamamoto  <ocean@m2.ccsnet.ne.jp>
45 63
 
46 64
 	* bignum.c (bignew_1): convertion from `int' to `char' discards
2  bin/erb
@@ -60,7 +60,7 @@ class ERB
60 60
             $DEBUG = true
61 61
           when '-r'                        # require
62 62
             require ARGV.req_arg
63  
-          when '-S'                        # sacurity level
  63
+          when '-S'                        # security level
64 64
             arg = ARGV.req_arg
65 65
             raise "invalid safe_level #{arg.dump}" unless arg =~ /^[0-4]$/
66 66
             safe_level = arg.to_i
1  ext/.document
... ...
@@ -1,5 +1,6 @@
1 1
 # Add files to this as they become documented
2 2
 
  3
+enumerator/enumerator.c
3 4
 iconv/iconv.c
4 5
 stringio/stringio.c
5 6
 strscan/strscan.c
103  ext/enumerator/enumerator.c
@@ -15,10 +15,34 @@
15 15
 #include "ruby.h"
16 16
 #include "node.h"
17 17
 
  18
+/*
  19
+ * Document-class: Enumerable::Enumerator
  20
+ *
  21
+ * A class which provides a method `each' to be used as an Enumerable
  22
+ * object.
  23
+ */
18 24
 static VALUE rb_cEnumerator;
19 25
 static ID sym_each, sym_each_with_index, sym_each_slice, sym_each_cons;
20 26
 static ID id_new, id_enum_obj, id_enum_method, id_enum_args;
21 27
 
  28
+/*
  29
+ *  call-seq:
  30
+ *    obj.to_enum(method = :each, *args)
  31
+ *    obj.enum_for(method = :each, *args)
  32
+ *
  33
+ *  Returns Enumerable::Enumerator.new(self, method, *args).
  34
+ *
  35
+ *  e.g.:
  36
+ *     str = "xyz"
  37
+ *
  38
+ *     enum = str.enum_for(:each_byte)
  39
+ *     a = enum.map {|b| '%02x' % b } #=> ["78", "79", "7a"]
  40
+ *
  41
+ *     # protects an array from being modified
  42
+ *     a = [1, 2, 3]
  43
+ *     some_method(a.to_enum)
  44
+ *
  45
+ */
22 46
 static VALUE
23 47
 obj_to_enum(obj, enum_args)
24 48
     VALUE obj, enum_args;
@@ -28,6 +52,13 @@ obj_to_enum(obj, enum_args)
28 52
     return rb_apply(rb_cEnumerator, id_new, enum_args);
29 53
 }
30 54
 
  55
+/*
  56
+ *  call-seq:
  57
+ *    enum_with_index
  58
+ *
  59
+ *  Returns Enumerable::Enumerator.new(self, :each_with_index).
  60
+ *
  61
+ */
31 62
 static VALUE
32 63
 enumerator_enum_with_index(obj)
33 64
     VALUE obj;
@@ -53,6 +84,21 @@ each_slice_i(val, memo)
53 84
     return Qnil;
54 85
 }
55 86
 
  87
+/*
  88
+ *  call-seq:
  89
+ *    e.each_slice(n) {...}
  90
+ *
  91
+ *  Iterates the given block for each slice of <n> elements.
  92
+ *
  93
+ *  e.g.:
  94
+ *      (1..10).each_slice(3) {|a| p a}
  95
+ *      # outputs below
  96
+ *      [1, 2, 3]
  97
+ *      [4, 5, 6]
  98
+ *      [7, 8, 9]
  99
+ *      [10]
  100
+ *
  101
+ */
56 102
 static VALUE
57 103
 enum_each_slice(obj, n)
58 104
     VALUE obj, n;
@@ -73,6 +119,13 @@ enum_each_slice(obj, n)
73 119
     return Qnil;
74 120
 }
75 121
 
  122
+/*
  123
+ *  call-seq:
  124
+ *    e.enum_slice(n)
  125
+ *
  126
+ *  Returns Enumerable::Enumerator.new(self, :each_slice, n).
  127
+ *
  128
+ */
76 129
 static VALUE
77 130
 enumerator_enum_slice(obj, n)
78 131
     VALUE obj, n;
@@ -98,6 +151,26 @@ each_cons_i(val, memo)
98 151
     return Qnil;
99 152
 }
100 153
 
  154
+/*
  155
+ *  call-seq:
  156
+ *    each_cons(n) {...}
  157
+ *
  158
+ *  Iterates the given block for each array of consecutive <n>
  159
+ *  elements.
  160
+ *
  161
+ *  e.g.:
  162
+ *      (1..10).each_cons(3) {|a| p a}
  163
+ *      # outputs below
  164
+ *      [1, 2, 3]
  165
+ *      [2, 3, 4]
  166
+ *      [3, 4, 5]
  167
+ *      [4, 5, 6]
  168
+ *      [5, 6, 7]
  169
+ *      [6, 7, 8]
  170
+ *      [7, 8, 9]
  171
+ *      [8, 9, 10]
  172
+ *
  173
+ */
101 174
 static VALUE
102 175
 enum_each_cons(obj, n)
103 176
     VALUE obj, n;
@@ -113,6 +186,13 @@ enum_each_cons(obj, n)
113 186
     return Qnil;
114 187
 }
115 188
 
  189
+/*
  190
+ *  call-seq:
  191
+ *    e.enum_cons(n)
  192
+ *
  193
+ *  Returns Enumerable::Enumerator.new(self, :each_cons, n).
  194
+ *
  195
+ */
116 196
 static VALUE
117 197
 enumerator_enum_cons(obj, n)
118 198
     VALUE obj, n;
@@ -120,6 +200,21 @@ enumerator_enum_cons(obj, n)
120 200
     return rb_funcall(rb_cEnumerator, id_new, 3, obj, sym_each_cons, n);
121 201
 }
122 202
 
  203
+/*
  204
+ *  call-seq:
  205
+ *    Enumerable::Enumerator.new(obj, method = :each, *args)
  206
+ *
  207
+ *  Creates a new Enumerable::Enumerator object, which is to be
  208
+ *  used as an Enumerable object using the given object's given
  209
+ *  method with the given arguments.
  210
+ *
  211
+ *  e.g.:
  212
+ *      str = "xyz"
  213
+ *
  214
+ *      enum = Enumerable::Enumerator.new(str, :each_byte)
  215
+ *      a = enum.map {|b| '%02x' % b } #=> ["78", "79", "7a"]
  216
+ *
  217
+ */
123 218
 static VALUE
124 219
 enumerator_initialize(argc, argv, obj)
125 220
     int argc;
@@ -147,6 +242,14 @@ enumerator_iter(memo)
147 242
     return rb_apply(memo->u1.value, memo->u2.id, memo->u3.value);
148 243
 }
149 244
 
  245
+/*
  246
+ *  call-seq:
  247
+ *    enum.each {...}
  248
+ *
  249
+ *  Iterates the given block using the object and the method specified
  250
+ *  in the first place.
  251
+ *
  252
+ */
150 253
 static VALUE
151 254
 enumerator_each(obj)
152 255
     VALUE obj;
2  ext/tk/lib/tk/canvas.rb
@@ -28,7 +28,7 @@ def __item_methodcall_optkeys(id)
28 28
   def __item_val2ruby_optkeys(id)  # { key=>proc, ... }
29 29
     super(id).update('window'=>proc{|i, v| window(v)})
30 30
   end
31  
-  private :__val2ruby_optkeys
  31
+  private :__item_val2ruby_optkeys
32 32
 
33 33
   def __item_pathname(tagOrId)
34 34
     if tagOrId.kind_of?(TkcItem) || tagOrId.kind_of?(TkcTag)
2  ext/tk/lib/tk/menu.rb
@@ -31,7 +31,7 @@ def __item_listval_optkeys(id)
31 31
   def __item_val2ruby_optkeys(id)  # { key=>proc, ... }
32 32
     super(id).update('menu'=>proc{|i, v| window(v)})
33 33
   end
34  
-  private :__val2ruby_optkeys
  34
+  private :__item_val2ruby_optkeys
35 35
 
36 36
   alias entrycget itemcget
37 37
   alias entryconfigure itemconfigure

0 notes on commit 79bd8d2

Please sign in to comment.
Something went wrong with that request. Please try again.