PROJECT_NAME = Dir.pwd.split("/").last ENVIRONMENT_RB = 'config/environment.rb' APPLICATION_RB = 'app/controllers/application.rb' task :init_gettext do require 'fileutils' next if /\$KCODE = 'u'/ =~ IO.read(ENVIRONMENT_RB) FileUtils.cp ENVIRONMENT_RB, "#{ENVIRONMENT_RB}.bak" ## config/environemnt.rb に対する処理 File.open(ENVIRONMENT_RB, 'w') do |f| f.puts "$KCODE = 'u'" f.puts IO.read(ENVIRONMENT_RB +