gitlab-org--gitlab-foss/app/controllers/ci/lints_controller.rb
Katarzyna Kobierska 2c8b830fdb Code refactoring
2016-09-07 12:10:49 +02:00

27 lines
610 B
Ruby

module Ci
class LintsController < ApplicationController
before_action :authenticate_user!
def show
end
def create
@content = params[:content]
@error = Ci::GitlabCiYamlProcessor.validation_message(@content)
unless @error.blank?
@status = @error.blank?
else
@config_processor = Ci::GitlabCiYamlProcessor.new(@content)
@stages = @config_processor.stages
@builds = @config_processor.builds
@status = true
end
rescue
@error = 'Undefined error'
@status = false
ensure
render :show
end
end
end