Class: Memo::Cli::Command::List
- Inherits:
-
Object
- Object
- Memo::Cli::Command::List
- Defined in:
- lib/memo/cli/command/list.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options, os: Memo::OS.new) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(options, os: Memo::OS.new) ⇒ List
Returns a new instance of List.
5 6 7 8 9 10 11 12 |
# File 'lib/memo/cli/command/list.rb', line 5 def initialize( , os: Memo::OS.new ) = @os = os @config = Memo::Config.new end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/memo/cli/command/list.rb', line 14 def call namespace = .namespace is_all = .is_all type = .dir? ? "d" : "f" dir = if is_all "" else Memo::File.new( "", .namespace, ).dir end @os.exec "find #{@config.root}/#{dir} -type #{type}" end |