Sha256: afd521c7914b0f9ef17c7652ea907baa4df75273f2962791ee0063c820271ac0

Contents?: true

Size: 1009 Bytes

Versions: 15

Compression:

Stored size: 1009 Bytes

Contents

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

15 entries across 15 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.30.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.29.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.28.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.28.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.27.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.27.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.26.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.25.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.25.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.24.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.23.1 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.23.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.22.0 app/helpers/shipit/deploys_helper.rb
shipit-engine-0.21.0 app/helpers/shipit/deploys_helper.rb