Commit e0d62d9c5fa1145ef5378db07f28c3d399e9c34d

Authored by Cameron Yule
1 parent 85de55a1

Replacing the manual parsing of the /etc/group file with the equivalent call fro…

…m the Etc class in the Ruby standard library. This has the benefit of supporting additional platforms (e.g. OS X).
Showing 1 changed file with 1 additions and 2 deletions   Show diff stats
lib/tasks/gitlab/task_helpers.rake
@@ -77,8 +77,7 @@ namespace :gitlab do @@ -77,8 +77,7 @@ namespace :gitlab do
77 end 77 end
78 78
79 def gid_for(group_name) 79 def gid_for(group_name)
80 - group_line = File.read("/etc/group").lines.select{|l| l.start_with?("#{group_name}:")}.first  
81 - group_line.split(":")[2].to_i 80 + Etc.getgrnam(group_name).gid
82 end 81 end
83 82
84 def warn_user_is_not_gitlab 83 def warn_user_is_not_gitlab