class Recipes::ErrorReporting

Public Instance Methods

ask() click to toggle source
# File lib/potassium/recipes/error_reporting.rb, line 2
def ask
  response = answer(:sentry) do
    Ask.confirm("Do you need to report application errors with Sentry?")
  end
  set(:report_error, response)
end
create() click to toggle source
# File lib/potassium/recipes/error_reporting.rb, line 9
def create
  if selected?(:report_error)
    gather_gem 'sentry-rails'
    template '../assets/config/sentry.rb.erb', 'config/initializers/sentry.rb'
    append_to_file '.env.development', "SENTRY_DSN=\n"
    add_readme_section :internal_dependencies, :sentry
  end
end
install() click to toggle source
# File lib/potassium/recipes/error_reporting.rb, line 18
def install
  set(:report_error, true)
  create
end
installed?() click to toggle source
# File lib/potassium/recipes/error_reporting.rb, line 23
def installed?
  gem_exists?(/sentry-rails/) && file_exist?('config/initializers/sentry.rb')
end