dev 1.0.139 → 1.0.141
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dev/Project.rb +21 -3
- data/lib/dev/Tasks.rb +1 -1
- metadata +1 -1
data/lib/dev/Project.rb
CHANGED
@@ -36,9 +36,22 @@ class Project < Hash
|
|
36
36
|
return h
|
37
37
|
end
|
38
38
|
|
39
|
+
def refresh
|
40
|
+
update_default_values
|
41
|
+
end
|
39
42
|
def update_default_values
|
40
43
|
puts_debug "update_default_values"
|
44
|
+
#newValues=Hash.new
|
45
|
+
#self.each{ |k,v|
|
46
|
+
# newValues[k.to_s]=v if !self.has_key?(k.to_s)
|
47
|
+
#}
|
48
|
+
#self.merge(newValues)
|
41
49
|
|
50
|
+
if !self.has_key?(:dep) || self[:dep].nil?
|
51
|
+
puts_debug "assigning self[:dep] to Hash.new"
|
52
|
+
self[:dep]=Hash.new
|
53
|
+
end
|
54
|
+
self.delete(:setup) if self.has_key?(:setup)
|
42
55
|
["add","pull","setup","compile","test","features","commit","update" ].each do |k|
|
43
56
|
puts_debug "set_default_value(#{k})"
|
44
57
|
set_default_value(k)
|
@@ -244,7 +257,7 @@ class Project < Hash
|
|
244
257
|
end
|
245
258
|
|
246
259
|
def generate_auto_replace_directives
|
247
|
-
if(Dir.glob("**/*.vcxproj").count > 0 && !self[:dep].nil?)
|
260
|
+
if(Dir.glob("**/*.vcxproj").count > 0 && !self[:dep].nil? && !self[:dep].empty?)
|
248
261
|
self[:replace]=Hash.new if self[:replace].nil?
|
249
262
|
self[:dep].each{ |k,v|
|
250
263
|
if self[:dep][k].has_key?(:rev) && self[:dep][k].has_key?(:dir) && !self[:replace].has_key?(k)
|
@@ -390,13 +403,19 @@ class Project < Hash
|
|
390
403
|
|
391
404
|
array=Array.new
|
392
405
|
if(key=="setup")
|
406
|
+
puts_debug "assigning default values for setup"
|
393
407
|
#array << "bundle install" if File.exists?("Gemfile")
|
394
408
|
array << "{ :cmd=> 'bundle install', :capture_output=> false}" if File.exists?("Gemfile") && "#{RUBY_VERSION}">="1.8.7"
|
395
409
|
|
396
410
|
# dep,svn directives
|
411
|
+
puts_debug "checking for :dep hash...."
|
397
412
|
dep_hash=self.get_value("dep")
|
413
|
+
puts_debug "dep_hash is nil" if dep_hash.nil?
|
398
414
|
unless dep_hash.nil?
|
415
|
+
puts_debug "dep_hash is not nil"
|
416
|
+
puts_debug "dep_hash is empty" if dep_hash.empty?
|
399
417
|
dep_hash.each do |key,value|
|
418
|
+
puts_debug ":dep[#{key}.to_s]"
|
400
419
|
if value.kind_of?(Hash)
|
401
420
|
dep=Dev::Dep.new(value)
|
402
421
|
dep.setup_commands.each{|cmd| array << cmd}
|
@@ -525,5 +544,4 @@ end
|
|
525
544
|
end # module Dev
|
526
545
|
|
527
546
|
PROJECT=Dev::Project.new(nil,true)
|
528
|
-
|
529
|
-
PROJECT.update_default_values
|
547
|
+
PROJECT.refresh
|
data/lib/dev/Tasks.rb
CHANGED
@@ -62,7 +62,7 @@ def generate_tasks(project)
|
|
62
62
|
if(!defined?(DEV_NO_DEFAULT_TASK))
|
63
63
|
Rake.application.instance_variable_get('@tasks').delete('default')
|
64
64
|
task_list=""
|
65
|
-
["
|
65
|
+
["check","add","setup","replace","compile","post_compile","test","commit","update"].each {|t|
|
66
66
|
if(hash.has_key?(t.to_sym) || task_exists?(t) )
|
67
67
|
task_list = "#{task_list}," if task_list.length > 0
|
68
68
|
task_list = "#{task_list} :#{t}"
|