dev 2.0.269 → 2.0.270
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apps/svn.rb +2 -3
- data/lib/base/array.rb +6 -2
- data/lib/base/dir.rb +15 -0
- data/lib/base/environment.rb +32 -83
- data/lib/base/project.rb +57 -10
- data/lib/base/projects.rb +34 -12
- data/lib/base/text.rb +22 -10
- data/lib/commands.rb +4 -2
- data/lib/dev.rb +13 -8
- data/lib/tasks/default.rb +43 -19
- data/lib/tasks/doc.rb +0 -2
- data/lib/tasks/info.rb +0 -2
- data/lib/tasks/publish.rb +0 -1
- data/lib/tasks/push.rb +0 -2
- data/lib/tasks/setup.rb +1 -0
- data/lib/tasks/test.rb +0 -2
- data/lib/tasks/update.rb +0 -2
- data/lib/tasks.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7248978e9485e170b6131017226eac544530bca6
|
4
|
+
data.tar.gz: 2c4152f5040c40985aeaf736114eeeccc6c3657a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16928d3ab7e5a7173c68e7d3deb8aba002e99ab85c62118fff688bc204aa8c37df6d4476af7ba631d3986b063de4aa387e54089eb7dd2d9ef98841c4f413b968
|
7
|
+
data.tar.gz: cb72c3f82c26e5650d39b769b0518f6295bd1538a3bf72d8a6a92be25980b719ffd8d8f03286c52f13dc18083f632090d9b8dea3879ca14e08f108af42584ce8
|
data/lib/apps/svn.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
puts __FILE__ if defined?(DEBUG)
|
2
|
-
|
3
1
|
require 'fileutils'
|
4
2
|
require 'tmpdir'
|
3
|
+
require_relative('../base/dir.rb')
|
5
4
|
class Svn
|
6
5
|
|
7
6
|
def self.latest_revision
|
@@ -131,7 +130,7 @@ class Svn
|
|
131
130
|
end
|
132
131
|
|
133
132
|
#begin
|
134
|
-
|
133
|
+
Dir.remove "#{dir}/to_publish_checkout"
|
135
134
|
output
|
136
135
|
}
|
137
136
|
end
|
data/lib/base/array.rb
CHANGED
@@ -11,7 +11,7 @@ class Array
|
|
11
11
|
@env=Environment.new() if @env.nil?
|
12
12
|
i=0
|
13
13
|
while i < self.length
|
14
|
-
self[i]=Command.new(self[i]) if(self[i].is_a?(String))
|
14
|
+
self[i]=Command.new({ :input => self[i], :quiet => true }) if(self[i].is_a?(String))
|
15
15
|
self[i]=Command.new(self[i]) if(self[i].is_a?(Hash) && !self[i].is_a?(Command))
|
16
16
|
|
17
17
|
if(!value.nil? && value.is_a?(Hash))
|
@@ -36,7 +36,11 @@ class Array
|
|
36
36
|
return true if(command.kind_of?(String) && !include?(command))
|
37
37
|
if(command.kind_of?(Command))
|
38
38
|
self.each{|c|
|
39
|
-
|
39
|
+
if c.kind_of?(String)
|
40
|
+
return true if command[:input] == c
|
41
|
+
else
|
42
|
+
return true if(c[:input] == command[:input])
|
43
|
+
end
|
40
44
|
}
|
41
45
|
end
|
42
46
|
false
|
data/lib/base/dir.rb
CHANGED
@@ -21,4 +21,19 @@ class Dir
|
|
21
21
|
end
|
22
22
|
false
|
23
23
|
end
|
24
|
+
|
25
|
+
def self.get_latest_mtime directory
|
26
|
+
mtime=Time.new(1980)
|
27
|
+
Dir.chdir(directory) do
|
28
|
+
latest_filename=''
|
29
|
+
Dir.glob('**/*.*').each{|f|
|
30
|
+
if mtime.nil? || File.mtime(f) > mtime
|
31
|
+
mtime=File.mtime(f)
|
32
|
+
latest_filename=f
|
33
|
+
end
|
34
|
+
}
|
35
|
+
puts " latest_mtime #{mtime.to_s} #{latest_filename}" if Environment.default.debug?
|
36
|
+
end
|
37
|
+
mtime
|
38
|
+
end
|
24
39
|
end
|
data/lib/base/environment.rb
CHANGED
@@ -25,36 +25,36 @@ class Environment < Hash
|
|
25
25
|
def self.dev_root
|
26
26
|
default.root_dir
|
27
27
|
end
|
28
|
-
|
29
28
|
#####End LEGACY support
|
29
|
+
|
30
30
|
def root_dir
|
31
|
-
get_env('DEV_ROOT')
|
31
|
+
get_env('DEV_ROOT').gsub('\\','/')
|
32
32
|
end
|
33
33
|
|
34
34
|
def home_dir
|
35
|
-
get_env('HOME')
|
35
|
+
get_env('HOME').gsub('\\','/')
|
36
36
|
end
|
37
37
|
|
38
38
|
def log_dir
|
39
|
-
dir="#{
|
39
|
+
dir="#{root_dir}/log/#{user}@#{machine}"
|
40
40
|
FileUtils.mkdir_p dir if !File.exists? dir
|
41
41
|
dir
|
42
42
|
end
|
43
43
|
|
44
44
|
def make_dir
|
45
|
-
dir="#{
|
45
|
+
dir="#{root_dir}/make"
|
46
46
|
FileUtils.mkdir_p dir if !File.exists? dir
|
47
47
|
dir
|
48
48
|
end
|
49
49
|
|
50
50
|
def publish_dir
|
51
|
-
dir="#{
|
51
|
+
dir="#{root_dir}/publish"
|
52
52
|
FileUtils.mkdir_p dir if !File.exists? dir
|
53
53
|
dir
|
54
54
|
end
|
55
55
|
|
56
56
|
def wrk_dir
|
57
|
-
dir="#{
|
57
|
+
dir="#{root_dir}/wrk"
|
58
58
|
FileUtils.mkdir_p dir if !File.exists? dir
|
59
59
|
dir
|
60
60
|
end
|
@@ -108,6 +108,15 @@ class Environment < Hash
|
|
108
108
|
colorize
|
109
109
|
end
|
110
110
|
|
111
|
+
def working?
|
112
|
+
return true if Rake.application.original_dir.include? wrk_dir
|
113
|
+
false
|
114
|
+
end
|
115
|
+
|
116
|
+
def has_work?
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
111
120
|
def out message
|
112
121
|
puts message if !get_env('SUPPRESS_CONSOLE_OUTPUT')
|
113
122
|
@output=@output+message+'\n'
|
@@ -121,40 +130,6 @@ class Environment < Hash
|
|
121
130
|
Gem.win_platform?
|
122
131
|
end
|
123
132
|
|
124
|
-
#@@debug=true if defined?(DEBUG)
|
125
|
-
#@@debug=false if !defined?(DEBUG)
|
126
|
-
#@@development_root=nil
|
127
|
-
|
128
|
-
#def initialize
|
129
|
-
#self[:home]=Environment.home
|
130
|
-
#self[:machine]=Environment.machine
|
131
|
-
#self[:user]=Environment.user
|
132
|
-
#end
|
133
|
-
|
134
|
-
#def self.set_development_root value
|
135
|
-
# @@development_root=value
|
136
|
-
# if(!value.nil?)
|
137
|
-
# FileUtils.mkdir_p value if(!File.exists?(value))
|
138
|
-
# ['bin','data','log','make','publish','test'].each{|dir|
|
139
|
-
# #FileUtils.mkdir_p("#{value}/#{dir}") if !File.exists? "#{value}/#{dir}"
|
140
|
-
# }
|
141
|
-
# end
|
142
|
-
#end
|
143
|
-
|
144
|
-
#def self.debug
|
145
|
-
# @@debug
|
146
|
-
#end
|
147
|
-
|
148
|
-
#def self.home
|
149
|
-
# ["USERPROFILE","HOME"].each {|v|
|
150
|
-
# return ENV[v].gsub('\\','/') unless ENV[v].nil?
|
151
|
-
# }
|
152
|
-
# dir="~"
|
153
|
-
# dir=ENV["HOME"] unless ENV["HOME"].nil?
|
154
|
-
# dir=ENV["USERPROFILE"].gsub('\\','/') unless ENV["USERPROFILE"].nil?
|
155
|
-
# return dir
|
156
|
-
#end
|
157
|
-
|
158
133
|
#def self.configuration
|
159
134
|
# config="#{Environment.home}/dev.config.rb"
|
160
135
|
# if(!File.exists?(config))
|
@@ -164,40 +139,14 @@ class Environment < Hash
|
|
164
139
|
# config
|
165
140
|
#end
|
166
141
|
|
167
|
-
#def self.
|
168
|
-
#
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
#
|
173
|
-
#
|
174
|
-
# return machine.strip
|
175
|
-
#end
|
176
|
-
|
177
|
-
def self.remove directory
|
178
|
-
if(File.exists?(directory))
|
179
|
-
begin
|
180
|
-
FileUtils.rm_rf directory
|
181
|
-
FileUtils.rm_r directory
|
182
|
-
rescue
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
#def self.user
|
188
|
-
# return ENV['USER'] if !ENV['USER'].nil? #on Unix
|
189
|
-
# ENV['USERNAME']
|
190
|
-
#end
|
191
|
-
|
192
|
-
#def self.dev_root
|
193
|
-
# if(!@@development_root.nil?)
|
194
|
-
# return @@development_root
|
142
|
+
#def self.remove directory
|
143
|
+
# if(File.exists?(directory))
|
144
|
+
# begin
|
145
|
+
# FileUtils.rm_rf directory
|
146
|
+
# FileUtils.rm_r directory
|
147
|
+
# rescue
|
148
|
+
# end
|
195
149
|
# end
|
196
|
-
# ["DEV_HOME","DEV_ROOT"].each {|v|
|
197
|
-
# return ENV[v].gsub('\\','/') unless ENV[v].nil?
|
198
|
-
# }
|
199
|
-
# dir=home
|
200
|
-
# return dir
|
201
150
|
#end
|
202
151
|
|
203
152
|
def self.check
|
@@ -248,13 +197,13 @@ class Environment < Hash
|
|
248
197
|
}
|
249
198
|
end
|
250
199
|
|
251
|
-
def self.get_latest_mtime directory
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
end
|
200
|
+
#def self.get_latest_mtime directory
|
201
|
+
# mtime=Time.new(1980)
|
202
|
+
# Dir.chdir(directory) do
|
203
|
+
# Dir.glob('**/*.*').each{|f|
|
204
|
+
# mtime=File.mtime(f) if mtime.nil? || File.mtime(f) > mtime
|
205
|
+
# }
|
206
|
+
# end
|
207
|
+
# mtime
|
208
|
+
#end
|
260
209
|
end
|
data/lib/base/project.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
puts __FILE__ if defined?(DEBUG)
|
2
2
|
|
3
3
|
require 'json'
|
4
|
+
require 'rake'
|
4
5
|
require_relative('../apps/svn.rb')
|
6
|
+
require_relative('dir.rb')
|
5
7
|
require_relative('environment.rb')
|
6
8
|
require_relative('string.rb')
|
7
9
|
|
@@ -156,10 +158,43 @@ class Project < Hash
|
|
156
158
|
def command_history tags=nil
|
157
159
|
commands=Array.new
|
158
160
|
log_filenames(tags).each{|logfile|
|
159
|
-
|
161
|
+
begin
|
162
|
+
cmd=Command.new(JSON.parse(IO.read(logfile)))
|
163
|
+
commands << cmd
|
164
|
+
rescue
|
165
|
+
end
|
166
|
+
|
160
167
|
}
|
161
168
|
commands
|
162
169
|
end
|
170
|
+
|
171
|
+
def work_up_to_date?
|
172
|
+
if wrk_dir == Rake.application.original_dir
|
173
|
+
logfile=get_logfile ['up2date']
|
174
|
+
if File.exists? logfile
|
175
|
+
last_work_time=File.mtime(logfile)
|
176
|
+
last_file_changed=Dir.get_latest_mtime Rake.application.original_dir
|
177
|
+
if last_work_time > last_file_changed
|
178
|
+
CLEAN.include logfile
|
179
|
+
return true
|
180
|
+
else
|
181
|
+
File.delete(logfile)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
else
|
185
|
+
puts "wrk_dir does not match Rake.application.original_dir" if @env.debug?
|
186
|
+
end
|
187
|
+
false
|
188
|
+
end
|
189
|
+
|
190
|
+
def mark_work_up_to_date
|
191
|
+
if wrk_dir == Rake.application.original_dir
|
192
|
+
logfile=get_logfile ['up2date']
|
193
|
+
File.open(logfile,'w'){|f|f.write(' ')}
|
194
|
+
else
|
195
|
+
puts "wrk_dir does not match Rake.application.original_dir" if @env.debug?
|
196
|
+
end
|
197
|
+
end
|
163
198
|
|
164
199
|
def get_logfile tags
|
165
200
|
tagstring=''
|
@@ -265,7 +300,7 @@ class Project < Hash
|
|
265
300
|
logfile=get_logfile ['work']
|
266
301
|
if(File.exists?(wrk_dir))
|
267
302
|
rake_default=Command.new({:input =>'rake default',:quiet => true,:ignore_failure => true})
|
268
|
-
if(last_work_mtime.nil? || last_work_mtime <
|
303
|
+
if(last_work_mtime.nil? || last_work_mtime < Dir.get_latest_mtime(wrk_dir))
|
269
304
|
Dir.chdir(wrk_dir) do
|
270
305
|
|
271
306
|
@env.out fullname
|
@@ -392,16 +427,28 @@ class Project < Hash
|
|
392
427
|
checkout
|
393
428
|
if(File.exists?(wrk_dir))
|
394
429
|
Dir.chdir(wrk_dir) do
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
430
|
+
if(File.exists?('.git'))
|
431
|
+
pull=Command.execute(Command.new({:input => 'git pull', :quiet => true, :ignore_failure => true}))
|
432
|
+
@env.out pull.summary
|
433
|
+
return pull
|
434
|
+
#pull=Command.new('git pull')
|
435
|
+
#rake_default[:quiet]=true
|
436
|
+
#rake_default[:ignore_failure]=true
|
437
|
+
#rake_default.execute
|
438
|
+
#return rake_defa
|
439
|
+
end
|
440
|
+
if(File.exists?('svn'))
|
441
|
+
updateCmd=Command.execute(Command.new({:input => 'svn update', :quiet => true, :ignore_failure => true}))
|
442
|
+
@env.out updateCmd.summary
|
443
|
+
return updateCmd
|
444
|
+
end
|
445
|
+
#rake_default=Command.new('svn update')
|
446
|
+
#rake_default[:quiet]=true
|
447
|
+
#rake_default[:ignore_failure]=true
|
448
|
+
#rake_default.execute
|
403
449
|
end
|
404
450
|
end
|
451
|
+
return Command.new({:exit_code => 1})
|
405
452
|
end
|
406
453
|
|
407
454
|
def tags
|
data/lib/base/projects.rb
CHANGED
@@ -20,12 +20,14 @@ class Projects < Hash
|
|
20
20
|
"#{@env.root_dir}/data/Projects.json"
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
def current
|
24
|
+
fullname=Rake.application.original_dir.gsub("#{Environment.default.wrk_dir}/",'')
|
25
|
+
if(self.has_key? fullname)
|
26
|
+
self[fullname]
|
27
|
+
else
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
end
|
29
31
|
|
30
32
|
def save
|
31
33
|
Dir.make File.dirname(filename) if !File.exists? File.dirname(filename)
|
@@ -79,6 +81,19 @@ class Projects < Hash
|
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
84
|
+
def remove args
|
85
|
+
projects=get_projects args
|
86
|
+
puts "removing #{projects.length} projects..." if @env.debug?
|
87
|
+
remove_keys=[]
|
88
|
+
projects.each{|project|
|
89
|
+
project.clobber
|
90
|
+
remove_keys << project.fullname
|
91
|
+
}
|
92
|
+
remove_keys.each{|key|self.delete(key)}
|
93
|
+
self.save
|
94
|
+
return 0
|
95
|
+
end
|
96
|
+
|
82
97
|
def help args
|
83
98
|
end
|
84
99
|
|
@@ -125,6 +140,7 @@ class Projects < Hash
|
|
125
140
|
project.list
|
126
141
|
|
127
142
|
}
|
143
|
+
return 0
|
128
144
|
end
|
129
145
|
|
130
146
|
def make args
|
@@ -162,12 +178,18 @@ class Projects < Hash
|
|
162
178
|
end
|
163
179
|
|
164
180
|
def update args
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
181
|
+
projects=get_projects args
|
182
|
+
puts "updating #{projects.length} projects..." if @env.debug?
|
183
|
+
projects.each{|project|
|
184
|
+
begin
|
185
|
+
puts "updating #{project.fullname}" if @env.debug?
|
186
|
+
result=project.update
|
187
|
+
exit_code=result.exit_code if(result.exit_code!=0)
|
188
|
+
rescue => error
|
189
|
+
puts "error raised during update #{project.fullname}"
|
190
|
+
puts "--------------------------------------------"
|
191
|
+
puts error
|
192
|
+
puts "--------------------------------------------"
|
171
193
|
end
|
172
194
|
}
|
173
195
|
end
|
data/lib/base/text.rb
CHANGED
@@ -3,16 +3,28 @@ puts __FILE__ if defined?(DEBUG)
|
|
3
3
|
class Text
|
4
4
|
def self.replace_in_glob(glob,search,replace)
|
5
5
|
Dir.glob(glob).each{ |f| replace_in_file(f,search,replace) }
|
6
|
-
|
6
|
+
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
def self.replace_in_file(filename,search,replace)
|
9
|
+
text1 = IO.read(filename)
|
10
|
+
text2 = text1.gsub(search) { |str| str=replace }
|
11
|
+
unless text1==text2
|
12
|
+
File.open(filename,"w") { |f| f.puts text2 }
|
13
|
+
return true
|
14
|
+
end
|
15
|
+
false
|
16
|
+
end
|
17
17
|
|
18
|
+
def self.copy_if_different(source,destination)
|
19
|
+
if(!File.exists?(destination))
|
20
|
+
FileUtils.cp source, destination
|
21
|
+
else
|
22
|
+
source_text=IO.read(source)
|
23
|
+
destination_text=IO.read(destination)
|
24
|
+
if(source_text != destination_text)
|
25
|
+
FileUtils.rm destination
|
26
|
+
FileUtils.cp source, destination
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
18
30
|
end
|
data/lib/commands.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
puts __FILE__ if
|
1
|
+
puts __FILE__ if ENV.has_key?('DEBUG')
|
2
|
+
|
3
|
+
require_relative('apps.rb')
|
2
4
|
|
3
5
|
require 'json'
|
4
6
|
require 'rake/clean'
|
5
7
|
|
6
8
|
Dir.glob("#{File.dirname(__FILE__)}/tasks/*.rb").each{|rb|
|
7
|
-
require(rb)
|
9
|
+
require(rb) if !rb.include?('default')
|
8
10
|
}
|
9
11
|
class Commands < Hash
|
10
12
|
attr_accessor :env
|
data/lib/dev.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
puts __FILE__ if
|
1
|
+
puts __FILE__ if ENV.has_key?('DEBUG')
|
2
2
|
|
3
|
-
require_relative('base.rb')
|
4
|
-
require_relative('
|
5
|
-
require_relative('tasks.rb')
|
3
|
+
require_relative('base/environment.rb')
|
4
|
+
require_relative('base/projects.rb')
|
6
5
|
require_relative('commands.rb')
|
7
6
|
|
8
|
-
#PROJECT=Project.new()
|
9
7
|
|
10
8
|
class Dev
|
11
9
|
attr_accessor :env,:projects,:commands
|
@@ -44,6 +42,7 @@ class Dev
|
|
44
42
|
return projects.list(subargs) if subcommand=='list'
|
45
43
|
return projects.make(subargs) if subcommand=='make'
|
46
44
|
return projects.info(subargs) if subcommand=='info'
|
45
|
+
return projects.remove(subargs) if subcommand=='remove'
|
47
46
|
return projects.work(subargs) if subcommand=='work'
|
48
47
|
return projects.update(subargs) if subcommand=='update'
|
49
48
|
|
@@ -52,8 +51,6 @@ class Dev
|
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
|
-
|
56
|
-
|
57
54
|
def usage
|
58
55
|
return 0
|
59
56
|
@env.out 'usage: dev <subcommand> [options]'
|
@@ -70,4 +67,12 @@ class Dev
|
|
70
67
|
end
|
71
68
|
end
|
72
69
|
|
73
|
-
|
70
|
+
require_relative('base.rb')
|
71
|
+
#require_relative('apps.rb')
|
72
|
+
require_relative('tasks.rb')
|
73
|
+
require_relative('commands.rb')
|
74
|
+
|
75
|
+
puts "defining DEV" if Environment.default.debug?
|
76
|
+
DEV=Dev.new
|
77
|
+
require_relative('tasks/default.rb')
|
78
|
+
|
data/lib/tasks/default.rb
CHANGED
@@ -1,33 +1,57 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'rake'
|
3
2
|
require_relative('info.rb')
|
4
3
|
require_relative('../base/array.rb')
|
4
|
+
require_relative('../base/dir.rb')
|
5
5
|
require_relative('../base/environment.rb')
|
6
6
|
require_relative('../base/projects.rb')
|
7
|
+
require_relative('../base/project.rb')
|
7
8
|
require_relative('../base/timer.rb')
|
8
9
|
|
9
|
-
if
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
puts "defining DEFAULT TASK" if Environment.default.debug?
|
11
|
+
|
12
|
+
work_up_to_date=false
|
13
|
+
if(defined?(DEV))
|
14
|
+
puts "DEFAULT: DEV is defined" if DEV.env.debug?
|
15
|
+
project=DEV.projects.current
|
16
|
+
puts "project is nil" if DEV.env.debug? && project.nil?
|
17
|
+
if(!project.nil?)
|
18
|
+
if(project.work_up_to_date?)
|
19
|
+
puts "project work is up to date" if DEV.env.debug?
|
20
|
+
work_up_to_date=true
|
14
21
|
else
|
15
|
-
|
16
|
-
[:setup,:build,:test,:add,:commit,:publish,:clean,:push,:pull].each{|task| Rake::Task[task].invoke}
|
17
|
-
else
|
18
|
-
if(File.exists?('.svn'))
|
19
|
-
[:setup,:build,:test,:add,:commit,:publish,:clean,:update].each{|task| Rake::Task[task].invoke}
|
20
|
-
else
|
21
|
-
[:setup,:build,:test,:publish].each{|task| Rake::Task[task].invoke}
|
22
|
-
end
|
23
|
-
end
|
22
|
+
puts "project work is NOT up to date" if DEV.env.debug?
|
24
23
|
end
|
25
|
-
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
if(defined?(NO_DEFAULT_TASK))
|
28
|
+
puts "NO_DEFAULT_TASK is defined" if Environment.default.debug?
|
29
|
+
else
|
30
|
+
default_tasks=nil
|
31
|
+
default_tasks=DEFAULT_TASKS if defined? DEFAULT_TASKS
|
32
|
+
if(default_tasks.nil?)
|
33
|
+
if(work_up_to_date)
|
34
|
+
default_tasks=[]
|
35
|
+
elsif(File.exists?('.git'))
|
36
|
+
default_tasks=[:setup,:build,:test,:add,:commit,:publish,:clean,:push,:pull]
|
37
|
+
elsif File.exists?('.svn')
|
38
|
+
default_tasks=[:setup,:build,:test,:add,:commit,:publish,:clean,:update]
|
39
|
+
else
|
40
|
+
default_tasks=[:setup,:build,:test,:publish]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
puts "default_tasks=#{default_tasks}" if Environment.default.debug?
|
45
|
+
desc "default task #{default_tasks.to_s}"
|
46
|
+
task :default do
|
47
|
+
default_tasks.each{|task|
|
48
|
+
Rake::Task[task].invoke
|
49
|
+
}
|
50
|
+
project.mark_work_up_to_date if !project.nil?
|
26
51
|
puts "[:default] completed in #{TIMER.elapsed_str}" if !Environment.default.colorize?
|
27
52
|
if Environment.default.colorize?
|
28
53
|
require 'ansi/code'
|
29
54
|
puts ANSI.white + ANSI.bold + ":default" + " completed in " + ANSI.yellow + "#{TIMER.elapsed_str}" + ANSI.reset
|
30
55
|
end
|
31
|
-
|
32
|
-
end # :default
|
56
|
+
end
|
33
57
|
end
|
data/lib/tasks/doc.rb
CHANGED
data/lib/tasks/info.rb
CHANGED
data/lib/tasks/publish.rb
CHANGED
data/lib/tasks/push.rb
CHANGED
data/lib/tasks/setup.rb
CHANGED
data/lib/tasks/test.rb
CHANGED
data/lib/tasks/update.rb
CHANGED
data/lib/tasks.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.270
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Parslow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|