Class: Dutiful::Command::List

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/dutiful/commands/list.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dutiful/commands/list.rb', line 4

def execute
  Dutiful::Logger.set false, verbose?
  Dutiful::Logger.info "Storage: #{Dutiful::Config.storage.name}\n\n"

  Dutiful::Application.each do |application|
    Dutiful::Logger.info "#{application.name}:\n" if application.tracked? || verbose?

    application.files.map do |file|
      Dutiful::Logger.info "  #{file}" if file.tracked? || verbose?
    end.compact.join("\n")

    application.defaults.map do |default|
      Dutiful::Logger.info "  #{default}" if default.tracked? || verbose?
    end.compact.join("\n")
  end
end