diff options
author | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-08-30 13:03:29 +0200 |
---|---|---|
committer | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-09-07 12:10:49 +0200 |
commit | 1a7a900d8e4a4a3a65b33054168fdd86f252b757 (patch) | |
tree | 8420740a7ddbbdcce6e18141684a2e8cbc326a49 /lib/ci | |
parent | 2c8b830fdbf749e8bb7461d5c3ce4699b77ce3ca (diff) | |
download | gitlab-ce-1a7a900d8e4a4a3a65b33054168fdd86f252b757.tar.gz |
Improve code
Diffstat (limited to 'lib/ci')
-rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index c547193ce4c..bdae3205511 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -79,15 +79,12 @@ module Ci end def self.validation_message(content) - if content.blank? - 'Please provide content of .gitlab-ci.yml' - else - begin - Ci::GitlabCiYamlProcessor.new(content) - nil - rescue ValidationError, Psych::SyntaxError => e - e.message - end + return 'Please provide content of .gitlab-ci.yml' if content.blank? + begin + Ci::GitlabCiYamlProcessor.new(content) + nil + rescue ValidationError, Psych::SyntaxError => e + e.message end end |