Changeset 7823

Show
Ignore:
Timestamp:
03/12/08 04:55:46 (9 months ago)
Author:
drry
Message:

platform/tdiary/Rakefile:

  • 重複した touch を除去しました。
  • ほか、整理。
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/Rakefile

    r7800 r7823  
    3636                end 
    3737        end 
    38                  
     38 
    3939        namespace :rcov do 
    4040                task :clean do 
     
    6666                # exclude directories and binary files 
    6767                next if File.ftype(filename) != 'file' || 
    68                         package[:binary_ext].include?(File.extname(filename)) 
    69                  
     68                        package[:binary_ext].include?(File.extname(filename)) 
     69 
    7070                case 
    7171                when Shell.new.find_system_command('nkf') 
    72                         sh "nkf -O --euc #{filename} #{filename}.tmp && " << 
    73                            "touch -m -r #{filename} #{filename}.tmp && "  << 
    74                            "mv #{filename}.tmp #{filename}" 
     72                        sh <<-EOS.gsub(/^\s+/, '') 
     73                                nkf -O --euc #{filename}{,.tmp} && \\ 
     74                                touch -m --reference=#{filename} #{filename}.tmp && \\ 
     75                                mv #{filename}{.tmp,} 
     76                        EOS 
    7577                when Shell.new.find_system_command('iconv') 
    76                         # use iconv instead of nkf in the following another way... 
    7778                        sh <<-EOS.gsub(/^\s+/, '') 
    7879                                iconv --from-code=utf-8 --to-code=euc-jp --output #{filename}{.tmp,} && \\ 
    79                                 touch -m -r #{filename}{,.tmp} && \\ 
     80                                touch -m --reference=#{filename} #{filename}.tmp && \\ 
    8081                                mv #{filename}{.tmp,} 
    8182                        EOS 
    82                         #else 
    83                         # ... or require 'nkf', 'iconv' 
    8483                end 
    85                 touch filename 
    8684        end 
    8785end