Show
Ignore:
Timestamp:
12/11/07 08:35:14 (13 months ago)
Author:
walf443
Message:

lang/ruby/coderepos_stat/Rakefile: Changed to make backup in generating data. And added cleanbackup task.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/coderepos_stat/Rakefile

    r3039 r3041  
    3535      path.parent.mkpath 
    3636    end 
     37    if path.exist?  
     38      path.rename("#{path.to_s}.backup#{Time.now.strftime('%Y%m%d%H%M%S')}") 
     39    end 
    3740    path.open('w') do |f| 
    3841      YAML.dump(data, f) 
    3942    end 
    4043  end 
     44end 
    4145 
     46desc 'cleanbackup' 
     47task :cleanbackup do 
     48  require 'pathname' 
     49  Pathname.glob('data/*/*.yaml.backup*') do |path| 
     50    path.delete 
     51  end 
    4252end 
     53 
     54task :clean => [:cleanbackup]