Class: Dpl::Provider::Status

Inherits:
Struct
  • Object
show all
Defined in:
lib/dpl/provider/status.rb

Constant Summary collapse

STATUS =
%i(dev alpha beta stable deprecated)
MSG =
{
  dev:        'Support for deployments to %s is in **development**',
  alpha:      'Support for deployments to %s is in **alpha**',
  beta:       'Support for deployments to %s is in **beta**',
  deprecated: 'Support for deployments to %s is *deprecated**',
  pre_stable: 'Please see [Maturity Levels](%s) for details.'
}
URL =
'https://github.com/travis-ci/dpl/#maturity-levels'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider, status, info) ⇒ Status

Returns a new instance of Status.



16
17
18
19
# File 'lib/dpl/provider/status.rb', line 16

def initialize(provider, status, info)
  unknown!(status) unless known?(status)
  super
end

Instance Attribute Details

#infoObject

Returns the value of attribute info

Returns:

  • (Object)

    the current value of info



3
4
5
# File 'lib/dpl/provider/status.rb', line 3

def info
  @info
end

#providerObject

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



3
4
5
# File 'lib/dpl/provider/status.rb', line 3

def provider
  @provider
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



3
4
5
# File 'lib/dpl/provider/status.rb', line 3

def status
  @status
end

Instance Method Details

#announce?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/dpl/provider/status.rb', line 21

def announce?
  !stable?
end

#msgObject



25
26
27
28
29
30
# File 'lib/dpl/provider/status.rb', line 25

def msg
  msg = "#{MSG[status] % name}"
  msg << "(#{info})" if info
  msg << ". #{MSG[:pre_stable] % URL}" if pre_stable?
  msg
end