Method: Unix::Group#group_list

Defined in:
lib/beaker/host/unix/group.rb

#group_list(&block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/beaker/host/unix/group.rb', line 4

def group_list(&block)
  execute("getent group") do |result|
    groups = []
    result.stdout.each_line do |line|
      groups << (line.match(/^([^:]+)/) or next)[1]
    end

    yield result if block_given?

    groups
  end
end