lib/upgrade.rb in dev_tasks-0.0.78 vs lib/upgrade.rb in dev_tasks-0.0.79
- old
+ new
@@ -15,12 +15,19 @@
end
}
if(defined?(DEV_TASKS))
if(DEV_TASKS[:dependencies].has_key?(:rake))
DEV_TASKS[:dependencies][:rake].each{|rake_dir|
- self.add "<%Environment.rake('#{rake_dir}','pull')%>" if(Dir.exists?(rake_dir))
- self.add "<%Environment.rake('#{rake_dir}','upgrade')%>" if(Dir.exists?(rake_dir))
- self.add "<%Environment.rake('#{rake_dir}','default')%>" if(Dir.exists?(rake_dir))
+
+ if(Dir.exists?(rake_dir))
+ newest_file_here=Dir.glob("**/*").max_by {|f| File.mtime(f)}
+ newest_file_rake_dir=nil
+ Dir.chdir(rake_dir) do
+ newest_file_rake_dir=Dir.glob("**/*").max_by {|f| File.mtime(f)}
+ end
+
+ self.add "<%Environment.rake('#{rake_dir}','default')%>" if(File.mtime(newest_file_rake_dir) > File.mtime(newest_file_here))
+ end
}
end
if(DEV_TASKS[:dependencies].has_key?(:source))
DEV_TASKS[:dependencies][:source].each{|source_dep|
\ No newline at end of file