Sha256: 53a7c43012b02213bbec5647b98464d7d84ccde050de919de86ec78429864006

Contents?: true

Size: 886 Bytes

Versions: 4

Compression:

Stored size: 886 Bytes

Contents

# -*- coding: UTF-8 -*-
#
# Copyright 2013 whiteleaf. All rights reserved.
#

require_relative "../helper"

module Command
  class Folder < CommandBase
    def initialize
      super("<target> [<target2> ...]")
      @opt.separator <<-EOS

  ・指定した小説の保存フォルダを開きます。

  Example:
    narou folder n9669bk
    narou folder musyoku
      EOS
    end

    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_by_os_filer(dir)
          puts dir
        else
          warn "#{target} は存在しません"
        end
      end
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
narou-1.1.1 lib/command/folder.rb
narou-1.1.0 lib/command/folder.rb
narou-1.1.0.rc2 lib/command/folder.rb
narou-1.1.0.rc1 lib/command/folder.rb