lib/command/update.rb in narou-2.1.0 vs lib/command/update.rb in narou-2.1.1.pre.test1
- old
+ new
@@ -115,21 +115,21 @@
def view_log
list = get_log_paths
n = @options["log"]
if list[n]
- puts File.read(list[n])
+ puts File.read(list[n], encoding: Encoding::UTF_8)
else
error "#{n+1}番目のログはありません"
end
end
def save_log(log)
return unless @options["logging"]
create_log_dir
now = Time.now
logname = File.join(log_dirname, LOG_FILENAME_FORMAT % now.strftime("%Y%m%d_%H%M%S"))
- File.open(logname, "w") do |fp|
+ File.open(logname, "w:UTF-8") do |fp|
fp.puts "--- ログ出力日時 #{now.strftime("%Y/%m/%d %H:%M:%S")} ---"
fp.puts log
end
remove_old_log
end