sapience 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sapience/appender/sentry.rb +8 -1
- data/lib/sapience/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4908b902460416cf75e0d35585a8e5fe05ca7122
|
4
|
+
data.tar.gz: 9a891b42bb6cebad8ab1b4813ed16545098c2524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf091b3011036fab4b3397868320ed71ac4ea508b7848f6f1b889905f3d65695c3650f2bb467294060775fd81a717d8ad17b4d573f2ca52eab64aa94dab7adc
|
7
|
+
data.tar.gz: 24993f2046efc7c305b07f0046236bae634768777358d7e0b29cd3f6acab01a77578632b31074ea0ce09c69585acb68a523b411a5c32aa8052ebfbac07f82808
|
data/CHANGELOG.md
CHANGED
@@ -39,7 +39,8 @@ module Sapience
|
|
39
39
|
# Name of this application to appear in log messages.
|
40
40
|
# Default: Sapience.config.application
|
41
41
|
def initialize(options = {}, &block)
|
42
|
-
|
42
|
+
validate_options!(options)
|
43
|
+
|
43
44
|
options[:level] ||= :error
|
44
45
|
Raven.configure do |config|
|
45
46
|
config.dsn = options.delete(:dsn)
|
@@ -47,6 +48,12 @@ module Sapience
|
|
47
48
|
super(options, &block)
|
48
49
|
end
|
49
50
|
|
51
|
+
def validate_options!(options = {})
|
52
|
+
fail ArgumentError, "Options should be a Hash" unless options.is_a?(Hash)
|
53
|
+
fail ArgumentError, "Options need to have the key :dsn" unless options.key?(:dsn)
|
54
|
+
fail ArgumentError, "The :dsn key is not a valid URI" unless options[:dsn] =~ URI::DEFAULT_PARSER.regexp[:ABS_URI]
|
55
|
+
end
|
56
|
+
|
50
57
|
# Send an error notification to sentry
|
51
58
|
def log(log)
|
52
59
|
return false unless should_log?(log)
|
data/lib/sapience/version.rb
CHANGED