kyanite 0.5.14 → 0.5.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Div +28 -5
- data/Rakefile.rb +8 -10
- data/lib/kyanite.rb +7 -1
- data/lib/kyanite/hash.rb +4 -2
- data/lib/kyanite/operation/rake.rb +14 -21
- data/lib/kyanite/tree.rb +2 -2
- metadata +2 -2
data/Div
CHANGED
@@ -4,14 +4,37 @@
|
|
4
4
|
[ ] | *Div* | Tree::TreeNode | Optimizer |
|
5
5
|
---
|
6
6
|
|
7
|
-
==
|
7
|
+
== Sonstige Klassen
|
8
8
|
* Tree::TreeNode Ergänzungen zu rubytree
|
9
9
|
* Optimizer Auswahl von Objekten auf Basis von Scores
|
10
10
|
* Undoable Undo für komplexe Objekte
|
11
11
|
|
12
12
|
|
13
|
-
==
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
== Unit Tests
|
14
|
+
Durchlaufende Tests besitzen eine Statusanzeige, wenn man UnitTest statt Test::Unit::TestCase: verwendet.
|
15
|
+
|
16
|
+
smart_load_path vereinfacht die require-Statements in den Tests. Usage:
|
17
|
+
if $0 == __FILE__
|
18
|
+
require 'kyanite/smart_load_path'
|
19
|
+
smart_load_path
|
20
|
+
end
|
21
|
+
require 'kyanite/unit_test'
|
22
|
+
require 'my_library'
|
23
|
+
Das +require 'my_library'+ lädt die aktuelle Version von +my_library+ im übergeordneten Projektverzeichnis, nicht nur die über gem installierte Version.
|
24
|
+
|
25
|
+
|
26
|
+
== Rake Tasks
|
27
|
+
Usage: In Rakefile
|
28
|
+
require 'kyanite'
|
29
|
+
Kyanite.projectname = File.dirname(__FILE__).split("/")[-1].strip # Name des Projekt-Stammverzeichnisses
|
30
|
+
Kyanite.github_username = 'my_username_on_github'
|
31
|
+
|
32
|
+
Console:
|
33
|
+
rake rubygems_publish # release actual version to rubygems
|
34
|
+
rake git_publish # publish actual version to github
|
35
|
+
rake git_publish_docs # publish docs to github
|
36
|
+
|
37
|
+
rake publish # publish all to github and rubygems, reinstall gem
|
38
|
+
|
39
|
+
|
17
40
|
|
data/Rakefile.rb
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
|
3
|
+
projectname = File.dirname(__FILE__).split("/")[-1].strip # Name des Projekt-Stammverzeichnisses
|
4
|
+
require File.dirname(__FILE__) + "/lib/#{projectname}" # Hauptdatei der Library
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
Kyanite.projectname = projectname
|
7
|
+
Kyanite.github_username = 'bklippstein'
|
6
8
|
|
7
|
-
require 'rubygems'
|
8
9
|
require 'hoe'
|
9
|
-
require 'rake'
|
10
|
-
require File.dirname(__FILE__) + "/lib/#{$projectname}" # Hauptdatei der Library
|
11
|
-
require 'kyanite/rake'
|
12
10
|
require 'rdoc/task'
|
11
|
+
require 'kyanite/rake'
|
13
12
|
|
14
13
|
|
15
|
-
Kyanite.github_username = 'bklippstein'
|
16
14
|
|
17
15
|
|
18
16
|
# ----------------------------------------------------------------------------------------------
|
@@ -20,13 +18,13 @@ Kyanite.github_username = 'bklippstein'
|
|
20
18
|
#
|
21
19
|
# http://nubyonrails.com/articles/tutorial-publishing-rubygems-with-hoe
|
22
20
|
#
|
23
|
-
$hoe = Hoe.spec
|
21
|
+
$hoe = Hoe.spec Kyanite.projectname do
|
24
22
|
|
25
23
|
# self.rubyforge_name = 'yourgemx' # if different than 'yourgem'
|
26
24
|
|
27
25
|
developer('Bjoern Klippstein', 'klippstein@klippstein.com')
|
28
26
|
summary = 'General toolbox like Facets or ActiveSupport.'
|
29
|
-
urls << ["http://#{Kyanite::github_username}.github.com/#{
|
27
|
+
urls << ["http://#{Kyanite::github_username}.github.com/#{Kyanite.projectname}/"]
|
30
28
|
remote_rdoc_dir = '' # Release to root only one project
|
31
29
|
extra_deps << ['activesupport', '>= 3.2.8']
|
32
30
|
extra_deps << ['facets', '>= 2.9.3']
|
@@ -55,7 +53,7 @@ remove_task 'docs'
|
|
55
53
|
desc "generate RDoc documentation"
|
56
54
|
Rake::RDocTask.new(:docs) do |rd|
|
57
55
|
|
58
|
-
rd.title = "#{
|
56
|
+
rd.title = "#{Kyanite.projectname.capitalize} #{Kyanite.projectname.to_class.const_get('VERSION')}"
|
59
57
|
|
60
58
|
rd.rdoc_dir = 'doc'
|
61
59
|
rd.rdoc_files.include('lib/**/*.rb')
|
data/lib/kyanite.rb
CHANGED
@@ -16,7 +16,12 @@ end
|
|
16
16
|
|
17
17
|
module Kyanite #:nodoc
|
18
18
|
|
19
|
-
VERSION = '0.5.
|
19
|
+
VERSION = '0.5.15'
|
20
|
+
|
21
|
+
class << self
|
22
|
+
attr_accessor :projectname
|
23
|
+
attr_accessor :github_username
|
24
|
+
end
|
20
25
|
|
21
26
|
end
|
22
27
|
|
@@ -38,3 +43,4 @@ end
|
|
38
43
|
require 'kyanite/symbol'
|
39
44
|
require 'kyanite/tree'
|
40
45
|
# require 'kyanite/unit_test' # nur für Tests
|
46
|
+
|
data/lib/kyanite/hash.rb
CHANGED
@@ -18,8 +18,10 @@ require 'kyanite/enumerable' # is_collection?
|
|
18
18
|
# == *Tools* *For* *Hash*
|
19
19
|
# See TestKyaniteHash for tests and examples.
|
20
20
|
#
|
21
|
-
#
|
22
|
-
#
|
21
|
+
# === Generelle Anmerkungen zu Hashes
|
22
|
+
# Definiert man in irgendeinem Objekt die Methode <tt>==(other)</tt>, so muss man auch die Methode +hash+ neu definieren!
|
23
|
+
#
|
24
|
+
# Rubys +delete+ und +delete_if+ verändern den Hash! Siehe TestHash#test_delete
|
23
25
|
#
|
24
26
|
#
|
25
27
|
class Hash
|
@@ -1,12 +1,5 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
|
3
|
-
module Kyanite #:nodoc
|
4
|
-
module_function
|
5
|
-
def github_username; @github_username; end
|
6
|
-
def github_username= v; @github_username = v; end
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
3
|
#== *Rake*
|
11
4
|
#Beispiele siehe Rakefile.rb
|
12
5
|
#* Methode remove_task, um Tasks überschreiben zu können
|
@@ -62,13 +55,13 @@ end
|
|
62
55
|
|
63
56
|
# git_publish
|
64
57
|
#
|
65
|
-
desc '
|
58
|
+
desc 'publish actual version to github'
|
66
59
|
task :git_publish => [ :git_add, :git_commit, :git_push ] do
|
67
60
|
puts; puts; puts; puts
|
68
61
|
if Hoe::WINDOZE
|
69
|
-
sh "start https://github.com/#{Kyanite.github_username}/#{
|
62
|
+
sh "start https://github.com/#{Kyanite.github_username}/#{Kyanite.projectname} "
|
70
63
|
else
|
71
|
-
puts "done. Visit https://github.com/#{Kyanite.github_username}/#{
|
64
|
+
puts "done. Visit https://github.com/#{Kyanite.github_username}/#{Kyanite.projectname} "
|
72
65
|
end
|
73
66
|
end
|
74
67
|
|
@@ -137,9 +130,9 @@ end
|
|
137
130
|
|
138
131
|
# Repository erstellen, wenn nötig
|
139
132
|
Dir.chdir '/tmp' do
|
140
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }git clone https://github.com/#{Kyanite.github_username}/#{
|
133
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }git clone https://github.com/#{Kyanite.github_username}/#{Kyanite.projectname} " do |ok,res|
|
141
134
|
if ok
|
142
|
-
Dir.chdir "/tmp/#{
|
135
|
+
Dir.chdir "/tmp/#{Kyanite.projectname}" do
|
143
136
|
if Hoe::WINDOZE
|
144
137
|
sh 'git checkout --orphan gh-pages '
|
145
138
|
sh 'chcp 65001 > NUL '
|
@@ -154,7 +147,7 @@ end
|
|
154
147
|
end # do chdir
|
155
148
|
|
156
149
|
# alles löschen
|
157
|
-
Dir.chdir "/tmp/#{
|
150
|
+
Dir.chdir "/tmp/#{Kyanite.projectname}" do
|
158
151
|
if Hoe::WINDOZE
|
159
152
|
sh 'git rm -rf --ignore-unmatch . '
|
160
153
|
sh 'chcp 65001 > NUL '
|
@@ -166,25 +159,25 @@ end
|
|
166
159
|
# doc rüberkopieren
|
167
160
|
Dir.chdir 'doc' do
|
168
161
|
if Hoe::WINDOZE
|
169
|
-
sh "xcopy /E *.* \\tmp\\#{
|
162
|
+
sh "xcopy /E *.* \\tmp\\#{Kyanite.projectname} "
|
170
163
|
sh 'chcp 65001 > NUL '
|
171
164
|
else
|
172
|
-
sh "sudo cp . /tmp/#{
|
165
|
+
sh "sudo cp . /tmp/#{Kyanite.projectname} "
|
173
166
|
end
|
174
167
|
end
|
175
168
|
|
176
169
|
# publish
|
177
|
-
Dir.chdir "/tmp/#{
|
170
|
+
Dir.chdir "/tmp/#{Kyanite.projectname}" do
|
178
171
|
if Hoe::WINDOZE
|
179
172
|
sh 'git add -A '
|
180
173
|
sh 'sudo git commit -m "---" --allow-empty'
|
181
174
|
sh 'git push origin +gh-pages ' # C:\Users\Klippstein\_netrc enthält die Login-Daten
|
182
|
-
sh "start http://#{Kyanite.github_username}.github.com/#{
|
175
|
+
sh "start http://#{Kyanite.github_username}.github.com/#{Kyanite.projectname} "
|
183
176
|
else
|
184
177
|
sh 'sudo git add -A '
|
185
178
|
sh 'sudo git commit -m "---" --allow-empty'
|
186
179
|
sh 'sudo git push origin +gh-pages ' # .netrc enthält die Login-Daten
|
187
|
-
puts "done. Visit http://#{Kyanite.github_username}.github.com/#{
|
180
|
+
puts "done. Visit http://#{Kyanite.github_username}.github.com/#{Kyanite.projectname} "
|
188
181
|
end # if
|
189
182
|
|
190
183
|
end # do chdir
|
@@ -205,7 +198,7 @@ end
|
|
205
198
|
desc 'release actual version to rubygems'
|
206
199
|
task :rubygems_publish do
|
207
200
|
puts; puts; puts; puts
|
208
|
-
ENV["VERSION"] =
|
201
|
+
ENV["VERSION"] = Kyanite.projectname.to_class.const_get('VERSION')
|
209
202
|
Rake::Task[:release].invoke
|
210
203
|
|
211
204
|
end
|
@@ -217,7 +210,7 @@ end
|
|
217
210
|
desc 'uninstall old gem'
|
218
211
|
task :gem_uninstall do
|
219
212
|
puts; puts; puts; puts
|
220
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem uninstall #{
|
213
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem uninstall #{Kyanite.projectname} --a --ignore-dependencies "
|
221
214
|
end
|
222
215
|
|
223
216
|
|
@@ -227,7 +220,7 @@ end
|
|
227
220
|
desc 'install gem from rubygems'
|
228
221
|
task :gem_install do
|
229
222
|
puts; puts; puts; puts
|
230
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem install #{
|
223
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install #{Kyanite.projectname} "
|
231
224
|
end
|
232
225
|
|
233
226
|
|
data/lib/kyanite/tree.rb
CHANGED
@@ -8,13 +8,13 @@ require 'rubytree'
|
|
8
8
|
require 'kyanite/nil'
|
9
9
|
|
10
10
|
|
11
|
-
module Tree
|
11
|
+
module Tree #:nodoc:
|
12
12
|
|
13
13
|
# [ | *Kyanite* | Object | Array | Set | Enumerable | Hash | ] | Kyanite | TrueClass | FalseClass | NilClass | *Div* |
|
14
14
|
# [ ] | Div | <b>Tree::TreeNode</b> | Optimizer |
|
15
15
|
# ---
|
16
16
|
#
|
17
|
-
# ==
|
17
|
+
# == Ergänzungen zu rubytree
|
18
18
|
# See TestKyaniteTree for tests and examples.
|
19
19
|
#
|
20
20
|
class TreeNode
|
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.5.
|
4
|
+
version: 0.5.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|