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].freeze
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.'
}.freeze
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.



18
19
20
21
# File 'lib/dpl/provider/status.rb', line 18

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



5
6
7
# File 'lib/dpl/provider/status.rb', line 5

def info
  @info
end

#providerObject

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



5
6
7
# File 'lib/dpl/provider/status.rb', line 5

def provider
  @provider
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



5
6
7
# File 'lib/dpl/provider/status.rb', line 5

def status
  @status
end

Instance Method Details

#announce?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/dpl/provider/status.rb', line 23

def announce?
  !stable?
end

#msgObject



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

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