kyanite 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,16 +1,15 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/string/nested'
10
9
 
11
10
 
12
11
  # Tests for String
13
- #
12
+ # @!macro string
14
13
  class TestKyaniteStringNested < UnitTest
15
14
 
16
15
  def test_010_anti
@@ -1,17 +1,16 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/string/split'
10
9
 
11
10
 
12
11
 
13
12
  # Tests for String
14
- #
13
+ # @!macro string
15
14
  class TestKyaniteStringSplit < UnitTest
16
15
 
17
16
  def test_nchar
@@ -107,6 +106,12 @@ class TestKyaniteStringSplit < UnitTest
107
106
  end
108
107
 
109
108
 
109
+ def test_extract
110
+ string = '<select id="hello"><option value="0">none</option></select>'
111
+ assert_equal 'hello', string.extract( /select.*?id="/ , '"' )
112
+ end
113
+
114
+
110
115
  def test_fixsize
111
116
  test = 'Hallo'
112
117
  0.upto(10) do |i|
@@ -1,16 +1,14 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/dictionary'
10
9
 
11
10
 
12
- # Tests for Dictionary
13
- #
11
+ # @!macro dictionary
14
12
  class TestKyaniteDictionary < UnitTest
15
13
 
16
14
  def test_is_collection
data/test/test_hash.rb CHANGED
@@ -1,15 +1,13 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/hash'
10
9
 
11
- # Tests for Hash
12
- #
10
+ # @!macro hash
13
11
  class TestKyaniteHash < UnitTest
14
12
 
15
13
 
@@ -21,7 +19,7 @@ class TestKyaniteHash < UnitTest
21
19
  h[1] = 10
22
20
  assert_equal ({ 1 => 10 }), h
23
21
 
24
- h.delete(1)
22
+ assert_equal 10, h.delete(1)
25
23
  assert_equal ({}), h
26
24
  end
27
25
 
@@ -1,15 +1,14 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/optimizer'
10
9
 
11
10
 
12
- # Tests for Optimizer
11
+ # @!macro optimizer
13
12
  class TestKyaniteOptimizer < UnitTest
14
13
 
15
14
 
data/test/test_range.rb CHANGED
@@ -1,36 +1,35 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/range'
10
9
 
11
10
 
12
- # Tests for Range
11
+ # @!macro range
13
12
  class TestKyaniteRange < UnitTest
14
13
 
15
14
 
16
15
 
17
16
  def test_invert
18
17
 
19
- # leeres Teil ausgeben
18
+ # return empty
20
19
  assert_equal (1..0), (0..-1).invert_index
21
20
 
22
- # vorderen Teil ausgeben
21
+ # return front
23
22
  assert_equal (0..1), (2..-1).invert_index
24
23
  assert_equal (0..2), (3..-1).invert_index
25
24
  assert_equal (0..-3), (-2..-1).invert_index
26
25
 
27
- # hinteren Teil ausgeben
26
+ # return back
28
27
  assert_equal (2..-1), (0..1).invert_index
29
28
  assert_equal (6..-1), (0..5).invert_index
30
29
  assert_equal (-1..-1), (0..-2).invert_index
31
30
  assert_equal (-2..-1), (0..-3).invert_index
32
31
 
33
- # außen
32
+ # return outer
34
33
  assert_equal [0..1, 5..-1], (2..4).invert_index
35
34
  assert_equal [0..-6, -2..-1], (-5..-3).invert_index
36
35
  assert_equal [0..1, -2..-1], (2..-3).invert_index
data/test/test_set.rb CHANGED
@@ -1,18 +1,18 @@
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
-
8
- require 'transparent_nil' unless defined? TransparentNil
9
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
8
+ require 'transparent_nil' unless defined? TransparentNil
10
9
  require 'kyanite/set'
11
10
 
12
11
 
13
12
 
14
- # Tests für Set, OrderedSet, SortedSet
15
- #
13
+ # @!group Set
14
+
15
+ # @!macro set
16
16
  class TestKyaniteSet < UnitTest
17
17
 
18
18
 
data/test/test_tree.rb CHANGED
@@ -1,18 +1,17 @@
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
-
8
- require 'kyanite/unit_test'
7
+ require 'drumherum/unit_test'
9
8
  require 'kyanite/tree'
10
9
  require 'kyanite/symbol'
11
10
 
12
11
 
13
12
 
14
13
 
15
- # Tests for Tree::TreeNode
14
+ # @!macro tree
16
15
  class TestKyaniteTree < UnitTest
17
16
 
18
17
  def setup
@@ -55,15 +54,13 @@ class TestKyaniteTree < UnitTest
55
54
  ttroot_hash = {}
56
55
  ttroot_hash[:de] = ttroot
57
56
 
58
- @tokenizer_tree_root = ttroot_hash
59
-
60
-
57
+ @tokenizer_tree_root = ttroot_hash
61
58
  end
62
59
 
63
60
 
64
61
 
65
62
 
66
- def pest_allkeys
63
+ def test_allkeys
67
64
 
68
65
  assert_equal [ :singlechar,
69
66
  :ta_item,
data/version.rb ADDED
@@ -0,0 +1,8 @@
1
+
2
+
3
+ module Kyanite
4
+
5
+ VERSION = '0.7.0'
6
+
7
+ end
8
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kyanite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2012-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: drumherum
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.1.19
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.1.19
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: transparent_nil
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -18,7 +34,7 @@ dependencies:
18
34
  requirements:
19
35
  - - ! '>='
20
36
  - !ruby/object:Gem::Version
21
- version: 0.1.0
37
+ version: 0.1.7
22
38
  type: :runtime
23
39
  prerelease: false
24
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +42,7 @@ dependencies:
26
42
  requirements:
27
43
  - - ! '>='
28
44
  - !ruby/object:Gem::Version
29
- version: 0.1.0
45
+ version: 0.1.7
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: activesupport
32
48
  requirement: !ruby/object:Gem::Requirement
@@ -113,24 +129,22 @@ email:
113
129
  executables: []
114
130
  extensions: []
115
131
  extra_rdoc_files:
116
- - History.txt
117
- - License.txt
132
+ - History.rdoc
133
+ - License.rdoc
118
134
  - Manifest.txt
119
- - README.txt
135
+ - README.rdoc
120
136
  files:
121
137
  - console.rb
122
138
  - Div
123
- - History.txt
124
- - License.txt
139
+ - History.rdoc
140
+ - License.rdoc
125
141
  - Manifest.txt
126
- - README.txt
142
+ - README.rdoc
127
143
  - Rakefile.rb
128
144
  - init.rb
145
+ - version.rb
129
146
  - lib/kyanite.rb
130
147
  - lib/kyanite/array.rb
131
- - lib/kyanite/array/array.rb
132
- - lib/kyanite/array/array2.rb
133
- - lib/kyanite/array/matrix2.rb
134
148
  - lib/kyanite/array_of_enumerables.rb
135
149
  - lib/kyanite/array_of_numerics.rb
136
150
  - lib/kyanite/array_of_strings.rb
@@ -149,42 +163,28 @@ files:
149
163
  - lib/kyanite/general/true_false.rb
150
164
  - lib/kyanite/general/undoable.rb
151
165
  - lib/kyanite/hash.rb
152
- - lib/kyanite/hoe.rb
153
- - lib/kyanite/matrix2.rb
154
166
  - lib/kyanite/numeric.rb
155
167
  - lib/kyanite/numeric/float.rb
156
168
  - lib/kyanite/numeric/integer.rb
157
- - lib/kyanite/numeric/numeric.rb
158
- - lib/kyanite/operation.rb
159
- - lib/kyanite/operation/call_tracker.rb
160
- - lib/kyanite/operation/hoe.rb
161
- - lib/kyanite/operation/rake.rb
162
- - lib/kyanite/operation/regexp.rb
163
- - lib/kyanite/operation/unit_test.rb
164
169
  - lib/kyanite/optimizer.rb
165
- - lib/kyanite/rake.rb
166
170
  - lib/kyanite/range.rb
167
171
  - lib/kyanite/set.rb
168
- - lib/kyanite/smart_load_path.rb
169
172
  - lib/kyanite/string.rb
170
173
  - lib/kyanite/string/cast.rb
171
174
  - lib/kyanite/string/chars.rb
172
175
  - lib/kyanite/string/chars_const.rb
173
176
  - lib/kyanite/string/diff.rb
174
- - lib/kyanite/string/div.rb
175
177
  - lib/kyanite/string/include.rb
176
178
  - lib/kyanite/string/list.rb
177
- - lib/kyanite/string/mgsub.rb
179
+ - lib/kyanite/string/misc.rb
178
180
  - lib/kyanite/string/nested.rb
179
181
  - lib/kyanite/string/random.rb
180
182
  - lib/kyanite/string/split.rb
181
183
  - lib/kyanite/symbol.rb
182
184
  - lib/kyanite/tree.rb
183
185
  - lib/kyanite/undoable.rb
184
- - lib/kyanite/unit_test.rb
185
186
  - test/_start_all.rb
186
187
  - test/array/test_array.rb
187
- - test/array/test_matrix2.rb
188
188
  - test/enumerable/test_enumerable_enumerables.rb
189
189
  - test/enumerable/test_enumerable_numerics.rb
190
190
  - test/enumerable/test_enumerable_strings.rb
@@ -197,6 +197,7 @@ files:
197
197
  - test/string/test_chars.rb
198
198
  - test/string/test_diff.rb
199
199
  - test/string/test_list.rb
200
+ - test/string/test_misc.rb
200
201
  - test/string/test_nested.rb
201
202
  - test/string/test_split.rb
202
203
  - test/test_dictionary.rb
@@ -205,14 +206,13 @@ files:
205
206
  - test/test_range.rb
206
207
  - test/test_set.rb
207
208
  - test/test_tree.rb
208
- - test/string/test_mgsub.rb
209
209
  - .gemtest
210
- homepage:
210
+ homepage: http://bklippstein.github.com/kyanite/frames.html
211
211
  licenses: []
212
212
  post_install_message:
213
213
  rdoc_options:
214
214
  - --main
215
- - README.txt
215
+ - README.rdoc
216
216
  require_paths:
217
217
  - lib
218
218
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -235,7 +235,6 @@ specification_version: 3
235
235
  summary: ''
236
236
  test_files:
237
237
  - test/array/test_array.rb
238
- - test/array/test_matrix2.rb
239
238
  - test/enumerable/test_enumerable_enumerables.rb
240
239
  - test/enumerable/test_enumerable_numerics.rb
241
240
  - test/enumerable/test_enumerable_strings.rb
@@ -248,7 +247,7 @@ test_files:
248
247
  - test/string/test_chars.rb
249
248
  - test/string/test_diff.rb
250
249
  - test/string/test_list.rb
251
- - test/string/test_mgsub.rb
250
+ - test/string/test_misc.rb
252
251
  - test/string/test_nested.rb
253
252
  - test/string/test_split.rb
254
253
  - test/test_dictionary.rb
data/README.txt DELETED
@@ -1,47 +0,0 @@
1
- # ruby encoding: utf-8
2
-
3
- = *Kyanite*
4
-
5
- http://bklippstein.github.com/kyanite/
6
-
7
- [ | *Kyanite* | Object | Array | Set | Enumerable | Hash | ] | *Kyanite* | TrueClass | FalseClass | NilClass | Div |
8
- ---
9
-
10
-
11
- == Features
12
- Kyanite is a general toolbox like Facets or ActiveSupport.
13
- * Transparent nil Handling, see NilClass
14
- * Comfortable UnitTests, see Div
15
-
16
-
17
- == Usage
18
- require 'kyanite' # require all
19
- require 'kyanite/basics' # require basic Kyanite behavior and features
20
- require 'kyanite/string' # require all String related stuff
21
- require 'kyanite/string/diff' # require all String#diff related stuff
22
-
23
-
24
- == License
25
- cc-by-sa
26
-
27
- Creative Commons Attribution-Share Alike 3.0 Germany
28
-
29
- http://creativecommons.org/licenses/by-sa/3.0/de/deed.en
30
-
31
-
32
- == Homepage
33
- http://bklippstein.github.com/kyanite/
34
-
35
-
36
- == Author
37
- Björn Klippstein
38
-
39
-
40
- == Disclaimer
41
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
44
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
45
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
46
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
47
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.