lib/fusuma/plugin/appmatcher/user_switcher.rb in fusuma-plugin-appmatcher-0.1.0.pre vs lib/fusuma/plugin/appmatcher/user_switcher.rb in fusuma-plugin-appmatcher-0.1.0.pre2
- old
+ new
@@ -1,11 +1,14 @@
# frozen_string_literal: true
+require 'fusuma/custom_process'
require 'etc'
+
module Fusuma
module Plugin
module Appmatcher
class UserSwitcher
+ include CustomProcess
User = Struct.new(:username, :uid, :gid)
def initialize
username = ENV['SUDO_USER'] || Etc.getlogin
uid = `id -u #{username}`.chomp.to_i
gid = `id -g #{username}`.chomp.to_i