Method: Unix::User#user_list
- Defined in:
- lib/beaker/host/unix/user.rb
#user_list(&block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/beaker/host/unix/user.rb', line 4 def user_list(&block) execute("getent passwd") do |result| users = [] result.stdout.each_line do |line| users << (line.match( /^([^:]+)/) or next)[1] end yield result if block_given? users end end |