Class: Lono::Extension::List

Inherits:
Object
  • Object
show all
Defined in:
lib/lono/extension/list.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ List

Returns a new instance of List.



5
6
7
8
# File 'lib/lono/extension/list.rb', line 5

def initialize(options={})
  @options = options
  @stack, @blueprint, @template, @param = Lono::Conventions.new(options).values
end

Instance Method Details

#blueprint_configsetsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/lono/extension/list.rb', line 18

def blueprint_configsets
  Lono::Extensions::Preparer.new(@options).run # register and materialize gems
  tracked_extension_names = Lono::Jade::Registry.tracked_extensions.map(&:name)

  finder = Lono::Finder::Extension.new
  jadespecs = finder.find_all

  presenter = CliFormat::Presenter.new(@options)
  presenter.header = %w[Name Path Type]
  jadespecs.each do |j|
    if tracked_extension_names.include?(j.name)
      pretty_path = j.root.sub("#{Lono.root}/",'').sub(ENV["HOME"], "~")
      presenter.rows << [j.name, pretty_path, j.source_type]
    end
  end
  presenter.show
end

#project_configsetsObject



36
37
38
# File 'lib/lono/extension/list.rb', line 36

def project_configsets
  Lono::Finder::Extension.list(filter_materialized: true, message: "Project extensions:")
end

#runObject



10
11
12
13
14
15
16
# File 'lib/lono/extension/list.rb', line 10

def run
  if @blueprint
    blueprint_configsets
  else
    project_configsets
  end
end