Sha256: 4d30d198be53c22385bd7a0427216707fa9fabaaaeff62f31c9ed8bdb04bcbc2

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

module Memo
  class Cli
    module Command
      class List
        def initialize(
          options,
          os: Memo::OS.new
        )
          @options = options
          @os = os
          @config = Memo::Config.new
        end

        def call
          namespace = @options.namespace
          is_all = @options.is_all
          type = @options.dir? ? "d" : "f"

          dir = if is_all
                  ""
                else
                  Memo::File.new(
                    "",
                    @options.namespace,
                  ).dir
                end

          @os.exec "find #{@config.root}/#{dir} -type #{type}"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ememo-0.1.7 lib/memo/cli/command/list.rb
ememo-0.1.6 lib/memo/cli/command/list.rb
ememo-0.1.5 lib/memo/cli/command/list.rb