Sha256: 9c5a3c04892a1917fdaf4de99fc726f4f9da03c5e33dc6830cc6b55079661470
Contents?: true
Size: 1.42 KB
Versions: 19
Compression:
Stored size: 1.42 KB
Contents
module Autoproj module CLI class MainGlobal < Thor namespace 'global' desc 'register', 'register the current workspace' def register require 'autoproj' ws = Workspace.default ws.load_config ws.register_workspace end desc 'status', 'display information about the known workspaces' def status require 'autoproj' ws = Workspace.registered_workspaces fields = Workspace::RegisteredWorkspace.members.map(&:to_s) format_w = fields.map(&:length).max + 1 format = "%-#{format_w}s %s (%s)" blocks = ws.map do |w| %w[root_dir prefix_dir build_dir].map do |name| dir = w.public_send(name) if dir.start_with?('/') status = if File.directory?(dir) Autobuild.color('present', :green) else Autobuild.color('absent', :yellow) end format(format, "#{name}:", dir, status) end end.compact.join("\n") end puts blocks.join("---\n") end end end end
Version data entries
19 entries across 19 versions & 1 rubygems