diff options
author | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-08-29 15:07:19 +0200 |
---|---|---|
committer | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-09-07 12:10:49 +0200 |
commit | 2c8b830fdbf749e8bb7461d5c3ce4699b77ce3ca (patch) | |
tree | 10e0c44ca36349acf1378d3191267c9d1493b321 /app/controllers | |
parent | bbba62fa51419b14be4f39873afdd45b5b248764 (diff) | |
download | gitlab-ce-2c8b830fdbf749e8bb7461d5c3ce4699b77ce3ca.tar.gz |
Code refactoring
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/ci/lints_controller.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb index fa57e6c5e14..62f6b23faba 100644 --- a/app/controllers/ci/lints_controller.rb +++ b/app/controllers/ci/lints_controller.rb @@ -7,13 +7,10 @@ module Ci def create @content = params[:content] + @error = Ci::GitlabCiYamlProcessor.validation_message(@content) - if @content.blank? - @status = false - @error = "Please provide content of .gitlab-ci.yml" - elsif !Ci::GitlabCiYamlProcessor.errors(@content).nil? - @status = false - @error = Ci::GitlabCiYamlProcessor.errors(@content) + unless @error.blank? + @status = @error.blank? else @config_processor = Ci::GitlabCiYamlProcessor.new(@content) @stages = @config_processor.stages |