kyanite 0.5.12 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/Rakefile.rb +5 -180
- data/lib/kyanite.rb +3 -1
- data/lib/kyanite/operation/rake.rb +215 -1
- metadata +1 -1
data/History.txt
CHANGED
data/Rakefile.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
|
3
|
-
|
3
|
+
|
4
4
|
$projectname = File.dirname(__FILE__).split("/")[-1].strip # Name des Projekt-Stammverzeichnisses
|
5
5
|
|
6
6
|
|
@@ -12,6 +12,8 @@ require 'kyanite/rake'
|
|
12
12
|
require 'rdoc/task'
|
13
13
|
|
14
14
|
|
15
|
+
Kyanite.github_username = 'bklippstein'
|
16
|
+
|
15
17
|
|
16
18
|
# ----------------------------------------------------------------------------------------------
|
17
19
|
# Hoe
|
@@ -24,7 +26,7 @@ $hoe = Hoe.spec $projectname do
|
|
24
26
|
|
25
27
|
developer('Bjoern Klippstein', 'klippstein@klippstein.com')
|
26
28
|
summary = 'General toolbox like Facets or ActiveSupport.'
|
27
|
-
urls << ["http://#{
|
29
|
+
urls << ["http://#{Kyanite::github_username}.github.com/#{$projectname}/"]
|
28
30
|
remote_rdoc_dir = '' # Release to root only one project
|
29
31
|
extra_deps << ['activesupport', '>= 3.2.8']
|
30
32
|
extra_deps << ['facets', '>= 2.9.3']
|
@@ -38,170 +40,6 @@ end
|
|
38
40
|
# pp $hoe
|
39
41
|
|
40
42
|
|
41
|
-
# -------------------------------------------------------------------------------------------------------
|
42
|
-
# publish
|
43
|
-
#
|
44
|
-
|
45
|
-
# Task :publish
|
46
|
-
#
|
47
|
-
desc 'publish all on github and rubygems, reinstall gem'
|
48
|
-
task :publish => [ :redocs, :rubygems_publish, :gem_uninstall, :git_publish, :git_publish_docs, :sleep_15, :gem_install] do
|
49
|
-
puts 'done.'
|
50
|
-
end
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
# -------------------------------------------------------------------------------------------------------
|
55
|
-
# git
|
56
|
-
#
|
57
|
-
|
58
|
-
|
59
|
-
# git_publish
|
60
|
-
#
|
61
|
-
desc ':git_add, :git_commit, :git_push'
|
62
|
-
task :git_publish => [ :git_add, :git_commit, :git_push ] do
|
63
|
-
puts
|
64
|
-
puts '------------------------------------------------------------------------------------'
|
65
|
-
puts ':git_publish publish project to github '
|
66
|
-
puts
|
67
|
-
if Hoe::WINDOZE
|
68
|
-
sh "start https://github.com/#{$github_username}/#{$projectname} "
|
69
|
-
else
|
70
|
-
puts "done. Visit https://github.com/#{$github_username}/#{$projectname} "
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
# git_status
|
77
|
-
#
|
78
|
-
desc 'git status'
|
79
|
-
task :git_status do
|
80
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }git status "
|
81
|
-
end
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
# git_add
|
86
|
-
#
|
87
|
-
desc 'git_add -A'
|
88
|
-
task :git_add do
|
89
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }git add -A "
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
# git_commit
|
95
|
-
#
|
96
|
-
desc 'git commit -m'
|
97
|
-
task :git_commit do
|
98
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }git commit " + ' -m "---"'
|
99
|
-
end
|
100
|
-
|
101
|
-
|
102
|
-
# git push origin master
|
103
|
-
#
|
104
|
-
desc 'git_push'
|
105
|
-
task :git_push do
|
106
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }git push origin master "
|
107
|
-
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
# git_publish_docs
|
112
|
-
#
|
113
|
-
desc 'publish docs to github'
|
114
|
-
task :git_publish_docs do
|
115
|
-
puts
|
116
|
-
puts '------------------------------------------------------------------------------------'
|
117
|
-
puts ':git_publish_docs publish docs to github '
|
118
|
-
puts
|
119
|
-
|
120
|
-
# Repository erstellen, wenn nötig
|
121
|
-
Dir.chdir '/tmp' do
|
122
|
-
sh "git clone https://github.com/#{$github_username}/#{$projectname} " do |ok,res|
|
123
|
-
if ok
|
124
|
-
Dir.chdir "/tmp/#{$projectname}" do
|
125
|
-
sh 'git checkout --orphan gh-pages '
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end # do sh
|
129
|
-
end
|
130
|
-
|
131
|
-
# alles löschen
|
132
|
-
Dir.chdir "/tmp/#{$projectname}" do
|
133
|
-
sh 'git rm -rf --ignore-unmatch . '
|
134
|
-
end
|
135
|
-
|
136
|
-
# doc rüberkopieren
|
137
|
-
Dir.chdir 'doc' do
|
138
|
-
sh "xcopy /E *.* \tmp\#{$projectname} "
|
139
|
-
end
|
140
|
-
|
141
|
-
# publish
|
142
|
-
Dir.chdir "/tmp/#{$projectname}" do
|
143
|
-
sh 'git add -A '
|
144
|
-
sh "git commit " + ' -m "---" --allow-empty'
|
145
|
-
sh 'git push origin +gh-pages ' # C:\Users\Klippstein\_netrc enthält die Login-Daten
|
146
|
-
|
147
|
-
if Hoe::WINDOZE
|
148
|
-
sh "start http://#{$github_username}.github.com/#{$projectname} "
|
149
|
-
else
|
150
|
-
puts "done. Visit http://#{$github_username}.github.com/#{$projectname} "
|
151
|
-
end # if
|
152
|
-
|
153
|
-
end # do chdir
|
154
|
-
|
155
|
-
|
156
|
-
end # do task
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
# -------------------------------------------------------------------------------------------------------
|
162
|
-
# rubygems
|
163
|
-
#
|
164
|
-
|
165
|
-
|
166
|
-
# Task :rubygems_publish
|
167
|
-
#
|
168
|
-
desc 'release actual version to rubygems'
|
169
|
-
task :rubygems_publish do
|
170
|
-
puts
|
171
|
-
puts '------------------------------------------------------------------------------------'
|
172
|
-
puts ':rubygems_publish release actual version to rubygems'
|
173
|
-
puts
|
174
|
-
ENV["VERSION"] = $projectname.to_class.const_get('VERSION')
|
175
|
-
Rake::Task[:release].invoke
|
176
|
-
|
177
|
-
end
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
# Task :gem_uninstall
|
182
|
-
#
|
183
|
-
desc 'uninstall old gem'
|
184
|
-
task :gem_uninstall do
|
185
|
-
puts
|
186
|
-
puts '------------------------------------------------------------------------------------'
|
187
|
-
puts ':gem_uninstall uninstall old gem'
|
188
|
-
puts
|
189
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem uninstall #{$projectname} --a --ignore-dependencies "
|
190
|
-
end
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
# Task :gem_install
|
195
|
-
#
|
196
|
-
desc 'install gem from rubygems'
|
197
|
-
task :gem_install do
|
198
|
-
puts
|
199
|
-
puts '------------------------------------------------------------------------------------'
|
200
|
-
puts ':gem_install install gem from rubygems'
|
201
|
-
puts
|
202
|
-
sh "#{'sudo ' unless Hoe::WINDOZE }gem install #{$projectname} "
|
203
|
-
end
|
204
|
-
|
205
43
|
|
206
44
|
|
207
45
|
|
@@ -217,10 +55,6 @@ remove_task 'docs'
|
|
217
55
|
desc "generate RDoc documentation"
|
218
56
|
Rake::RDocTask.new(:docs) do |rd|
|
219
57
|
|
220
|
-
# puts
|
221
|
-
# puts '------------------------------------------------------------------------------------'
|
222
|
-
# puts ':docs generate RDoc documentation'
|
223
|
-
# puts
|
224
58
|
rd.title = "#{$projectname.capitalize} #{$projectname.to_class.const_get('VERSION')}"
|
225
59
|
|
226
60
|
rd.rdoc_dir = 'doc'
|
@@ -263,16 +97,7 @@ Dir['tasks/**/*.rake'].each { |t| load t }
|
|
263
97
|
|
264
98
|
|
265
99
|
|
266
|
-
|
267
|
-
# Div
|
268
|
-
#
|
269
|
-
|
270
|
-
# namespace :manifest do
|
271
|
-
# desc 'Recreate Manifest.txt to include ALL files'
|
272
|
-
# task :refresh do
|
273
|
-
# `rake check_manifest | patch -p0 > Manifest.txt`
|
274
|
-
# end
|
275
|
-
# end
|
100
|
+
|
276
101
|
|
277
102
|
|
278
103
|
|
data/lib/kyanite.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
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
|
+
|
3
10
|
#== *Rake*
|
4
11
|
#Beispiele siehe Rakefile.rb
|
5
12
|
#* Methode remove_task, um Tasks überschreiben zu können
|
@@ -35,6 +42,204 @@ end
|
|
35
42
|
|
36
43
|
|
37
44
|
|
45
|
+
# -------------------------------------------------------------------------------------------------------
|
46
|
+
# publish
|
47
|
+
#
|
48
|
+
|
49
|
+
# Task :publish
|
50
|
+
#
|
51
|
+
desc 'publish all on github and rubygems, reinstall gem'
|
52
|
+
task :publish => [ :redocs, :rubygems_publish, :gem_uninstall, :git_publish, :git_publish_docs, :sleep_15, :gem_install] do
|
53
|
+
puts 'done.'
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
# -------------------------------------------------------------------------------------------------------
|
59
|
+
# git
|
60
|
+
#
|
61
|
+
|
62
|
+
|
63
|
+
# git_publish
|
64
|
+
#
|
65
|
+
desc ':git_add, :git_commit, :git_push'
|
66
|
+
task :git_publish => [ :git_add, :git_commit, :git_push ] do
|
67
|
+
puts; puts; puts; puts
|
68
|
+
if Hoe::WINDOZE
|
69
|
+
sh "start https://github.com/#{Kyanite.github_username}/#{$projectname} "
|
70
|
+
else
|
71
|
+
puts "done. Visit https://github.com/#{Kyanite.github_username}/#{$projectname} "
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
# git_status
|
78
|
+
#
|
79
|
+
desc 'git status'
|
80
|
+
task :git_status do
|
81
|
+
if Hoe::WINDOZE
|
82
|
+
sh "git status "
|
83
|
+
sh 'chcp 65001 > NUL '
|
84
|
+
else
|
85
|
+
sh "sudo git status "
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
# git_add
|
92
|
+
#
|
93
|
+
desc 'git_add -A'
|
94
|
+
task :git_add do
|
95
|
+
if Hoe::WINDOZE
|
96
|
+
sh "git add -A "
|
97
|
+
sh 'chcp 65001 > NUL '
|
98
|
+
else
|
99
|
+
sh "sudo git add -A "
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
# git_commit
|
106
|
+
#
|
107
|
+
desc 'git commit -m'
|
108
|
+
task :git_commit do
|
109
|
+
if Hoe::WINDOZE
|
110
|
+
sh 'git commit -m "---" '
|
111
|
+
sh 'chcp 65001 > NUL '
|
112
|
+
else
|
113
|
+
sh 'sudo git commit -m "---" '
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
# git push origin master
|
119
|
+
#
|
120
|
+
desc 'git_push'
|
121
|
+
task :git_push do
|
122
|
+
if Hoe::WINDOZE
|
123
|
+
sh 'git push origin master '
|
124
|
+
sh 'chcp 65001 > NUL '
|
125
|
+
else
|
126
|
+
sh 'sudo git push origin master '
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
# git_publish_docs
|
133
|
+
#
|
134
|
+
desc 'publish docs to github'
|
135
|
+
task :git_publish_docs do
|
136
|
+
puts; puts; puts; puts
|
137
|
+
|
138
|
+
# Repository erstellen, wenn nötig
|
139
|
+
Dir.chdir '/tmp' do
|
140
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }git clone https://github.com/#{Kyanite.github_username}/#{$projectname} " do |ok,res|
|
141
|
+
if ok
|
142
|
+
Dir.chdir "/tmp/#{$projectname}" do
|
143
|
+
if Hoe::WINDOZE
|
144
|
+
sh 'git checkout --orphan gh-pages '
|
145
|
+
sh 'chcp 65001 > NUL '
|
146
|
+
else
|
147
|
+
sh 'sudo git checkout --orphan gh-pages '
|
148
|
+
end
|
149
|
+
end # do chdir
|
150
|
+
else # not ok
|
151
|
+
sh 'chcp 65001 > NUL ' if Hoe::WINDOZE
|
152
|
+
end
|
153
|
+
end # do sh
|
154
|
+
end # do chdir
|
155
|
+
|
156
|
+
# alles löschen
|
157
|
+
Dir.chdir "/tmp/#{$projectname}" do
|
158
|
+
if Hoe::WINDOZE
|
159
|
+
sh 'git rm -rf --ignore-unmatch . '
|
160
|
+
sh 'chcp 65001 > NUL '
|
161
|
+
else
|
162
|
+
sh 'sudo git rm -rf --ignore-unmatch . '
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# doc rüberkopieren
|
167
|
+
Dir.chdir 'doc' do
|
168
|
+
if Hoe::WINDOZE
|
169
|
+
sh "xcopy /E *.* \\tmp\\#{$projectname} "
|
170
|
+
sh 'chcp 65001 > NUL '
|
171
|
+
else
|
172
|
+
sh "sudo cp . /tmp/#{$projectname} "
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
# publish
|
177
|
+
Dir.chdir "/tmp/#{$projectname}" do
|
178
|
+
if Hoe::WINDOZE
|
179
|
+
sh 'git add -A '
|
180
|
+
sh 'sudo git commit -m "---" --allow-empty'
|
181
|
+
sh 'git push origin +gh-pages ' # C:\Users\Klippstein\_netrc enthält die Login-Daten
|
182
|
+
sh "start http://#{Kyanite.github_username}.github.com/#{$projectname} "
|
183
|
+
else
|
184
|
+
sh 'sudo git add -A '
|
185
|
+
sh 'sudo git commit -m "---" --allow-empty'
|
186
|
+
sh 'sudo git push origin +gh-pages ' # .netrc enthält die Login-Daten
|
187
|
+
puts "done. Visit http://#{Kyanite.github_username}.github.com/#{$projectname} "
|
188
|
+
end # if
|
189
|
+
|
190
|
+
end # do chdir
|
191
|
+
|
192
|
+
|
193
|
+
end # do task
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
# -------------------------------------------------------------------------------------------------------
|
199
|
+
# rubygems
|
200
|
+
#
|
201
|
+
|
202
|
+
|
203
|
+
# Task :rubygems_publish
|
204
|
+
#
|
205
|
+
desc 'release actual version to rubygems'
|
206
|
+
task :rubygems_publish do
|
207
|
+
puts; puts; puts; puts
|
208
|
+
ENV["VERSION"] = $projectname.to_class.const_get('VERSION')
|
209
|
+
Rake::Task[:release].invoke
|
210
|
+
|
211
|
+
end
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
# Task :gem_uninstall
|
216
|
+
#
|
217
|
+
desc 'uninstall old gem'
|
218
|
+
task :gem_uninstall do
|
219
|
+
puts; puts; puts; puts
|
220
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem uninstall #{$projectname} --a --ignore-dependencies "
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
# Task :gem_install
|
226
|
+
#
|
227
|
+
desc 'install gem from rubygems'
|
228
|
+
task :gem_install do
|
229
|
+
puts; puts; puts; puts
|
230
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install #{$projectname} "
|
231
|
+
end
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
# -------------------------------------------------------------------------------------------------------
|
239
|
+
# Sleep
|
240
|
+
#
|
241
|
+
|
242
|
+
|
38
243
|
# Task :sleep_5
|
39
244
|
#
|
40
245
|
desc 'Sleep 5 seconds'
|
@@ -67,6 +272,15 @@ task :sleep_15 do
|
|
67
272
|
end
|
68
273
|
|
69
274
|
|
70
|
-
|
275
|
+
# -------------------------------------------------------------------------------------------------------
|
276
|
+
# Div
|
277
|
+
#
|
278
|
+
|
279
|
+
# namespace :manifest do
|
280
|
+
# desc 'Recreate Manifest.txt to include ALL files'
|
281
|
+
# task :refresh do
|
282
|
+
# `rake check_manifest | patch -p0 > Manifest.txt`
|
283
|
+
# end
|
284
|
+
# end
|
71
285
|
|
72
286
|
|