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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea54a62f94f805069fdaceea2a117554503c694c
4
- data.tar.gz: ba621b5a7a598c6defe334ae315197840569acbf
3
+ metadata.gz: 4908b902460416cf75e0d35585a8e5fe05ca7122
4
+ data.tar.gz: 9a891b42bb6cebad8ab1b4813ed16545098c2524
5
5
  SHA512:
6
- metadata.gz: c9c2e7a7f874508408b9dec4c6594958b03172cb92df9d99fb91e8dd64c65129b7a2ff28a7f858b2689b4949d2a1fb839ae550e92d3a9895abbf4c74c2e7f299
7
- data.tar.gz: 74017d92a687408d4d7f7029601194d38f01b56c4e0e4e86f55caab1e23e56ea45a2cdabcb98aa0ad4581748d8dec79da04f4ee15216a6fb67c1fa09663cd81b
6
+ metadata.gz: aaf091b3011036fab4b3397868320ed71ac4ea508b7848f6f1b889905f3d65695c3650f2bb467294060775fd81a717d8ad17b4d573f2ca52eab64aa94dab7adc
7
+ data.tar.gz: 24993f2046efc7c305b07f0046236bae634768777358d7e0b29cd3f6acab01a77578632b31074ea0ce09c69585acb68a523b411a5c32aa8052ebfbac07f82808
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.8
2
+
3
+ - Validate the sentry/raven dsn when creating the appender
4
+
1
5
  ## v0.1.7
2
6
 
3
7
  - Add support for sneakers
@@ -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
- fail("Options should be a Hash") unless options.is_a?(Hash)
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)
@@ -1,3 +1,3 @@
1
1
  module Sapience
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson