You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

rubyzip.rake 802 B

12 years ago
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
12 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1234567891011121314151617181920212223242526272829303132333435363738
  1. desc "nyan ruby zip operation"
  2. task :zip do
  3. puts "input rake zip:clean_tmp will removed tmp/*.zip ."
  4. end
  5. namespace :zip do
  6. desc "ruby zip sweeper"
  7. task :clean_tmp do
  8. unless File.exist?(Dir.pwd+"/tmp/archiveZip")
  9. puts "tmp/archiveZip folder is not exist. "
  10. next
  11. end
  12. puts "ruby zip sweeping..."
  13. Dir.chdir('tmp/archiveZip') do
  14. Dir['*'].select do |file|
  15. if file =~ /archive_\d+\.zip/
  16. File.delete(file)
  17. puts "#{file} is deleted."
  18. end
  19. end
  20. end
  21. puts "ruby zip sweeping is done."
  22. end
  23. end
  24. desc "create tmp file, to test"
  25. file 'tmp/test.yml' do
  26. require 'yaml'
  27. var = {
  28. :name => "name",
  29. :age => "age",
  30. :agent => "agent"
  31. }
  32. File.open('tmp/test.yml', 'w') do |f|
  33. f.write YAML.dump({'conf' => var })
  34. end
  35. end

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...