errplane 0.1.7 → 0.1.8
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/lib/errplane.rb +1 -1
- data/lib/errplane/capistrano.rb +24 -0
- data/lib/errplane/deployment.rb +21 -0
- data/lib/errplane/rails/middleware/hijack_render_exception.rb +1 -1
- data/lib/errplane/railtie.rb +2 -2
- data/lib/errplane/version.rb +1 -1
- data/lib/rails/generators/errplane/errplane_generator.rb +7 -7
- metadata +4 -2
data/lib/errplane.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'errplane'
|
2
|
+
|
3
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
4
|
+
after 'deploy', 'deploy:notify_errplane'
|
5
|
+
after 'deploy:migrations', 'deploy:notify_errplane'
|
6
|
+
|
7
|
+
namespace :deploy do
|
8
|
+
desc 'Notify Errplane of the deployment'
|
9
|
+
task :notify_errplane, :except => {:no_release => true} do
|
10
|
+
puts "Notifying Errplane of the deployment.."
|
11
|
+
framework_env = fetch(:rails_env, fetch(:errplane_env, 'production'))
|
12
|
+
load File.join(Dir.pwd, "config/initializers/errplane.rb")
|
13
|
+
|
14
|
+
deploy_options = {
|
15
|
+
:framework_env => framework_env,
|
16
|
+
:scm_revision => current_revision,
|
17
|
+
:scm_repository => repository,
|
18
|
+
:api_key => Errplane.configuration.api_key
|
19
|
+
}
|
20
|
+
Errplane::Deployment.new.announce!(deploy_options)
|
21
|
+
puts 'Done.'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Errplane
|
2
|
+
class Deployment
|
3
|
+
def announce
|
4
|
+
http = Net::HTTP.new(Errplane.configuration.api_host, "80")
|
5
|
+
url = "/api/v1/deployments"
|
6
|
+
data = {}
|
7
|
+
response = begin
|
8
|
+
http.post(url, data)
|
9
|
+
rescue Exception => e
|
10
|
+
# e
|
11
|
+
end
|
12
|
+
|
13
|
+
case response
|
14
|
+
when Net::HTTPSuccess
|
15
|
+
# Success
|
16
|
+
else
|
17
|
+
# Failure
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -3,7 +3,7 @@ module Errplane
|
|
3
3
|
module Middleware
|
4
4
|
module HijackRenderException
|
5
5
|
def self.included(base)
|
6
|
-
base.send(:alias_method_chain
|
6
|
+
base.send(:alias_method_chain, :render_exception, :errplane)
|
7
7
|
end
|
8
8
|
|
9
9
|
def render_exception_with_errplane(env, e)
|
data/lib/errplane/railtie.rb
CHANGED
@@ -63,10 +63,10 @@ module Errplane
|
|
63
63
|
|
64
64
|
if defined?(::ActionDispatch::DebugExceptions)
|
65
65
|
require 'errplane/rails/middleware/hijack_render_exception'
|
66
|
-
::ActionDispatch::DebugExceptions.send(:include,Errplane::Rails::Middleware::HijackRenderException)
|
66
|
+
::ActionDispatch::DebugExceptions.send(:include, Errplane::Rails::Middleware::HijackRenderException)
|
67
67
|
elsif defined?(::ActionDispatch::ShowExceptions)
|
68
68
|
require 'errplane/rails/middleware/hijack_render_exception'
|
69
|
-
::ActionDispatch::ShowExceptions.send(:include,Errplane::Rails::Middleware::HijackRenderException)
|
69
|
+
::ActionDispatch::ShowExceptions.send(:include, Errplane::Rails::Middleware::HijackRenderException)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
data/lib/errplane/version.rb
CHANGED
@@ -6,14 +6,14 @@ class ErrplaneGenerator < Rails::Generators::Base
|
|
6
6
|
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
8
|
argument :api_key,
|
9
|
-
required
|
10
|
-
type
|
11
|
-
description
|
9
|
+
:required => true,
|
10
|
+
:type => :string,
|
11
|
+
:description => "API key for your Errplane organization"
|
12
12
|
argument :application_id,
|
13
|
-
required
|
14
|
-
default
|
15
|
-
type
|
16
|
-
description
|
13
|
+
:required => false,
|
14
|
+
:default => SecureRandom.hex(4),
|
15
|
+
:type => :string,
|
16
|
+
:description => "Identifier for this application (Leave blank and a new one will be generated for you)"
|
17
17
|
|
18
18
|
def copy_initializer_file
|
19
19
|
template "initializer.rb", "config/initializers/errplane.rb"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errplane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: This gem provides exception reporting with Errplane for Rails 3.x applications.
|
15
15
|
email:
|
@@ -27,7 +27,9 @@ files:
|
|
27
27
|
- errplane.gemspec
|
28
28
|
- lib/errplane.rb
|
29
29
|
- lib/errplane/black_box.rb
|
30
|
+
- lib/errplane/capistrano.rb
|
30
31
|
- lib/errplane/configuration.rb
|
32
|
+
- lib/errplane/deployment.rb
|
31
33
|
- lib/errplane/rack.rb
|
32
34
|
- lib/errplane/rails/middleware/hijack_render_exception.rb
|
33
35
|
- lib/errplane/railtie.rb
|