Module: Appifier::Helpers::User
- Defined in:
- lib/appifier/helpers/user.rb
Instance Method Summary collapse
-
#current_user ⇒ String
return the current user name.
-
#group_root ⇒ String
return the ‘root’ group name : root or wheel.
-
#is_root? ⇒ Bool
facility to verifying if the active process run as root.
-
#user_root ⇒ String
return the ‘root’ name.
Instance Method Details
#current_user ⇒ String
return the current user name
14 15 16 |
# File 'lib/appifier/helpers/user.rb', line 14 def current_user Etc.getpwuid(Process.uid).name end |
#group_root ⇒ String
return the ‘root’ group name : root or wheel
20 21 22 |
# File 'lib/appifier/helpers/user.rb', line 20 def group_root Etc.getgrgid(0).name end |
#is_root? ⇒ Bool
facility to verifying if the active process run as root
26 27 28 29 30 31 32 33 |
# File 'lib/appifier/helpers/user.rb', line 26 def is_root? case Process.uid when 0 true else false end end |
#user_root ⇒ String
return the ‘root’ name
8 9 10 |
# File 'lib/appifier/helpers/user.rb', line 8 def user_root Etc.getpwuid(0).name end |