diff options
author | Cameron Yule <cameron@cameronyule.com> | 2013-02-02 20:04:07 +0000 |
---|---|---|
committer | Cameron Yule <cameron@cameronyule.com> | 2013-02-02 20:04:07 +0000 |
commit | e0d62d9c5fa1145ef5378db07f28c3d399e9c34d (patch) | |
tree | d362ef779de7035ad854d78b9d66dff2b1949cf4 | |
parent | 85de55a120a615f8cf51a343a89789b802d776e2 (diff) | |
download | gitlab-ce-e0d62d9c5fa1145ef5378db07f28c3d399e9c34d.tar.gz |
Replacing the manual parsing of the /etc/group file with the equivalent call from the Etc class in the Ruby standard library. This has the benefit of supporting additional platforms (e.g. OS X).
-rw-r--r-- | lib/tasks/gitlab/task_helpers.rake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/task_helpers.rake b/lib/tasks/gitlab/task_helpers.rake index d494125f76c..cb4e34cc0d7 100644 --- a/lib/tasks/gitlab/task_helpers.rake +++ b/lib/tasks/gitlab/task_helpers.rake @@ -77,8 +77,7 @@ namespace :gitlab do end def gid_for(group_name) - group_line = File.read("/etc/group").lines.select{|l| l.start_with?("#{group_name}:")}.first - group_line.split(":")[2].to_i + Etc.getgrnam(group_name).gid end def warn_user_is_not_gitlab |