lib/command/send.rb in narou-1.4.4 vs lib/command/send.rb in narou-1.4.5
- old
+ new
@@ -30,21 +30,29 @@
# <device>の省略
narou setting device=kindle
narou send 6
narou send # 端末のファイルより新しいファイルがあれば送信
+ narou send --without-freeze # 凍結済は対象外に
+
+ Options:
EOS
+
+ @opt.on("--without-freeze", "`全話'送信時に凍結された小説は対象外にする") {
+ @options["without-freeze"] = true
+ }
end
def get_device(argv)
if argv.first && Device.exists?(argv.first)
return Narou.get_device(argv.shift)
end
Narou.get_device
end
def execute(argv)
+ load_local_settings
super
device = get_device(argv)
unless device
error "デバイス名が指定されていないか、間違っています。\n" +
"narou setting device=デバイス名 で指定出来ます。\n" +
@@ -62,9 +70,10 @@
send_all = false
titles = {}
if argv.empty?
send_all = true
Database.instance.each do |id, data|
+ next if @options["without-freeze"] && Narou.novel_frozen?(id)
argv << id
titles[id] = data["title"]
end
end
argv.each do |target|