Show
Ignore:
Timestamp:
01/21/08 00:22:02 (10 months ago)
Author:
machu
Message:

platform/tdiary/Rakefile: add to_euc task for packaging

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/Rakefile

    r5126 r5127  
    44package = { 
    55  :name => 'tdiary-contrib', 
    6   :include_dir => %w[doc filter lib misc pkg plugin spec test util].map{|d| "#{d}/**/*" }, 
     6  :include_dir => %w[doc filter lib misc plugin spec test util].map{|d| "#{d}/**/*" }, 
    77  :binary_ext => %w[.swf] 
    88} 
     
    2121  p.need_tar_gz = true 
    2222end 
     23 
     24desc 'convert source encoding from UTF-8 to EUC-JP' 
     25task :to_euc => pkg.package_dir_path 
     26file pkg.package_dir_path do |t| 
     27  t.prerequisites.each do |f| 
     28    filename = "#{pkg.package_dir_path}/#{f}" 
     29    # exclude directories and binary files 
     30    if (File.ftype(filename) == "file" && 
     31        !package[:binary_ext].include?(File.extname(filename))) 
     32      sh "nkf -e #{filename} > #{filename}.tmp && mv #{filename}.tmp #{filename}" 
     33    end 
     34  end 
     35  sh "touch #{t.name}" 
     36end