roda-appsignal 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '05539b8342e9920ed7fe1199f1ddb2284ab2916cddbb035141880758aeb0c5eb'
4
- data.tar.gz: a83a96ecfe1e6f84c5d972decdb890b808433b4b13444e25410cc956675bcd01
3
+ metadata.gz: 30ff00b9d090a6e013428af44a3e57d2f315b40f41d16131edc4eb935161d639
4
+ data.tar.gz: 5d58424ea81328d2e56af79d1053d179fe545259a29091e4deb85ef2b03b5c28
5
5
  SHA512:
6
- metadata.gz: 2340124e77bd2751aaf3dbfa65b88dbc7ee30ba4a3d711483bf1109e23dca95074a2c6bda945167d7bc9013ac23ab3f79ad0ed0d55418e5337c32a221c22b25e
7
- data.tar.gz: 7a31e2c9005f2bf8df6bb50aac9576a56c466b252549c3d4a5162f94018c1c7a4bddd0b337a8dc60d562ef1b629b3653150be4007dc16c73945835fdfc33e31c
6
+ metadata.gz: eb5185990125e3afdda78422d96077cec91133ca55a3cc9cdc17747c76b23e03bfb4ea2d48e85f38c8c5a70a13de0623bc44e77e189514988b13b6bc29a50f72
7
+ data.tar.gz: 68aea34e5952ea398a9e94b917e605dd0aaf0754c1cbb9e556be663d79f71dc632ffdf718c9fc43f46ae9506ed57e1feb34026f19632b0eff7960fa0177ee0bf
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
 
15
15
  ---
16
16
 
17
+ ## [1.1.0] - 2019-10-18
18
+ ### Added
19
+ - Allow for sanitization of action name.
20
+
17
21
  ## [1.0.0] - 2019-10-18
18
22
  ### Added
19
23
  - Initial release
data/README.md CHANGED
@@ -44,6 +44,24 @@ class App < Roda
44
44
  end
45
45
  ```
46
46
 
47
+ You can also sanitize the action name via a proc argument:
48
+
49
+ ```ruby
50
+ class App < Roda
51
+
52
+ plugin :appsignal, proc { |name| name.gsub!(/\d+/, ':id') }
53
+
54
+ route do |r|
55
+ r.is 'foo' do
56
+ r.is Integer do
57
+ # will be named/instrumented as 'App::RodaRequest GET /foo/:id'
58
+ 'hello world'
59
+ end
60
+ end
61
+ end
62
+ end
63
+ ```
64
+
47
65
  ## Development
48
66
 
49
67
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -7,8 +7,11 @@ class Roda
7
7
  # Example:
8
8
  #
9
9
  # plugin :appsignal
10
+ # plugin :appsignal, proc { |action_name| action_name.gsub!(/\d+\/, '') }
11
+ #
10
12
  module Appsignal
11
- def self.configure(app)
13
+ def self.configure(app, sanitize = proc { |name| name })
14
+ app.opts[:appsignal_sanitize] = sanitize
12
15
  app.use ::Appsignal::Rack::GenericInstrumentation
13
16
  end
14
17
 
@@ -16,7 +19,9 @@ class Roda
16
19
  private
17
20
 
18
21
  def _roda_before_10__appsignal
19
- ::Appsignal.set_action(request.inspect.gsub(/#|<|>/, ''))
22
+ ::Appsignal.set_action(
23
+ opts[:appsignal_sanitize].call(request.inspect.gsub!(/#|<|>/, ''))
24
+ )
20
25
  end
21
26
  end
22
27
  end
@@ -3,7 +3,7 @@
3
3
  class Roda
4
4
  module RodaPlugins
5
5
  module Appsignal
6
- VERSION = '1.0.0'
6
+ VERSION = '1.1.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - andjosh