class RooOnRails::Checks::Papertrail::SystemNamed

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

Input context

Output context:

Public Instance Methods

call() click to toggle source
# 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
fix() click to toggle source
# File lib/roo_on_rails/checks/papertrail/system_named.rb, line 35
def fix
  context.papertrail.client.update_system(system_id, app_name)
end
intro() click to toggle source
# File lib/roo_on_rails/checks/papertrail/system_named.rb, line 23
def intro
  'Checking that the app is named in Papertrail'
end

Private Instance Methods

app_name() click to toggle source
# File lib/roo_on_rails/checks/papertrail/system_named.rb, line 45
def app_name
  context.heroku.app[env]
end
heroku() click to toggle source
# File lib/roo_on_rails/checks/papertrail/system_named.rb, line 49
def heroku
  context.heroku.api_client
end
system_id() click to toggle source
# File lib/roo_on_rails/checks/papertrail/system_named.rb, line 41
def system_id
  context.papertrail.system_id[env]
end