diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-23 06:20:13 +0400 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-24 00:13:57 +0400 |
commit | 224da71177a0e79c436fff530af60260f33ade6c (patch) | |
tree | d76ed66b91cb0305bef4f0c588d6eb1cdcdc156a /lib/tasks/gitlab/info.rake | |
parent | 9655350c79e33ed765c62f892d65dd8c52284427 (diff) |
Extract task helper methods
Diffstat (limited to 'lib/tasks/gitlab/info.rake')
-rw-r--r-- | lib/tasks/gitlab/info.rake | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/tasks/gitlab/info.rake b/lib/tasks/gitlab/info.rake index 85458fe2c43..3fbedda7721 100644 --- a/lib/tasks/gitlab/info.rake +++ b/lib/tasks/gitlab/info.rake @@ -80,31 +80,5 @@ namespace :gitlab do puts "Git:\t\t#{Gitlab.config.git.bin_path}" end - - - # Helper methods - - # 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 - - # Runs the given command - # - # 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}` - end - end end end |