errplane 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
data/lib/errplane.rb
CHANGED
@@ -36,8 +36,9 @@ module Errplane
|
|
36
36
|
def transmit_to_api(e, env)
|
37
37
|
begin
|
38
38
|
::Rails.logger.info("\nTransmitter: #{transmitter.inspect}")
|
39
|
-
::Rails.logger.info("\nBlack Box: #{assemble_black_box_for(e).
|
39
|
+
::Rails.logger.info("\nBlack Box: #{assemble_black_box_for(e).to_json}")
|
40
40
|
::Rails.logger.info("\nIgnorable Exception? #{ignorable_exception?(e)}")
|
41
|
+
::Rails.logger.info("\nEnvironment: #{ENV.to_hash}")
|
41
42
|
transmitter.relay(assemble_black_box_for(e)) unless ignorable_exception?(e)
|
42
43
|
rescue
|
43
44
|
configuration.logger.info("[Errplane] Something went terribly wrong. Exception failed to take off.")
|
data/lib/errplane/black_box.rb
CHANGED
@@ -11,7 +11,14 @@ module Errplane
|
|
11
11
|
:time => Time.now.to_i,
|
12
12
|
:message => @exception.message,
|
13
13
|
:backtrace => @exception.backtrace,
|
14
|
-
:exception_class => @exception.class.to_s
|
14
|
+
:exception_class => @exception.class.to_s,
|
15
|
+
:application_name => Errplane.configuration.application_name,
|
16
|
+
:rails_root => Errplane.configuration.rails_root,
|
17
|
+
:language => Errplane.configuration.language,
|
18
|
+
:language_version => Errplane.configuration.language_version,
|
19
|
+
:framework => Errplane.configuration.framework,
|
20
|
+
:framework_version => Errplane.configuration.framework_version,
|
21
|
+
:environment_variables => Errplane.configuration.environment_variables.to_hash,
|
15
22
|
}.to_json
|
16
23
|
end
|
17
24
|
end
|
@@ -3,6 +3,7 @@ module Errplane
|
|
3
3
|
attr_accessor :api_key
|
4
4
|
attr_accessor :api_host
|
5
5
|
attr_accessor :application_id
|
6
|
+
attr_accessor :application_name
|
6
7
|
|
7
8
|
attr_accessor :logger
|
8
9
|
attr_accessor :rails_environment
|
@@ -13,6 +14,7 @@ module Errplane
|
|
13
14
|
attr_accessor :language_version
|
14
15
|
attr_accessor :ignored_exceptions
|
15
16
|
attr_accessor :ignored_environments
|
17
|
+
attr_accessor :environment_variables
|
16
18
|
|
17
19
|
DEFAULTS = {
|
18
20
|
:api_host => "api.errplane.com",
|
data/lib/errplane/railtie.rb
CHANGED
@@ -12,13 +12,15 @@ module Errplane
|
|
12
12
|
|
13
13
|
config.after_initialize do
|
14
14
|
Errplane.configure(true) do |config|
|
15
|
-
config.logger
|
16
|
-
config.rails_environment
|
17
|
-
config.rails_root
|
18
|
-
config.
|
19
|
-
config.
|
20
|
-
config.
|
21
|
-
config.
|
15
|
+
config.logger ||= ::Rails.logger
|
16
|
+
config.rails_environment ||= ::Rails.env
|
17
|
+
config.rails_root ||= ::Rails.root
|
18
|
+
config.application_name ||= ::Rails.application.class.parent_name
|
19
|
+
config.framework = "Rails"
|
20
|
+
config.framework_version = ::Rails::VERSION::STRING
|
21
|
+
config.language = "Ruby"
|
22
|
+
config.language_version = "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
23
|
+
config.environment_variables = ENV.to_hash
|
22
24
|
end
|
23
25
|
|
24
26
|
if defined?(::ActionDispatch::DebugExceptions)
|
data/lib/errplane/version.rb
CHANGED
@@ -5,14 +5,14 @@ class ErrplaneGenerator < Rails::Generators::Base
|
|
5
5
|
|
6
6
|
source_root File.expand_path('../templates', __FILE__)
|
7
7
|
argument :api_key,
|
8
|
-
required:
|
8
|
+
required: true,
|
9
9
|
type: :string,
|
10
|
-
description: "API
|
10
|
+
description: "API key for your Errplane organization"
|
11
11
|
argument :application_id,
|
12
12
|
required: false,
|
13
|
-
default:
|
13
|
+
default: SecureRandom.hex(4),
|
14
14
|
type: :string,
|
15
|
-
description: "
|
15
|
+
description: "Identifier for this application (Leave blank and a new one will be generated for you)"
|
16
16
|
|
17
17
|
def copy_initializer_file
|
18
18
|
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.0
|
4
|
+
version: 0.1.0
|
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-23 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:
|