Class: Command::Inspect
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from CommandBase
execute!, #force_change_settings_function, help, #hook_call, #load_local_settings, #tagname_to_ids
Constructor Details
Returns a new instance of Inspect.
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/command/inspect.rb', line 18
def initialize
super("[<target> ...]")
@opt.separator "\n \u30FB\u5F15\u6570\u3092\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u5834\u5408\u306F\u76F4\u524D\u306B\u5909\u63DB\u3057\u305F\u5C0F\u8AAC\u306E\u72B6\u614B\u8ABF\u67FB\u72B6\u6CC1\u30ED\u30B0\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n \u30FB\u5C0F\u8AAC\u3092\u6307\u5B9A\u3057\u305F\u5834\u5408\u306F\u305D\u306E\u5C0F\u8AAC\u306E\u30ED\u30B0\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n \u30FBnarou setting convert.inspect=true \u3068\u3059\u308C\u3070\u5909\u63DB\u6642\u306B\u5E38\u306B\u8868\u793A\u3055\u308C\u308B\u3088\u3046\u306B\u306A\u308A\u307E\u3059\u3002\n\n Examples:\nnarou inspect # \u76F4\u524D\u306E\u5909\u63DB\u6642\u306E\u30ED\u30B0\u3092\u8868\u793A\nnarou inspect 6 # \u30ED\u30B0\u3092\u8868\u793A\u3057\u305F\u3044\u5C0F\u8AAC\u3092\u6307\u5B9A\u3059\u308B\n EOS\nend\n"
|
Class Method Details
.oneline_help ⇒ Object
14
15
16
|
# File 'lib/command/inspect.rb', line 14
def self.oneline_help
"小説状態の調査状況ログを表示します"
end
|
Instance Method Details
#display_log(title) ⇒ Object
54
55
56
57
58
|
# File 'lib/command/inspect.rb', line 54
def display_log(title)
puts "(#{title} の小説状態調査状況ログ)"
novel_setting = NovelSetting.load(title, false)
puts Inspector.read_messages(novel_setting) || "調査ログがまだ無いようです"
end
|
#execute(argv) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/command/inspect.rb', line 32
def execute(argv)
super
if argv.empty?
latest_id = Inventory.load("latest_convert", :local)["id"]
if latest_id
data = Downloader.get_data_by_target(latest_id)
display_log(data["title"])
end
return
end
tagname_to_ids(argv)
argv.each_with_index do |target, i|
Helper.print_horizontal_rule if i > 0
data = Downloader.get_data_by_target(target)
unless data
error "#{target} は存在しません"
next
end
display_log(data["title"])
end
end
|