errplane 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +1 -1
- data/lib/errplane/railtie.rb +33 -0
- data/lib/errplane/version.rb +1 -1
- metadata +1 -1
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use ruby-1.9.3-
|
1
|
+
rvm use ruby-1.9.3-p194@errplane_rails --create
|
data/lib/errplane/railtie.rb
CHANGED
@@ -1,9 +1,42 @@
|
|
1
1
|
require 'errplane'
|
2
2
|
require 'rails'
|
3
|
+
require 'rack'
|
3
4
|
|
4
5
|
module Errplane
|
5
6
|
class Railtie < ::Rails::Railtie
|
6
7
|
rake_tasks do
|
8
|
+
namespace :errplane do
|
9
|
+
task :test => :environment do
|
10
|
+
if Errplane.configuration.api_key.nil?
|
11
|
+
puts "Hey, you need to define an API key first. Run `rails g errplane <api-key>` if you didn't already."
|
12
|
+
exit
|
13
|
+
end
|
14
|
+
|
15
|
+
Errplane.configure do |config|
|
16
|
+
config.ignored_environments = []
|
17
|
+
end
|
18
|
+
|
19
|
+
class ::ErrplaneSampleException < Exception; end;
|
20
|
+
|
21
|
+
puts "Setting up ApplicationController.."
|
22
|
+
class ::ApplicationController < ::ActionController::Base
|
23
|
+
def test_action
|
24
|
+
raise ::ErrplaneSampleException.new("If you see this, Errplane is working.")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
::Rails.application.routes_reloader.execute_if_updated
|
29
|
+
::Rails.application.routes.draw do
|
30
|
+
match 'generate_sample_exception' => 'application#test_action'
|
31
|
+
end
|
32
|
+
|
33
|
+
puts "Generating sample request.."
|
34
|
+
env = ::Rack::MockRequest.env_for("/generate_sample_exception")
|
35
|
+
::Rails.application.call(env)
|
36
|
+
|
37
|
+
puts "Done. Check your email or http://errplane.com for the exception notice."
|
38
|
+
end
|
39
|
+
end
|
7
40
|
end
|
8
41
|
|
9
42
|
initializer "errplane.insert_rack_middleware" do |app|
|
data/lib/errplane/version.rb
CHANGED