kyanite 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/Div +6 -32
  2. data/{History.txt → History.rdoc} +8 -0
  3. data/{License.txt → License.rdoc} +0 -0
  4. data/Manifest.txt +6 -21
  5. data/README.rdoc +44 -0
  6. data/Rakefile.rb +19 -68
  7. data/console.rb +2 -4
  8. data/lib/kyanite.rb +151 -14
  9. data/lib/kyanite/array.rb +127 -4
  10. data/lib/kyanite/basics.rb +3 -7
  11. data/lib/kyanite/dictionary.rb +19 -21
  12. data/lib/kyanite/enumerable/enumerable_enumerables.rb +22 -24
  13. data/lib/kyanite/enumerable/enumerable_numerics.rb +51 -49
  14. data/lib/kyanite/enumerable/enumerable_strings.rb +18 -25
  15. data/lib/kyanite/enumerable/structure.rb +46 -58
  16. data/lib/kyanite/general/callerutils.rb +30 -28
  17. data/lib/kyanite/general/classutils.rb +73 -63
  18. data/lib/kyanite/general/kernel.rb +45 -64
  19. data/lib/kyanite/general/object.rb +22 -46
  20. data/lib/kyanite/general/true_false.rb +33 -27
  21. data/lib/kyanite/general/undoable.rb +12 -16
  22. data/lib/kyanite/hash.rb +63 -58
  23. data/lib/kyanite/numeric.rb +14 -1
  24. data/lib/kyanite/numeric/float.rb +32 -22
  25. data/lib/kyanite/numeric/integer.rb +12 -20
  26. data/lib/kyanite/optimizer.rb +41 -24
  27. data/lib/kyanite/range.rb +42 -22
  28. data/lib/kyanite/set.rb +56 -63
  29. data/lib/kyanite/string.rb +1 -2
  30. data/lib/kyanite/string/cast.rb +61 -37
  31. data/lib/kyanite/string/chars.rb +66 -36
  32. data/lib/kyanite/string/chars_const.rb +4 -3
  33. data/lib/kyanite/string/diff.rb +64 -34
  34. data/lib/kyanite/string/include.rb +16 -9
  35. data/lib/kyanite/string/list.rb +38 -8
  36. data/lib/kyanite/string/misc.rb +64 -0
  37. data/lib/kyanite/string/nested.rb +39 -22
  38. data/lib/kyanite/string/random.rb +117 -47
  39. data/lib/kyanite/string/split.rb +84 -45
  40. data/lib/kyanite/symbol.rb +30 -21
  41. data/lib/kyanite/tree.rb +33 -28
  42. data/test/_start_all.rb +18 -15
  43. data/test/array/test_array.rb +5 -7
  44. data/test/enumerable/test_enumerable_enumerables.rb +11 -15
  45. data/test/enumerable/test_enumerable_numerics.rb +50 -54
  46. data/test/enumerable/test_enumerable_strings.rb +8 -11
  47. data/test/enumerable/test_structure.rb +6 -8
  48. data/test/general/test_classutils.rb +9 -9
  49. data/test/general/test_object.rb +4 -5
  50. data/test/general/test_true_false.rb +4 -5
  51. data/test/numeric/test_numeric_integer.rb +6 -6
  52. data/test/string/test_cast.rb +4 -5
  53. data/test/string/test_chars.rb +6 -7
  54. data/test/string/test_diff.rb +4 -5
  55. data/test/string/test_list.rb +4 -5
  56. data/test/string/test_misc.rb +58 -0
  57. data/test/string/test_nested.rb +4 -5
  58. data/test/string/test_split.rb +10 -5
  59. data/test/test_dictionary.rb +4 -6
  60. data/test/test_hash.rb +5 -7
  61. data/test/test_optimizer.rb +4 -5
  62. data/test/test_range.rb +8 -9
  63. data/test/test_set.rb +7 -7
  64. data/test/test_tree.rb +7 -10
  65. data/version.rb +8 -0
  66. metadata +32 -33
  67. data/README.txt +0 -47
  68. data/lib/kyanite/array/array.rb +0 -140
  69. data/lib/kyanite/array/array2.rb +0 -142
  70. data/lib/kyanite/array/matrix2.rb +0 -120
  71. data/lib/kyanite/hoe.rb +0 -2
  72. data/lib/kyanite/matrix2.rb +0 -2
  73. data/lib/kyanite/numeric/numeric.rb +0 -54
  74. data/lib/kyanite/operation.rb +0 -5
  75. data/lib/kyanite/operation/call_tracker.rb +0 -69
  76. data/lib/kyanite/operation/hoe.rb +0 -12
  77. data/lib/kyanite/operation/rake.rb +0 -298
  78. data/lib/kyanite/operation/regexp.rb +0 -28
  79. data/lib/kyanite/operation/unit_test.rb +0 -50
  80. data/lib/kyanite/rake.rb +0 -2
  81. data/lib/kyanite/smart_load_path.rb +0 -6
  82. data/lib/kyanite/string/div.rb +0 -28
  83. data/lib/kyanite/string/mgsub.rb +0 -43
  84. data/lib/kyanite/unit_test.rb +0 -2
  85. data/test/array/test_matrix2.rb +0 -166
  86. data/test/string/test_mgsub.rb +0 -58
