class Dpl::Provider::Status

Constants

MSG
STATUS
URL

Public Class Methods

new(provider, status, info) click to toggle source
Calls superclass method
# File lib/dpl/provider/status.rb, line 18
def initialize(provider, status, info)
  unknown!(status) unless known?(status)
  super
end

Public Instance Methods

announce?() click to toggle source
# File lib/dpl/provider/status.rb, line 23
def announce?
  !stable?
end
msg() click to toggle source
# 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

Private Instance Methods

deprecated?() click to toggle source
# File lib/dpl/provider/status.rb, line 48
def deprecated?
  status == :deprecated
end
known?(status) click to toggle source
# File lib/dpl/provider/status.rb, line 52
def known?(status)
  STATUS.include?(status)
end
name() click to toggle source
# File lib/dpl/provider/status.rb, line 36
def name
  provider.full_name
end
pre_stable?() click to toggle source
# File lib/dpl/provider/status.rb, line 40
def pre_stable?
  STATUS.index(status) < STATUS.index(:stable)
end
stable?() click to toggle source
# File lib/dpl/provider/status.rb, line 44
def stable?
  status == :stable
end
unknown!(status) click to toggle source
# File lib/dpl/provider/status.rb, line 56
def unknown!(status)
  raise "Unknown status: #{status.inspect}. Known statuses are: #{STATUS.map(&:inspect).join(', ')}"
end