BigW Consortium Gitlab

gitlab_ci_yml.rb 516 Bytes
Newer Older
1 2 3 4 5 6 7
module BlobViewer
  class GitlabCiYml < Base
    include ServerSide
    include Auxiliary

    self.partial_name = 'gitlab_ci_yml'
    self.loading_partial_name = 'gitlab_ci_yml_loading'
8
    self.file_types = %i(gitlab_ci)
9 10 11 12 13 14 15
    self.binary = false

    def validation_message
      return @validation_message if defined?(@validation_message)

      prepare!

16
      @validation_message = Gitlab::Ci::YamlProcessor.validation_message(blob.data)
17 18 19 20 21 22 23
    end

    def valid?
      validation_message.blank?
    end
  end
end