dogcatcher 0.3.1 → 0.3.2

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: b052e77c35c4ffbaab0c67867dbfb5c03f689d18
4
- data.tar.gz: 9b63d6eba7b9aa4bd484440730b904fefe07c9bc
3
+ metadata.gz: c711a24746dd8c51fc688d1d4b507c540dc3ec9e
4
+ data.tar.gz: c98c797773e3cc00a6cfcffd79b76c60c461ae92
5
5
  SHA512:
6
- metadata.gz: 3299bdbe1bfaa7ae80f115225416a92089f788ccaa1f1a2161fb21bd95a7f28495b56eade2b4422b7038d3aaa237113e5cbcfb908508bf77f4426935494c811d
7
- data.tar.gz: fbb5f492edcc7438592e0f0de180525790f351f965e763eb10975aadc87ca67f954dea4911eaea2a8564d19207fd7182beb3192796be02f0ecf0348b1a0de12b
6
+ metadata.gz: a2238d61a7387f1623766a868c0bc1caaed215b7058248492ed367e8aa7e6b956581f2eade6ebff706e191b34aa43605a4cfd819bb61f2943f5699e54e0757a9
7
+ data.tar.gz: 8365ecf88a20a7f2f434ac74de44286a860bff96fa96f2ff6ce475eb6ccecb2f5dbd033cfaf25e72993ee72b289ebce1f17e93ea34b99b60ec8c7a6c7f620fd5
data/README.md CHANGED
@@ -141,6 +141,9 @@ Custom tags can be sent with exception data by adding them to the config.
141
141
  Dogcatcher.configure do |c|
142
142
  c.custom_tags = ['key1:value1']
143
143
  c.custom_tags << 'key2:value2'
144
+
145
+ # Proc will be evaluated when exception is caught
146
+ c.custom_tags << proc { 'key3:value3' }
144
147
  end
145
148
  ```
146
149
 
data/dogcatcher.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'rake', '~> 10.0'
24
24
  spec.add_development_dependency 'rspec'
25
25
 
26
- spec.add_runtime_dependency 'activesupport', '~> 4'
26
+ spec.add_runtime_dependency 'activesupport', '>= 4', '< 6'
27
27
  spec.add_runtime_dependency 'dogapi', '~> 1.22'
28
28
  spec.add_runtime_dependency 'dogstatsd-ruby', '~> 1.6'
29
29
  end
@@ -39,15 +39,15 @@ module Dogcatcher
39
39
  #
40
40
  # @return [Array<String>]
41
41
  def tags
42
- arr = []
43
- arr << "notifier:#{notifier}"
44
- arr << "action:#{action}"
45
- arr << "exception_class:#{exception.class}"
46
- arr << "program:#{@config.program}" if @config.program
47
- arr << "ruby_version:#{RUBY_VERSION}"
48
- arr << gem_tags if @config.gem_tags
49
- arr.push(*@config.custom_tags)
50
- arr.flatten.uniq
42
+ tagset = Dogcatcher::TagSet.new
43
+ tagset << "notifier:#{notifier}"
44
+ tagset << "action:#{action}"
45
+ tagset << "exception_class:#{exception.class}"
46
+ tagset << "program:#{@config.program}" if @config.program
47
+ tagset << "ruby_version:#{RUBY_VERSION}"
48
+ tagset.merge(gem_tags) if @config.gem_tags
49
+ tagset.merge(@config.custom_tags)
50
+ tagset.compile.to_a
51
51
  end
52
52
 
53
53
  # Title of the event/notice.
@@ -0,0 +1,16 @@
1
+ module Dogcatcher
2
+ # A collection of tags
3
+ class TagSet < Set
4
+ # Returns a copy of self where proc elements are replaced with the
5
+ # result of them being called.
6
+ def compile
7
+ dup.collect! { |el| el.is_a?(Proc) ? el.call : el }
8
+ end
9
+
10
+ # Replaces the contents of the tag set with the result of calling
11
+ # {#compile} and returns self.
12
+ def compile!
13
+ replace(compile)
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Dogcatcher
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
data/lib/dogcatcher.rb CHANGED
@@ -7,6 +7,7 @@ require 'dogcatcher/config'
7
7
  require 'dogcatcher/markdown'
8
8
  require 'dogcatcher/notice'
9
9
  require 'dogcatcher/notifier'
10
+ require 'dogcatcher/tag_set'
10
11
  require 'dogcatcher/version'
11
12
 
12
13
  module Dogcatcher
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogcatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Vidulich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '4'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '6'
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: '4'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '6'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: dogapi
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +125,7 @@ files:
119
125
  - lib/dogcatcher/markdown.rb
120
126
  - lib/dogcatcher/notice.rb
121
127
  - lib/dogcatcher/notifier.rb
128
+ - lib/dogcatcher/tag_set.rb
122
129
  - lib/dogcatcher/version.rb
123
130
  - support/screenshot_event.png
124
131
  homepage: https://github.com/zl4bv/dogcatcher
@@ -141,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
148
  version: '0'
142
149
  requirements: []
143
150
  rubyforge_project:
144
- rubygems_version: 2.4.5
151
+ rubygems_version: 2.4.8
145
152
  signing_key:
146
153
  specification_version: 4
147
154
  summary: Dogcatcher is a tool to catch exceptions in Ruby applications and send them