Class: GitWit::SshUserGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- GitWit::SshUserGenerator
show all
- Includes:
- Actions
- Defined in:
- lib/generators/git_wit/ssh_user/ssh_user_generator.rb
Instance Method Summary
collapse
#ssh_home, #ssh_sudoers
#dscl_group, #dscl_group_membership, #dscl_user
#etc_user
Instance Method Details
#add_user_to_group ⇒ Object
24
25
26
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 24
def add_user_to_group
dscl_group_membership ssh_user, ssh_group if mac?
end
|
#add_user_to_sudoers ⇒ Object
32
33
34
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 32
def add_user_to_sudoers
ssh_sudoers ssh_user
end
|
#build_home ⇒ Object
28
29
30
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 28
def build_home
ssh_home ssh_user, home
end
|
#check_user ⇒ Object
11
12
13
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 11
def check_user
raise Thor::Error, "GitWit ssh_user is not configured." unless ssh_user.present?
end
|
#create_group ⇒ Object
20
21
22
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 20
def create_group
dscl_group ssh_group if mac?
end
|
#create_user ⇒ Object
15
16
17
18
|
# File 'lib/generators/git_wit/ssh_user/ssh_user_generator.rb', line 15
def create_user
@home = dscl_user ssh_user, home if mac?
@home = etc_user ssh_user, home if linux?
end
|