Class: Neetob::CLI::Local::Ls

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/local/ls.rb

Constant Summary

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(apps, dir, sandbox = false) ⇒ Ls

Returns a new instance of Ls.



11
12
13
14
15
16
# File 'lib/neetob/cli/local/ls.rb', line 11

def initialize(apps, dir, sandbox = false)
  super()
  @apps = apps
  @dir = dir
  @sandbox = sandbox
end

Instance Attribute Details

#appsObject

Returns the value of attribute apps.



9
10
11
# File 'lib/neetob/cli/local/ls.rb', line 9

def apps
  @apps
end

#dirObject

Returns the value of attribute dir.



9
10
11
# File 'lib/neetob/cli/local/ls.rb', line 9

def dir
  @dir
end

#sandboxObject

Returns the value of attribute sandbox.



9
10
11
# File 'lib/neetob/cli/local/ls.rb', line 9

def sandbox
  @sandbox
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
25
# File 'lib/neetob/cli/local/ls.rb', line 18

def run
  matching_apps = find_all_matching_apps_or_repos(apps, :github, sandbox, true)
  matching_apps.each do |app|
    app_name = app.split("/")[1]
    ui.info("\nListing files from #{app_name}/#{dir}\n")
    ui.info(`cd ./#{app_name} && ls #{dir}`)
  end
end