@@ -4,10 +4,9 @@ require 'kyanite/enumerable'
4
4
  require 'kyanite/string/cast'
5
5
  require 'kyanite/string/chars'
6
6
  require 'kyanite/string/diff'
7
- require 'kyanite/string/div'
8
7
  require 'kyanite/string/include'
9
8
  require 'kyanite/string/list'
10
- require 'kyanite/string/mgsub'
9
+ require 'kyanite/string/misc'
11
10
  require 'kyanite/string/nested'
12
11
  require 'kyanite/string/random'
13
12
  require 'kyanite/string/split'
@@ -1,35 +1,33 @@
1
1
  # ruby encoding: utf-8
2
+
3
+ if $0 == __FILE__
4
+ require 'drumherum'
5
+ smart_init
6
+ end
7
+
2
8
  require 'kyanite/numeric/integer'
3
9
 
4
- # [ | Kyanite | *Object* | Array | Set | Enumerable | Hash | ] | Object | *String* | Symbol | Numeric |
5
- #
6
- # ---
7
- #
8
- # == *String*
9
- #
10
- #
11
- class String
12
10
 
13
- # ---------------------------------------------------------------------------------------------------------------------------------
14
- # :section: Cast
15
- # See TestKyaniteStringCast for tests and examples.
16
- #
11
+ class String
17
12
 
18
-
19
-
20
- # Wandelt einen String in den plausibelsten Identifier um:
21
- # self.strip.to_integer_optional
13
+
14
+ # @!group Cast
15
+
16
+ # Converts a string into the most plausible Identifier
22
17
  #
23
- # Tests & Beispiele siehe TestKyaniteStringCast#test_to_identifier
18
+ # See examples and tests {TestKyaniteStringCast#test_to_identifier here}.
19
+ # @return [Integer]
24
20
  def to_identifier
25
21
  self.strip.to_integer_optional
26
22
  end
27
23
 
28
24
 
29
- # Wandelt einen String in einen Integer, auch dann, wenn die Zahl hinten angehängt wurde.
30
- # Im Gegensatz zu to_i wird nil zurückgegeben, wenn keine Zahl drin war.
25
+
26
+ # Converts a string to an integer, even if the number was appended to anything.
27
+ # Unlike +to_i+ it returns +nil+ if no integer was found inside the string.
31
28
  #
32
- # Beispiele & Tests siehe TestKyaniteStringCast#test_to_integer
29
+ # See examples and tests {TestKyaniteStringCast#test_to_integer here}.
30
+ # @return [Integer]
33
31
  def to_integer
34
32
  return nil unless self =~ /\d/
35
33
  firsttry = self.to_i
@@ -38,18 +36,23 @@ class String
38
36
  end
39
37
 
40
38
 
41
- # Wandelt einen String in einen Integer.
42
- # Im Gegensatz zu to_i wird self zurückgegeben, wenn der String nicht mit einer Zahl beginnt.
43
- # Leere Strings werden in NIL umgewandelt.
44
- #
45
- # Beispiele & Tests siehe TestKyaniteStringCast#test_to_integer_optional
39
+
40
+ # Tries to convert a string to an integer.
41
+ # Returns +self+ if the string does not start with a number.
42
+ # Empty strings are converted to +nil+.
43
+ #
44
+ # See examples and tests {TestKyaniteStringCast#test_to_integer_optional here}.
45
+ # @return [Integer, String]
46
46
  def to_integer_optional
