Class: Anamo::Users::Thor

Inherits:
Thor
  • Object
show all
Defined in:
lib/anamo/users/thor.rb

Instance Method Summary collapse

Instance Method Details

#execObject



15
16
17
18
19
20
# File 'lib/anamo/users/thor.rb', line 15

def exec

  data = inspect false
  ::Anamo::Api.new.post_users data

end

#inspect(output = true) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/anamo/users/thor.rb', line 26

def inspect output = true

  ret = CSV.generate do |csv|
    Etc.passwd do |u|
      csv << [u.uid, u.gid, u.name, u.gecos, u.dir, u.shell]
    end
  end

  puts ret if output

  ret

end