Class: RooOnRails::Checks::Papertrail::SystemNamed

Inherits:
EnvSpecific show all
Defined in:
lib/roo_on_rails/checks/papertrail/system_named.rb

Overview

Checks that the Papertrail system for an app in named like the app

Input context

Output context:

  • None

Instance Attribute Summary

Attributes inherited from EnvSpecific

#env

Instance Method Summary collapse

Methods inherited from EnvSpecific

#initialize, #signature

Methods inherited from Base

#initialize, requires, #run

Methods included from Helpers

#bold, included

Constructor Details

This class inherits a constructor from RooOnRails::Checks::EnvSpecific

Instance Method Details

#callObject



27
28
29
30
31
32
33
# File 'lib/roo_on_rails/checks/papertrail/system_named.rb', line 27

def call
  data = context.papertrail.client.get_system(system_id)

  fail! "wrong name for Papertrail system '#{system_id}' found" if data.name != app_name

  pass "system #{system_id} named #{app_name}"
end

#fixObject



35
36
37
# File 'lib/roo_on_rails/checks/papertrail/system_named.rb', line 35

def fix
  context.papertrail.client.update_system(system_id, app_name)
end

#introObject



23
24
25
# File 'lib/roo_on_rails/checks/papertrail/system_named.rb', line 23

def intro
  'Checking that the app is named in Papertrail'
end