lib/command/list.rb in narou-1.1.1 vs lib/command/list.rb in narou-1.1.2
- old
+ new
@@ -1,6 +1,6 @@
-# -*- coding: UTF-8 -*-
+# -*- coding: utf-8 -*-
#
# Copyright 2013 whiteleaf. All rights reserved.
#
require_relative "../database"
@@ -36,11 +36,14 @@
def output_list(novels)
puts " ID | 更新日 | タイトル"
novels.each do |novel|
id = novel["id"]
+ frozen = Narou.novel_frozen?(id)
+ disp_id = ((frozen ? "*" : "") + id.to_s).rjust(4)
+ disp_id = disp_id.sub("*", "<blue>*</blue>").termcolor if frozen
puts [
- ((Narou.novel_frozen?(id) ? "*" : "") + id.to_s).rjust(4),
+ disp_id,
novel["last_update"].strftime("%y/%m/%d"),
novel["title"],
@options["url"] ? novel["toc_url"] : nil
].compact.join(" | ")
end