Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-13 15:11:41 +0400
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-13 15:11:41 +0400
commitc3b9774f4bd0499d1f3d629c4b9bd110e4106b66 (patch)
tree078b2c8d1d6cf04cbb7dc43865b09afd1320ddc4 /lib/tasks/gitlab/info.rake
parent71266ad28f2ec4e9c771659f781885164d9b0412 (diff)
Update and add checks
Diffstat (limited to 'lib/tasks/gitlab/info.rake')
-rw-r--r--lib/tasks/gitlab/info.rake10
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}`