47
47
  return nil if self.empty?
48
48
  return self unless (self =~ /^\d/ || self =~ /^-\d/ )
49
49
  return self.to_i
50
50
  end
51
51
 
52
-
52
+
53
+ # Non-empty strings are returned.
54
+ # Empty strings are converted to +nil+.
55
+ # @return [String, Nil]
53
56
  def to_nil
54
57
  return self unless self.empty?
55
58
  nil
@@ -59,12 +62,14 @@ class String
59
62
 
60
63
 
61
64
  unless defined? HEX_CHARS
65
+ # @private
62
66
  HEX_CHARS = '0123456789abcdef'.freeze
63
67
  end
64
68
 
65
69
 
66
70
  # Get a hex representation for a char.
67
- # See also String#from_x.
71
+ # See also {#from_x from_x}.
72
+ # @return [String]
68
73
  def to_x
69
74
  hex = ''
70
75
  each_byte { |byte|
@@ -76,8 +81,11 @@ class String
76
81
  hex
77
82
  end
78
83
 
84
+
85
+
79
86
  # Get a char for a hex representation.
80
- # See also String#to_x.
87
+ # See also {#to_x to_x}.
88
+ # @return [String]
81
89
  def from_x
82
90
  str, q, first = '', 0, false
83
91
  each_byte { |byte|
@@ -100,16 +108,32 @@ class String
100
108
 
101
109
  end
102
110
 
103
- if defined? TransparentNil
104
- class NilClass
105
- def to_identifier; nil; end
106
- def to_integer; nil; end
107
- def to_integer_optional; nil; end
108
- def to_nil(*a); nil; end
109
- def to_x; nil; end
110
- def from_x; nil; end
111
- end
111
+
112
+ # @!endgroup
113
+
114
+ class NilClass
115
+ def to_identifier; nil; end
116
+ def to_integer; nil; end
117
+ def to_integer_optional; nil; end
118
+ def to_nil(*a); nil; end
119
+ def to_x; nil; end
120
+ def from_x; nil; end
112
121
  end
113
122
 
114
123
 
124
+ class Integer
125
+
126
+
127
+ # +self+, complements {String#to_integer}.
128
+ # @return [self]
129
+ def to_integer; self; end
130
+
131
+
132
+ # +self+, complements {String#to_integer_optional}.
133
+ # @return [self]
134
+ def to_integer_optional; self; end
135
+
136
+
137
+ end # class
138
+
115
139
 
@@ -1,50 +1,50 @@
1
1
  # ruby encoding: utf-8
2
+ # ü
2
3
  if $0 == __FILE__
3
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'smart_load_path.rb' )
4
- smart_load_path
4
+ require 'drumherum'
5
+ smart_init
5
6
  end
6
7
 
8
+
7
9
  require 'kyanite/string/chars_const'
8
10
 
9
-
10
- unless defined? MYSQL_REPLACES
11
- MYSQL_REPLACES = [
12
- [/ä/, 'a'],
13
- [/ö/, 'o'],
14
- [/ü/, 'u'],
15
- [/Ä/, 'a'],
16
- [/Ö/, 'o'],
17
- [/Ü/, 'u'],
18
- [/ss/, 'ß'],
19
- [/SS/, 'ß']
20
- ]
21
- end
22
-
23
-
24
-
25
-
11
+
26
12
 
27
13
 
28
14
  class String
29
15
 
16
+ unless defined? MYSQL_REPLACES
17
+ MYSQL_REPLACES = [
18
+ [/ä/, 'a'],
19
+ [/ö/, 'o'],
20
+ [/ü/, 'u'],
21
+ [/Ä/, 'a'],
22
+ [/Ö/, 'o'],
23
+ [/Ü/, 'u'],
24
+ [/ss/, 'ß'],
25
+ [/SS/, 'ß']
26
+ ]
27
+ end
28
+
30
29
  # ---------------------------------------------------------------------------------------------------------------------------------
31
- # :section: Clear / Format Text
30
+ # @!group Clear / Format Text
32
31
  # See TestKyaniteStringChars for tests and examples.
33
32
 
34
- # Reduziert den String auf ein Base94-Encoding.
35
- # * Wandelt àáâăäãāåạąæảấầắằÀÁÂĂÄÃĀÅẠĄÆẢẤẦẮẰ usw. in aaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAA usw. um
36
- # * entfernt anschließend alle Nicht-Asciizeichen
37
- # * entfernt außerdem alle nichtdruckbaren Asciizeichen
38
- # * Vorsicht: Newlines werden auch entfernt
33
+ # Reduces the string to a base94 encoding.
34
+ # 1. Converts àáâăäãāåạąæảấầắằÀÁÂĂÄÃĀÅẠĄÆẢẤẦẮẰ etc. to aaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAA.
35
+ # 2. Then removes all non-Ascii-chars.
36
+ # 3. Then removes all non-printable Ascii-chars.
37
+ # 4. Caution: Also Newlines are removed.
39
38
  #
40
- # See TestKyaniteStringChars for tests and examples.
41
- #
39
+ # See tests and examples {TestKyaniteStringChars#test_reduce94_a here}.
40
+ # @return [String]
42
41
  def reduce94( options={} )
43
42
  dup.reduce94!(options)
44
43
  end
45
44
 
46
- # See TestKyaniteStringChars for tests and examples.
47
- #
45
+
46
+ # In-place-variant of {#reduce94 reduce94}.
47
+ # @return [String]
48
48
  def reduce94!( options={} )
49
49
  self.gsub!( 'ß', options[:german_sz] ) if options[:german_sz]
50
50
  self.tr!(TR_FULL, TR_REDUCED)
@@ -59,12 +59,23 @@ class String
59
59
  #
60
60
  # See TestKyaniteStringChars for tests and examples.
61
61
  #
62
+
63
+ # Reduces the string to a base53 encoding.
64
+ # The result consists only uppercase letters, minus, and lowercase characters as replacement for some known special characters.
65
+ # 1. Removes all non-letter-chars.
66
+ # 2. Converts all regular letters to upcase letters.
67
+ # 3. Converts special letters to reduced downcase letters, eg. àáâăäãāåạąæảấầắằÀÁÂĂÄÃĀÅẠĄÆẢẤẦẮẰ etc. to aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
68
+ # 4. Caution: Also Newlines are removed.
69
+ #
70
+ # See tests and examples {TestKyaniteStringChars#test_reduce53_a here}.
71
+ # @return [String]
62
72
  def reduce53( options={} )
63
73
  dup.reduce53!(options)
64
74
  end
65
75
 
66
- # See TestKyaniteStringChars for tests and examples.
67
- #
76
+
77
+ # In-place-variant of {#reduce53 reduce53}.
78
+ # @return [String]
68
79
  def reduce53!( options={} )
69
80
 
70
81
  if options[:camelcase]
@@ -114,43 +125,59 @@ class String
114
125
 
115
126
 
116
127
  # ---------------------------------------------------------------------------------------------------------------------------------
117
- # :section: Groß- und Kleinschreibung
128
+ # @!group Upcase and Downcase with support for special letters like german umlauts
118
129
  # See TestKyaniteStringChars for tests and examples.
119
130
  #
120
131
 
121
- # Ein Überschreiben von downcase führt in Kombination mit ActiveSupport zu seltsamen Ergebnissen!
132
+ # Better +downcase+: also works with special letters like german umlauts.
133
+ # (If you overwrite downcase you will get strange results if you use Active Support.)
134
+ #
135
+ # See tests and examples {TestKyaniteStringChars#test_downcase_upcase here}.
136
+ # @return [String]
122
137
  def downcase2
123
138
  self.tr(TR_UPCASE, TR_DOWNCASE).downcase
124
139
  end
125
140
 
141
+ # In-place-variant of {#downcase2 downcase2}.
142
+ # @return [String]
126
143
  def downcase2!
127
144
  self.tr!(TR_UPCASE, TR_DOWNCASE).downcase!
128
145
  end
129
146
 
130
147
 
131
- # Ein Überschreiben von upcase führt in Kombination mit ActiveSupport zu seltsamen Ergebnissen!
148
+ # Better +upcase+: also works with special letters like german umlauts.
149
+ # (If you overwrite upcase you will get strange results if you use Active Support.)
150
+ #
151
+ # See tests and examples {TestKyaniteStringChars#test_downcase_upcase here}.
152
+ # @return [String]
132
153
  def upcase2
133
154
  self.tr(TR_DOWNCASE, TR_UPCASE).upcase
134
155
  end
135
156
 
157
+ # In-place-variant of {#upcase2 upcase2}.
158
+ # @return [String]
136
159
  def upcase2!
137
160
  self.tr!(TR_DOWNCASE, TR_UPCASE).upcase!
138
161
  end
139
162
 
163
+ # Converts the first letter to upcase, also works with special letters like german umlauts.
164
+ # @return [String]
140
165
  def capitalize
141
166
  (slice(0) || '').upcase2 + (slice(1..-1) || '').downcase2
142
167
  end
143
168
 
144
169
 
145
- # Erster Buchstabe groß?
170
+ # Is the first letter upcase? Also works with special letters like german umlauts.
146
171
  def capitalized?
147
172
  self =~ TR_UPCASE_ALL_REGEXP
148
173
  end
149
174
 
175
+ # Is the string upcase? Also works with special letters like german umlauts.
150
176
  def upcase?
151
177
  (self == self.upcase)
152
178
  end
153
179
 
180
+ # Is the string downcase? Also works with special letters like german umlauts.
154
181
  def downcase?
155
182
  (self == self.upcase)
156
183
  end
@@ -186,8 +213,11 @@ if $0 == __FILE__ then
186
213
  #require 'perception'
187
214
 
188
215
  #puts "Hallo"
189
- puts 'Scheiße'.reduce94(:german_sz => 'z')
216
+ # puts 'Scheiße'.reduce94(:german_sz => 'z')
217
+ test_down = 'àáâăäãāåạąæảấầắằабćĉčçċцчďðđдèéêěĕëēėęếеэфĝğġģгĥħхìíîĭïĩīıįijийĵюяķкĺľłļŀлмńňñņŋнòóôŏöõōøőơœопŕřŗрśŝšşсшщţťŧþтùúûŭüũūůűųưувŵýŷÿźżžжз'
218
+ test_up = 'ÀÁÂĂÄÃĀÅẠĄÆẢẤẦẮẰАБĆĈČÇĊЦЧĎÐĐДÈÉÊĚĔËĒĖĘẾЕЭФĜĞĠĢГĤĦХÌÍÎĬÏĨĪİĮIJИЙĴЮЯĶКĹĽŁĻĿЛМŃŇÑŅŊНÒÓÔŎÖÕŌØŐƠŒОПŔŘŖРŚŜŠŞСШЩŢŤŦÞТÙÚÛŬÜŨŪŮŰŲƯУВŴÝŶŸŹŻŽЖЗ'
190
219
 
220
+ puts "hallo".upcase!
191
221
 
192
222
 
193
223
  end
@@ -1,10 +1,11 @@
1
1
  # ruby encoding: utf-8
2
-
2
+ # ü
3
3
  if $0 == __FILE__
4
- require File.join(File.dirname(__FILE__), '..', '..', '..', 'smart_load_path.rb' )
5
- smart_load_path
4
+ require 'drumherum'
5
+ smart_init
6
6
  end
7
7
 
8
+
8
9
  require 'hashery'
9
10
  require 'kyanite/string/div'
10
11
 
@@ -1,16 +1,23 @@
1
- # ruby encoding: utf-8
1
+ # ruby encoding: utf-8
2
2
 
3
+ if $0 == __FILE__
4
+ require 'drumherum'
5
+ smart_init
6
+ end
3
7
 
4
- class String
5
8
 
9
+
10
+ class String
11
+
12
+ # @!group Overlap / Diff
13
+
6
14
 
7
- # ---------------------------------------------------------------------------------------------------------------------------------
8
- # :section: Overlap / Diff
9
- # See TestKyaniteStringDiff for tests and examples.
10
-
11
- # Gibt den gemeinsamen Teil zweier Strings aus (von vorne gezählt).
15
+ # Returns the mutual part of two strings. Example:
16
+ # "Hello world".overlap("Hello darling")
17
+ # => "Hello"
12
18
  #
13
- # Beispiele & Tests siehe TestKyaniteStringDiff#test_overlap
19
+ # See more examples and tests {TestKyaniteStringDiff#test_overlap here}.
20
+ # @return [String] mutual part
14
21
  def overlap(b)
15
22
  return '' if b.nil?
16
23
  b = b.to_str
@@ -22,18 +29,22 @@ class String
22
29
  end
23
30
 
24
31
 
25
- # Liefert den Unterschied zwischen zwei Strings zurück.
26
- # Im Zweifelsfall immer den längsten String.
27
- # Wenn dann immer noch Zweifel, dann self.
28
- #
29
- # Beispiele & Tests siehe TestKyaniteStringDiff#test_diff
32
+ # Returns the differencing part of two strings. Example:
33
+ # "Hello darling".diff("Hello")
34
+ # => " darling"
35
+ #
36
+ # When in doubt, the longest differencing string.
37
+ # If there is still doubt, then +self+.
38
+ #
39
+ # See more examples and tests {TestKyaniteStringDiff#test_diff here}.
40
+ # @return [String] differencing part
30
41
  def diff(b)
31
42
  return self if b.nil?
32
43
  b = b.to_str
33
44
  return '' if self == b # kein Unterschied
34
45
 
35
46
  a = self
36
- a,b = b,a if a.size >= b.size # a ist jetzt krzer oder gleichlang wie b
47
+ a,b = b,a if a.size >= b.size # a ist jetzt k?rzer oder gleichlang wie b
37
48
  overlap = a.overlap(b)
38
49
  return self if overlap == ''
39
50
  return b.split(overlap)[1]
@@ -41,19 +52,24 @@ class String
41
52
 
42
53
 
43
54
 
44
- # Liefert zugleich overlap und diff zurück.
45
- # Symmetrie: Rechnet man overlap + diff, so erhält man immer den längsten der beiden ursprünglichen Strings.
46
- # Waren beide gleichlang, so erhält man self.
55
+
47
56
  # overlapdiff braucht genauso viel Zeit wie diff alleine.
57
+
58
+ # Returns {#diff diff} and {#overlap overlap} in one array.
59
+ # Takes as much time as +diff+ alone.
60
+ #
61
+ # Symmetry: If we add +overlap+ + +diff+, we always get the longest of the two original strings.
62
+ # If both had the same length, we get +self+.
48
63
  #
49
- # Beispiele & Tests siehe TestKyaniteStringDiff#test_overlapdiff
64
+ # See examples and tests {TestKyaniteStringDiff#test_overlapdiff here}.
65
+ # @return [Array] mutual part, differencing part
50
66
  def overlapdiff(b)
51
67
  return '', self if b.nil?
52
68
  b = b.to_str
53
69
  return self,'' if self == b # kein Unterschied
54
70
 
55
71
  a = self
56
- a,b = b,a if a.size >= b.size # a ist jetzt krzer oder gleichlang wie b
72
+ a,b = b,a if a.size >= b.size # a ist jetzt k?rzer oder gleichlang wie b
57
73
  overlap = a.overlap(b)
58
74
  return overlap, self if overlap == ''
59
75
  return overlap, b.split(overlap)[1]
@@ -64,24 +80,38 @@ class String
64
80
  end
65
81
 
66
82
 
67
- if defined? TransparentNil
68
- class NilClass
69
-
70
- # Rückgabe: Leerer String,
71
- # siehe String#overlap
72
- def overlap(*a); ''; end
73
-
74
- # Rückgabe: b,
75
- # siehe String#diff
76
- def diff(b); b; end
77
-
78
- # Rückgabe: ['', b],
79
- # siehe String#overlapdiff
80
- def overlapdiff(b); ['', b]; end
81
- end
83
+
84
+ class NilClass
85
+
86
+ # see {String#overlap}
87
+ # @return [String] Empty String
88
+ def overlap(*a); ''; end
89
+
90
+
91
+ # see {String#diff}
92
+ # @return [String] Parameter b
93
+ def diff(b); b; end
94
+
95
+
96
+ # see {String#overlapdiff}
97
+ # @return [Array] ['', b]
98
+ def overlapdiff(b); ['', b]; end
82
99
  end
83
100
 
84
101
 
102
+ # -----------------------------------------------------------------------------------------
103
+ # Ausprobieren
104
+ #
105
+ if $0 == __FILE__ then
106
+
107
+ puts "Hello darling".diff("Hello")
108
+
109
+
110
+
111
+
112
+
113
+
114
+ end
85
115
 
86
116
 
87
117