Class: Command::Folder

Inherits:
CommandBase show all
Defined in:
lib/command/folder.rb

Instance Method Summary collapse

Methods inherited from CommandBase

execute!, #load_local_settings

Constructor Details

#initializeFolder

Returns a new instance of Folder.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/command/folder.rb', line 10

def initialize
  super("<target> [<target2> ...]")
  @opt.separator "\n  \u30FB\u6307\u5B9A\u3057\u305F\u5C0F\u8AAC\u306E\u4FDD\u5B58\u30D5\u30A9\u30EB\u30C0\u3092\u958B\u304D\u307E\u3059\u3002\n\n  Example:\nnarou folder n9669bk\nnarou folder musyoku\nnarou f 0\n  EOS\nend\n"

Instance Method Details

#execute(argv) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/command/folder.rb', line 23

def execute(argv)
  super
  if argv.empty?
    puts @opt.help
    return
  end
  argv.each do |target|
    dir = Downloader.get_novel_data_dir_by_target(target)
    if dir
      Helper.open_directory(dir)
      puts dir
    else
      error "#{target} は存在しません"
    end
  end
end

#oneline_helpObject



40
41
42
# File 'lib/command/folder.rb', line 40

def oneline_help
  "小説の保存フォルダを開きます"
end