Class: Terraspace::CLI::Info

Inherits:
Base
  • Object
show all
Extended by:
Memoist
Defined in:
lib/terraspace/cli/info.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Util::Pretty

#pretty_path, #pretty_time

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

This class inherits a constructor from Terraspace::CLI::Base

Instance Method Details

#infoObject



26
27
28
# File 'lib/terraspace/cli/info.rb', line 26

def info
  @mod.to_info
end

#runObject



5
6
7
8
9
10
11
# File 'lib/terraspace/cli/info.rb', line 5

def run
  if @options[:path]
    show_path
  else
    show_all
  end
end

#show_allObject



13
14
15
16
17
18
19
20
# File 'lib/terraspace/cli/info.rb', line 13

def show_all
  presenter = CliFormat::Presenter.new(@options)
  presenter.header = %w[Name Value]
  info.each do |k,v|
    presenter.rows << [k, v]
  end
  presenter.show
end

#show_pathObject



22
23
24
# File 'lib/terraspace/cli/info.rb', line 22

def show_path
  puts info[:cache_dir]
end