class TerraspaceBundler::Info

Public Instance Methods

lockfile() click to toggle source
# File lib/terraspace_bundler/info.rb, line 28
def lockfile
  Lockfile.instance
end
run() click to toggle source
# File lib/terraspace_bundler/info.rb, line 3
def run
  file = TB.config.lockfile
  unless File.exist?(file)
    logger.info "No #{file} found".color(:red)
    logger.info "Maybe run: terraspace bundle"
    return
  end
  
  name = @options[:mod]
  found = lockfile.mods.find { |m| m.name == @options[:mod] }
  if found
    show(found)
  else
    logger.info "Could not find module in #{TB.config.lockfile}: #{name}".color(:red)
  end
end
show(mod) click to toggle source
# File lib/terraspace_bundler/info.rb, line 20
def show(mod)
  props = mod.props.reject { |k,v| k == :name }.stringify_keys # for sort
  puts "#{mod.name}:"
  props.keys.sort.each do |k|
    puts "    #{k}: #{props[k]}"
  end
end