Class: Terraspace::CLI::List
- Inherits:
-
Object
- Object
- Terraspace::CLI::List
- Defined in:
- lib/terraspace/cli/list.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ List
constructor
A new instance of List.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ List
Returns a new instance of List.
3 4 5 6 |
# File 'lib/terraspace/cli/list.rb', line 3 def initialize(={}) @options = @type_dir = normalized_type end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/terraspace/cli/list.rb', line 8 def run dirs = Dir.glob("{app,vendor}/{modules,stacks}/*").select { |p| File.directory?(p) } dirs.sort.each do |path| if @type_dir puts path if path.include?("/#{@type_dir}/") else puts path end end end |