class RooOnRails::Checks::Documentation::Playbook

Constants

LOCATION

Public Instance Methods

call() click to toggle source
# File lib/roo_on_rails/checks/documentation/playbook.rb, line 14
def call
  fail! "no playbook at #{LOCATION}." if playbook_missing?
  final_fail! 'playbook still contains FIXME template sections' if playbook_unfinished?
  pass 'playbook found, legion on-call engineers thank you.'
end
fix() click to toggle source
# File lib/roo_on_rails/checks/documentation/playbook.rb, line 20
def fix
  FileUtils.cp(
    File.join(__dir__, 'playbook_template.md'),
    LOCATION
  )
end
intro() click to toggle source
# File lib/roo_on_rails/checks/documentation/playbook.rb, line 10
def intro
  'Looking for an on-call Playbook...'
end

Private Instance Methods

playbook_missing?() click to toggle source
# File lib/roo_on_rails/checks/documentation/playbook.rb, line 35
def playbook_missing?
  !File.exist?(LOCATION)
end
playbook_unfinished?() click to toggle source
# File lib/roo_on_rails/checks/documentation/playbook.rb, line 29
def playbook_unfinished?
  # The regexp is so that you can still refer to strings saying FIXME in your readme
  # if you need to, by putting the phrase in backticks: `FIXME`
  !File.read(LOCATION).match(/FIXME(?!`)/).nil?
end