Sha256: c526d53f42372ea75d6bcf0b06ce145124773030168e7d6c658075f02388f911

Contents?: true

Size: 768 Bytes

Versions: 7

Compression:

Stored size: 768 Bytes

Contents

module Shipit
  class Status
    module Common
      def unknown?
        state == 'unknown'.freeze
      end

      def pending?
        state == 'pending'.freeze
      end

      def success?
        state == 'success'.freeze
      end

      def error?
        state == 'error'.freeze
      end

      def failure?
        state == 'failure'.freeze
      end

      def group?
        false
      end

      def simple_state
        state == 'error'.freeze ? 'failure'.freeze : state
      end

      def allowed_to_fail?
        commit.soft_failing_statuses.include?(context)
      end

      def hidden?
        commit.hidden_statuses.include?(context)
      end

      def required?
        commit.required_statuses.include?(context)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
shipit-engine-0.20.1 app/models/shipit/status/common.rb
shipit-engine-0.20.0 app/models/shipit/status/common.rb
shipit-engine-0.19.0 app/models/shipit/status/common.rb
shipit-engine-0.18.1 app/models/shipit/status/common.rb
shipit-engine-0.18.0 app/models/shipit/status/common.rb
shipit-engine-0.17.0 app/models/shipit/status/common.rb
shipit-engine-0.16.0 app/models/shipit/status/common.rb