Sha256: 6e48888cef624dcb30ffbd33ab39046202d8c811fd31f15d7ce0dff8307c1758

Contents?: true

Size: 665 Bytes

Versions: 1

Compression:

Stored size: 665 Bytes

Contents

projects = []
Dir.foreach(Hubbard::PROJECTS_PATH) do |project|
  next if project == "." || project == ".."
  if is_authorized(project, 'read')
    project_path = File.join(Hubbard::PROJECTS_PATH, project)
    vis = File.read(File.join(project_path, ".visibility")).strip 
    desc = File.read(File.join(project_path, ".description")).strip
    projects << { :name => project, :visibility => vis, :description => desc }
  end
end

projects = projects.sort_by { |project| project[:name] }

if @options[:format] == :yaml
  puts YAML::dump(projects)
else
  projects.each do |p| 
    puts "#{p[:name].ljust(16)} #{p[:visibility].ljust(10)} #{p[:description]}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hubbard-0.0.18 commands/list-projects.rb