diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-13 12:11:41 +0100 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-13 12:11:41 +0100 |
commit | c3b9774f4bd0499d1f3d629c4b9bd110e4106b66 (patch) | |
tree | 078b2c8d1d6cf04cbb7dc43865b09afd1320ddc4 /lib/tasks/gitlab/info.rake | |
parent | 71266ad28f2ec4e9c771659f781885164d9b0412 (diff) | |
download | gitlab-ce-c3b9774f4bd0499d1f3d629c4b9bd110e4106b66.tar.gz |
Update and add checks
Diffstat (limited to 'lib/tasks/gitlab/info.rake')
-rw-r--r-- | lib/tasks/gitlab/info.rake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/info.rake b/lib/tasks/gitlab/info.rake index 9f423628332..2f633974c83 100644 --- a/lib/tasks/gitlab/info.rake +++ b/lib/tasks/gitlab/info.rake @@ -84,7 +84,13 @@ namespace :gitlab do # Helper methods - # Runs the given command and matches the output agains the given RegExp + # Runs the given command and matches the output agains the given pattern + # + # Returns nil if nothing matched + # Retunrs the MatchData if the pattern matched + # + # see also #run + # see also String#match def run_and_match(command, regexp) run(command).try(:match, regexp) end @@ -93,6 +99,8 @@ namespace :gitlab do # # Returns nil if the command was not found # Returns the output of the command otherwise + # + # see also #run_and_match def run(command) unless `#{command} 2>/dev/null`.blank? `#{command}` |