Sha256: 1343a0c8d8db0eeb40786f154e4dc26466eb81ad71b09669c21ef55031fc93f6

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true
module Shipit
  module DeploysHelper
    def render_checklist(checklist)
      return if checklist.blank?
      render('shipit/deploys/checklist', checklist: checklist)
    end

    def render_monitoring(stack)
      return unless stack.monitoring?
      render('shipit/deploys/monitoring', stack: stack)
    end

    def render_checks(commit)
      return unless commit.stack.checks?
      render('shipit/commit_checks/checks', commit: commit)
    end

    def render_monitoring_panel(panel_spec)
      if url = panel_spec['image']
        image_tag(url, panel_spec.slice('height', 'width', 'alt'))
      elsif url = panel_spec['iframe']
        content_tag(:iframe, '', panel_spec.slice('height', 'width').merge('src' => url))
      else
        content_tag(:span, "#{panel_spec.inspect} is not a valid monitoring panel spec")
      end
    end

    def deploy_status_in_words(status)
      case status
      when 'timedout'
        "Timed out"
      else
        status.capitalize
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.38.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.37.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.36.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.36.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.35.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.35.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.34.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.33.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.32.0 app/helpers/shipit/deploys_helper.rb