kyanite 0.3.7 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/0_rake_test.bat +12 -0
- data/1_rake_install_gem.bat +20 -0
- data/3_rake_deploy.bat +4 -0
- data/4_ruby_script_console.bat +12 -0
- data/Div +23 -0
- data/History.txt +4 -2
- data/License.txt +21 -2
- data/Manifest.txt +46 -29
- data/README.txt +26 -33
- data/Rakefile.rb +6 -6
- data/config/website.yml +2 -0
- data/lib/kyanite.rb +46 -2
- data/lib/kyanite/array/array.rb +15 -14
- data/lib/kyanite/array/array2.rb +1 -1
- data/lib/kyanite/dictionary.rb +17 -2
- data/lib/kyanite/enumerable/enumerable_enumerables.rb +19 -9
- data/lib/kyanite/enumerable/enumerable_numerics.rb +25 -19
- data/lib/kyanite/enumerable/enumerable_strings.rb +14 -6
- data/lib/kyanite/enumerable/structure.rb +45 -29
- data/lib/kyanite/general/callerutils.rb +9 -1
- data/lib/kyanite/general/classutils.rb +59 -78
- data/lib/kyanite/general/kernel.rb +21 -3
- data/lib/kyanite/general/nil.rb +34 -12
- data/lib/kyanite/general/object.rb +25 -3
- data/lib/kyanite/general/true_false.rb +28 -10
- data/lib/kyanite/general/undoable.rb +24 -0
- data/lib/kyanite/hash.rb +43 -28
- data/lib/kyanite/numeric/float.rb +12 -5
- data/lib/kyanite/numeric/integer.rb +16 -9
- data/lib/kyanite/numeric/numeric.rb +19 -11
- data/lib/kyanite/operation/regexp.rb +5 -1
- data/lib/kyanite/optimizer.rb +31 -16
- data/lib/kyanite/range.rb +15 -8
- data/lib/kyanite/set.rb +35 -6
- data/lib/kyanite/string/cast.rb +18 -7
- data/lib/kyanite/string/chars.rb +24 -17
- data/lib/kyanite/string/diff.rb +14 -5
- data/lib/kyanite/string/div.rb +8 -1
- data/lib/kyanite/string/include.rb +13 -5
- data/lib/kyanite/string/list.rb +3 -3
- data/lib/kyanite/string/mgsub.rb +6 -2
- data/lib/kyanite/string/nested.rb +22 -3
- data/lib/kyanite/string/random.rb +4 -0
- data/lib/kyanite/string/split.rb +15 -7
- data/lib/kyanite/symbol.rb +14 -0
- data/lib/kyanite/tree.rb +10 -4
- data/script/console +10 -0
- data/script/console.cmd +1 -0
- data/script/destroy +14 -0
- data/script/destroy.cmd +1 -0
- data/script/generate +14 -0
- data/script/generate.cmd +1 -0
- data/script/txt2html +82 -0
- data/script/txt2html.cmd +1 -0
- data/tasks/deployment.rake +92 -0
- data/tasks/documentation.rake +28 -0
- data/tasks/environment.rake +7 -0
- data/test/array/test_matrix2.rb +1 -0
- data/test/enumerable/test_enumerable_numerics.rb +3 -2
- data/test/general/test_classutils.rb +3 -0
- data/test/general/test_nil.rb +1 -0
- data/test/general/test_object.rb +2 -1
- data/test/general/test_true_false.rb +1 -0
- data/test/numeric/test_numeric_integer.rb +2 -0
- data/test/string/test_cast.rb +4 -0
- data/test/string/test_chars.rb +3 -0
- data/test/string/test_diff.rb +3 -0
- data/test/string/test_list.rb +2 -0
- data/test/string/test_nested.rb +2 -0
- data/test/string/test_split.rb +3 -0
- data/test/test_dictionary.rb +3 -0
- data/test/test_hash.rb +2 -0
- data/test/test_optimizer.rb +14 -14
- data/test/test_range.rb +1 -0
- data/test/test_tree.rb +1 -1
- metadata +48 -31
data/script/txt2html.cmd
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
@ruby script/txt2html %*
|
@@ -0,0 +1,92 @@
|
|
1
|
+
|
2
|
+
# Task :install_gem_no_doc
|
3
|
+
#
|
4
|
+
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
5
|
+
task :install_gem_no_doc => [:clean, :package] do
|
6
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
# Task :publish_docs korrigieren
|
12
|
+
#
|
13
|
+
remove_task :publish_docs
|
14
|
+
desc 'Publish RDoc to RubyForge.'
|
15
|
+
task :publish_docs => [:clean, :docs] do
|
16
|
+
#task :publish_docs do
|
17
|
+
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
|
18
|
+
host = "#{config["username"]}@rubyforge.org"
|
19
|
+
remote_dir = "/var/www/gforge-projects/#{$hoe.rubyforge_name}"
|
20
|
+
local_dir = 'doc'
|
21
|
+
sh %{rsync #{$hoe.rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# Task :release korrigieren
|
27
|
+
# no explicit version needed
|
28
|
+
#
|
29
|
+
remove_task :release
|
30
|
+
desc 'Package and upload the actual version to rubyforge.'
|
31
|
+
task :release => [:clean, :package] do |t|
|
32
|
+
pkg = "pkg/#{$hoe.name}-#{Kyanite::VERSION}"
|
33
|
+
rf = RubyForge.new.configure
|
34
|
+
puts "Logging in"
|
35
|
+
rf.login
|
36
|
+
c = rf.userconfig
|
37
|
+
c["release_notes"] = $hoe.description if $hoe.description
|
38
|
+
c["release_changes"] = $hoe.changes if $hoe.changes
|
39
|
+
c["preformatted"] = true
|
40
|
+
|
41
|
+
files = ["#{pkg}.tgz", "#{pkg}.gem"].compact
|
42
|
+
puts "Releasing #{$hoe.name} #{Kyanite::VERSION}"
|
43
|
+
rf.add_release $hoe.rubyforge_name, $hoe.name, Kyanite::VERSION, *files
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
# Task :post_news korrigieren
|
48
|
+
#
|
49
|
+
remove_task :post_news
|
50
|
+
desc 'Post news to rubyforge.'
|
51
|
+
task :post_news do
|
52
|
+
require 'rubyforge'
|
53
|
+
rf = RubyForge.new.configure
|
54
|
+
rf.login
|
55
|
+
rf.post_news( $hoe.rubyforge_name,
|
56
|
+
"#{$hoe.name} #{Kyanite::VERSION} Released", # subject
|
57
|
+
"#{$hoe.description}\n\nCheck at http://#{$hoe.rubyforge_name}.rubyforge.org".rdoc_to_markdown
|
58
|
+
)
|
59
|
+
puts "News posted to rubyforge"
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
# Task :deploy
|
70
|
+
# alles auf einmal
|
71
|
+
#
|
72
|
+
desc 'publish_docs, release, post_news'
|
73
|
+
task :deploy => [:publish_docs, :sleep_5, :release, :sleep_5, :post_news, :sleep_5 ] do
|
74
|
+
puts
|
75
|
+
puts "#{$hoe.name}-#{Kyanite::VERSION} deployed."
|
76
|
+
puts "Check at http://#{$hoe.rubyforge_name}.rubyforge.org"
|
77
|
+
# puts "Remember to create SVN tag:"
|
78
|
+
# puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
79
|
+
# "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
80
|
+
# puts "Suggested comment:"
|
81
|
+
# puts "Tagging release #{CHANGES}"
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
namespace :manifest do
|
88
|
+
desc 'Recreate Manifest.txt to include ALL files'
|
89
|
+
task :refresh do
|
90
|
+
`rake check_manifest | patch -p0 > Manifest.txt`
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
# ----------------------------------------------------------------------------------------------
|
3
|
+
# Documentation
|
4
|
+
#
|
5
|
+
# http://github.com/mislav/hanna/tree/master
|
6
|
+
|
7
|
+
# instead of 'rake/rdoctask':
|
8
|
+
require 'hanna/rdoctask'
|
9
|
+
|
10
|
+
desc 'Generate RDoc documentation for Kyanite'
|
11
|
+
Rake::RDocTask.new do |rdoc|
|
12
|
+
rdoc.rdoc_dir = 'doc'
|
13
|
+
rdoc.title = "Kyanite - #{$hoe.summary}"
|
14
|
+
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
+
rdoc.rdoc_files.include('test/**/test_*.rb')
|
17
|
+
rdoc.rdoc_files.include('README.txt', 'License.txt', 'Div')
|
18
|
+
|
19
|
+
rdoc.rdoc_files.exclude('lib/kyanite/array/array2')
|
20
|
+
rdoc.rdoc_files.exclude('lib/kyanite/array/matrix2')
|
21
|
+
rdoc.rdoc_files.exclude('lib/kyanite/operation/call_tracker')
|
22
|
+
#rdoc.rdoc_files.exclude('lib/kyanite.rb')
|
23
|
+
rdoc.options += [
|
24
|
+
'-SNapUq',
|
25
|
+
'-w4',
|
26
|
+
'--charset=utf8',
|
27
|
+
]
|
28
|
+
end
|
data/test/array/test_matrix2.rb
CHANGED
@@ -15,7 +15,7 @@ end
|
|
15
15
|
class TestKyaniteEnumerableNumerics < UnitTest
|
16
16
|
|
17
17
|
|
18
|
-
def
|
18
|
+
def test_01_sum
|
19
19
|
assert_equal 2, [2].summation
|
20
20
|
assert_equal 4, [2,2].summation
|
21
21
|
assert_equal 6, [2,2,2].summation
|
@@ -25,11 +25,12 @@ class TestKyaniteEnumerableNumerics < UnitTest
|
|
25
25
|
|
26
26
|
|
27
27
|
|
28
|
-
def
|
28
|
+
def test_01_prd
|
29
29
|
assert_equal 2, [2].prd
|
30
30
|
assert_equal 6, [2,3].prd
|
31
31
|
assert_equal -12, [2,2,-3].prd
|
32
32
|
assert_equal 1, [0.5,0.5,2,2].prd
|
33
|
+
assert_equal 5000, [50, 100].prd
|
33
34
|
end
|
34
35
|
|
35
36
|
|
data/test/general/test_nil.rb
CHANGED
data/test/general/test_object.rb
CHANGED
@@ -5,12 +5,14 @@ require 'perception' if $0 == __FILE__
|
|
5
5
|
|
6
6
|
require 'kyanite/numeric'
|
7
7
|
|
8
|
+
# Tests for Numeric
|
8
9
|
class TestKyaniteNumeric < UnitTest
|
9
10
|
|
10
11
|
# ---------------------------------------------------------------------------------------------------------------------------------
|
11
12
|
# :section: Integer
|
12
13
|
#
|
13
14
|
|
15
|
+
# Tests for Integer
|
14
16
|
def test_integer_triviales
|
15
17
|
a = 1
|
16
18
|
assert_equal Fixnum, a.class
|
data/test/string/test_cast.rb
CHANGED
data/test/string/test_chars.rb
CHANGED
@@ -6,6 +6,9 @@ require 'perception' if $0 == __FILE__
|
|
6
6
|
require 'kyanite/string/chars'
|
7
7
|
|
8
8
|
|
9
|
+
|
10
|
+
# Tests for String
|
11
|
+
#
|
9
12
|
class TestKyaniteStringChars < UnitTest
|
10
13
|
|
11
14
|
# ---------------------------------------------------------------------------------------------------------------------------------
|
data/test/string/test_diff.rb
CHANGED
data/test/string/test_list.rb
CHANGED
data/test/string/test_nested.rb
CHANGED
data/test/string/test_split.rb
CHANGED
data/test/test_dictionary.rb
CHANGED
data/test/test_hash.rb
CHANGED
data/test/test_optimizer.rb
CHANGED
@@ -6,7 +6,7 @@ require 'perception' if $0 == __FILE__
|
|
6
6
|
require 'kyanite/optimizer'
|
7
7
|
|
8
8
|
|
9
|
-
|
9
|
+
# Tests for Optimizer
|
10
10
|
class TestKyaniteOptimizer < UnitTest
|
11
11
|
|
12
12
|
|
@@ -20,24 +20,24 @@ class TestKyaniteOptimizer < UnitTest
|
|
20
20
|
test.push 6, 'noch ein maximum'
|
21
21
|
test.push 0, 'blubb'
|
22
22
|
assert_equal 'minimum', test.content_min
|
23
|
-
assert_equal -1, test.
|
23
|
+
assert_equal -1, test.score_min
|
24
24
|
assert_equal 'maximum', test.content_max
|
25
|
-
assert_equal 6, test.
|
25
|
+
assert_equal 6, test.score_max
|
26
26
|
|
27
27
|
assert_equal true, test.delete_min
|
28
28
|
assert_equal 'blubb', test.content_min
|
29
|
-
assert_equal 0, test.
|
29
|
+
assert_equal 0, test.score_min
|
30
30
|
assert_equal 'maximum', test.content_max
|
31
|
-
assert_equal 6, test.
|
31
|
+
assert_equal 6, test.score_max
|
32
32
|
|
33
33
|
assert_equal true, test.delete_max
|
34
34
|
assert_equal 'eintrag', test.content_max
|
35
|
-
assert_equal 5, test.
|
35
|
+
assert_equal 5, test.score_max
|
36
36
|
assert_equal 'blubb', test.content_min
|
37
|
-
assert_equal 0, test.
|
37
|
+
assert_equal 0, test.score_min
|
38
38
|
test.push 6, 'maximum'
|
39
39
|
assert_equal 'maximum', test.content_max
|
40
|
-
assert_equal 6, test.
|
40
|
+
assert_equal 6, test.score_max
|
41
41
|
end
|
42
42
|
|
43
43
|
|
@@ -57,7 +57,7 @@ class TestKyaniteOptimizer < UnitTest
|
|
57
57
|
assert_equal 'noch ein minimum', test.content_min(1)
|
58
58
|
assert_equal ['minimum',
|
59
59
|
'noch ein minimum'], test.content_min(0..-1)
|
60
|
-
assert_equal -1, test.
|
60
|
+
assert_equal -1, test.score_min
|
61
61
|
assert_equal 'maximum', test.content_max(0..0)
|
62
62
|
assert_equal 'maximum', test.content_max(0)
|
63
63
|
assert_equal 'noch ein maximum', test.content_max(1..1)
|
@@ -66,16 +66,16 @@ class TestKyaniteOptimizer < UnitTest
|
|
66
66
|
'noch ein maximum'], test.content_max(0..1)
|
67
67
|
# assert_equal ['noch ein maximum',
|
68
68
|
# 'maximum'], test.content_max(1..0)
|
69
|
-
assert_equal 6, test.
|
69
|
+
assert_equal 6, test.score_max
|
70
70
|
end
|
71
71
|
|
72
72
|
|
73
73
|
def test_leer
|
74
74
|
test = Optimizer.new
|
75
75
|
assert_equal nil, test.content_min
|
76
|
-
assert_equal nil, test.
|
76
|
+
assert_equal nil, test.score_min
|
77
77
|
assert_equal nil, test.content_max
|
78
|
-
assert_equal nil, test.
|
78
|
+
assert_equal nil, test.score_max
|
79
79
|
end
|
80
80
|
|
81
81
|
|
@@ -106,9 +106,9 @@ class TestKyaniteOptimizer < UnitTest
|
|
106
106
|
assert_equal 2, test.size
|
107
107
|
|
108
108
|
assert_equal 'minimum', test.content_min[0]
|
109
|
-
assert_equal -1, test.
|
109
|
+
assert_equal -1, test.score_min
|
110
110
|
assert_equal 'maximum', test.content_max[0]
|
111
|
-
assert_equal 6, test.
|
111
|
+
assert_equal 6, test.score_max
|
112
112
|
end
|
113
113
|
|
114
114
|
|
data/test/test_range.rb
CHANGED
data/test/test_tree.rb
CHANGED
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bjoern Klippstein
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-13 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 1.8.0
|
64
64
|
version:
|
65
|
-
description:
|
65
|
+
description: ""
|
66
66
|
email: bjoernklippstein@gmail.com
|
67
67
|
executables: []
|
68
68
|
|
@@ -74,14 +74,34 @@ extra_rdoc_files:
|
|
74
74
|
- Manifest.txt
|
75
75
|
- README.txt
|
76
76
|
files:
|
77
|
+
- 0_rake_test.bat
|
78
|
+
- 1_rake_install_gem.bat
|
79
|
+
- 3_rake_deploy.bat
|
80
|
+
- 4_ruby_script_console.bat
|
81
|
+
- Div
|
82
|
+
- History.txt
|
83
|
+
- License.txt
|
84
|
+
- Manifest.txt
|
85
|
+
- README.txt
|
86
|
+
- Rakefile.rb
|
87
|
+
- config/website.yml
|
88
|
+
- init.rb
|
77
89
|
- lib/kyanite.rb
|
78
|
-
- lib/kyanite/array
|
90
|
+
- lib/kyanite/array.rb
|
79
91
|
- lib/kyanite/array/array.rb
|
92
|
+
- lib/kyanite/array/array2.rb
|
80
93
|
- lib/kyanite/array/matrix2.rb
|
94
|
+
- lib/kyanite/array_of_enumerables.rb
|
95
|
+
- lib/kyanite/array_of_numerics.rb
|
96
|
+
- lib/kyanite/array_of_strings.rb
|
97
|
+
- lib/kyanite/basics.rb
|
98
|
+
- lib/kyanite/dictionary.rb
|
99
|
+
- lib/kyanite/enumerable.rb
|
81
100
|
- lib/kyanite/enumerable/enumerable_enumerables.rb
|
82
101
|
- lib/kyanite/enumerable/enumerable_numerics.rb
|
83
102
|
- lib/kyanite/enumerable/enumerable_strings.rb
|
84
103
|
- lib/kyanite/enumerable/structure.rb
|
104
|
+
- lib/kyanite/general.rb
|
85
105
|
- lib/kyanite/general/callerutils.rb
|
86
106
|
- lib/kyanite/general/classutils.rb
|
87
107
|
- lib/kyanite/general/kernel.rb
|
@@ -89,13 +109,24 @@ files:
|
|
89
109
|
- lib/kyanite/general/object.rb
|
90
110
|
- lib/kyanite/general/true_false.rb
|
91
111
|
- lib/kyanite/general/undoable.rb
|
112
|
+
- lib/kyanite/hash.rb
|
113
|
+
- lib/kyanite/matrix2.rb
|
114
|
+
- lib/kyanite/nil.rb
|
115
|
+
- lib/kyanite/numeric.rb
|
92
116
|
- lib/kyanite/numeric/float.rb
|
93
117
|
- lib/kyanite/numeric/integer.rb
|
94
118
|
- lib/kyanite/numeric/numeric.rb
|
119
|
+
- lib/kyanite/operation.rb
|
95
120
|
- lib/kyanite/operation/call_tracker.rb
|
96
121
|
- lib/kyanite/operation/rake.rb
|
97
|
-
- lib/kyanite/operation/unit_test.rb
|
98
122
|
- lib/kyanite/operation/regexp.rb
|
123
|
+
- lib/kyanite/operation/unit_test.rb
|
124
|
+
- lib/kyanite/optimizer.rb
|
125
|
+
- lib/kyanite/rake.rb
|
126
|
+
- lib/kyanite/range.rb
|
127
|
+
- lib/kyanite/set.rb
|
128
|
+
- lib/kyanite/smart_load_path.rb
|
129
|
+
- lib/kyanite/string.rb
|
99
130
|
- lib/kyanite/string/cast.rb
|
100
131
|
- lib/kyanite/string/chars.rb
|
101
132
|
- lib/kyanite/string/chars_const.rb
|
@@ -107,35 +138,22 @@ files:
|
|
107
138
|
- lib/kyanite/string/nested.rb
|
108
139
|
- lib/kyanite/string/random.rb
|
109
140
|
- lib/kyanite/string/split.rb
|
110
|
-
- lib/kyanite/array.rb
|
111
|
-
- lib/kyanite/array_of_enumerables.rb
|
112
|
-
- lib/kyanite/array_of_numerics.rb
|
113
|
-
- lib/kyanite/array_of_strings.rb
|
114
|
-
- lib/kyanite/basics.rb
|
115
|
-
- lib/kyanite/dictionary.rb
|
116
|
-
- lib/kyanite/enumerable.rb
|
117
|
-
- lib/kyanite/general.rb
|
118
|
-
- lib/kyanite/hash.rb
|
119
|
-
- lib/kyanite/matrix2.rb
|
120
|
-
- lib/kyanite/nil.rb
|
121
|
-
- lib/kyanite/numeric.rb
|
122
|
-
- lib/kyanite/operation.rb
|
123
|
-
- lib/kyanite/optimizer.rb
|
124
|
-
- lib/kyanite/rake.rb
|
125
|
-
- lib/kyanite/range.rb
|
126
|
-
- lib/kyanite/set.rb
|
127
|
-
- lib/kyanite/smart_load_path.rb
|
128
|
-
- lib/kyanite/string.rb
|
129
141
|
- lib/kyanite/symbol.rb
|
130
142
|
- lib/kyanite/tree.rb
|
131
143
|
- lib/kyanite/undoable.rb
|
132
144
|
- lib/kyanite/unit_test.rb
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
145
|
+
- script/console
|
146
|
+
- script/console.cmd
|
147
|
+
- script/destroy
|
148
|
+
- script/destroy.cmd
|
149
|
+
- script/generate
|
150
|
+
- script/generate.cmd
|
151
|
+
- script/txt2html
|
152
|
+
- script/txt2html.cmd
|
153
|
+
- tasks/deployment.rake
|
154
|
+
- tasks/documentation.rake
|
155
|
+
- tasks/environment.rake
|
156
|
+
- test/_start_all.rb
|
139
157
|
- test/array/test_array.rb
|
140
158
|
- test/array/test_matrix2.rb
|
141
159
|
- test/enumerable/test_enumerable_enumerables.rb
|
@@ -153,7 +171,6 @@ files:
|
|
153
171
|
- test/string/test_list.rb
|
154
172
|
- test/string/test_nested.rb
|
155
173
|
- test/string/test_split.rb
|
156
|
-
- test/_start_all.rb
|
157
174
|
- test/test_dictionary.rb
|
158
175
|
- test/test_hash.rb
|
159
176
|
- test/test_optimizer.rb
|