class Pakman::List

Attributes

opts[R]

Public Class Methods

new( opts ) click to toggle source
# File lib/pakman/cli/commands/list.rb, line 11
def initialize( opts )
  @opts = opts
end

Public Instance Methods

run() click to toggle source
# File lib/pakman/cli/commands/list.rb, line 17
def run
  manifests = installed_template_manifests

  puts 'Installed template packs in search path'

  installed_template_manifest_patterns.each_with_index do |pattern,i|
    puts "    [#{i+1}] #{pattern}"
  end
  puts '  include:'

  if manifests.empty?
    puts "    -- none --"
  else
    manifests.each do |manifest|
      puts "%16s (%s)" % [manifest[0].gsub('.txt',''), manifest[1]]
    end
  end
end