Sha256: f0fb4e967ba2b4fe79ecc7a131957fbc60ffac5f2c1ac69bf8c630b5066e5f3d

Contents?: true

Size: 1.42 KB

Versions: 16

Compression:

Stored size: 1.42 KB

Contents

$stdout.sync = true
require 'rubygems'
require 'bundler'
require 'bundler/setup'
ENV['RACK_ENV'] ||= ENV['RAILS_ENV'].present? ? ENV['RAILS_ENV'] : 'development'
Bundler.require :default, (ENV['RACK_ENV'] || 'development').to_sym


class SinatraApp < Sinatra::Base
  use Rack::Config do |env|
    env["action_dispatch.parameter_filter"] = [:password] # This is highly recommended.  It will prevent the ExceptionNotification email from including your users' passwords
  end

  use ExceptionNotification::Rack,
    :asana => {
      asana_api_key: ENV['ASANA_API_KEY'],
      workspace: ENV['ASANA_WORKSPACE_ID'],
      assignee: 'me',
      assignee_status: 'today', # 'today'
      due_at:  Time.now.iso8601,
      due_on: nil,
      hearted: false,
      hearts: [],
      projects: [],
      followers: [],
      memberships: [],
      tags: [],
      name: nil,
      notes: '',
      template_path: nil
    }

  get '/' do
    raise StandardError, "ERROR: #{params[:error]}" unless params[:error].blank?
    'Everything is fine! Now, lets break things clicking <a href="/?error=ops"> here </a>. Dont forget to see the asana tasks at <a href="http://asana.com">Asana</a> !'
  end

  get '/background_notification' do
    begin
      1/0
    rescue Exception => exception
      ExceptionNotifier.notify_exception(exception, :data => {:msg => "Cannot divide by zero!"})
    end
    'Check notification at <a href="http://asana.com">Asana</a>.'
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
asana_exception_notifier-2.2.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-2.1.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-2.0.2 examples/sinatra/sinatra_app.rb
asana_exception_notifier-2.0.1 examples/sinatra/sinatra_app.rb
asana_exception_notifier-2.0.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-1.1.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-1.0.2 examples/sinatra/sinatra_app.rb
asana_exception_notifier-1.0.1 examples/sinatra/sinatra_app.rb
asana_exception_notifier-1.0.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.8.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.7.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.6.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.5.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.4.0 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.3.8 examples/sinatra/sinatra_app.rb
asana_exception_notifier-0.3.7 examples/sinatra/sinatra_app.rb