ears 0.13.0 → 0.14.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: ba8ffc55e16ec7c7f0b7e3327b25aaf287feba34cc527d93d40d5b59bb4a1976
4
- data.tar.gz: cacc33604f6299450735d16a376d583ffea86f27cc04e6108eab92473ae2ac50
3
+ metadata.gz: 3a6fcd7ee80d0254935971a568d43154299dc43fae10d67814343be176960b18
4
+ data.tar.gz: c8e836139cedf43f004be9e6b1d20d3d74b6a39cb041402b1762ae0cd77855d6
5
5
  SHA512:
6
- metadata.gz: aa791974d982def87dfff26bc03819e5cd9c12d25440a055a3c9ce3bb5ebf8c6b36d00f31f93b3b37d5f0702ce4d5831e47f86e24abea9efde01b6d40e8f9482
7
- data.tar.gz: df472e7514f6308e4436f0e475ea0dbcbf1e5e3219d87a3bc7adddb9ea74ee198088f9d565db61925cad3865f24fa25d6d1ff9db7b85bc84122fb0d934c1dbac
6
+ metadata.gz: ce44978ab6bbb2c52c0f890ccbddeb2e64968301e03522e1317a4519f6ea1e87f87dee4cf9da77030d635f55e812d5a296d551468803b6c42ba1033a02bcdac3
7
+ data.tar.gz: cbf4b43f647ec78772430fa821fb893d2c93c032c368023e5dfbf3760d23599ca964a15be157b25b3512d6d8de536799971255ccda2df4cd6915c5188b420e25
@@ -0,0 +1,10 @@
1
+ # Specify a different separator for branch names
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: 'github-actions'
6
+ directory: '/'
7
+ schedule:
8
+ interval: 'weekly'
9
+ pull-request-branch-name:
10
+ separator: '-'
@@ -12,18 +12,18 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby-version: ['2.7', '3.0', '3.1', '3.2']
15
+ ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
16
16
 
17
17
  steps:
18
- - uses: actions/checkout@v3
18
+ - uses: actions/checkout@v4
19
19
  - name: Set up Ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
22
22
  ruby-version: ${{ matrix.ruby-version }}
23
23
  bundler-cache: true
24
- - uses: actions/setup-node@v3
24
+ - uses: actions/setup-node@v4
25
25
  with:
26
- node-version: '20'
26
+ node-version: '22'
27
27
  - name: Run prettier
28
28
  run: npm ci && npm run lint
29
29
  - name: Run Rubocop
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: ubuntu-latest
38
38
 
39
39
  steps:
40
- - uses: actions/checkout@v3
40
+ - uses: actions/checkout@v4
41
41
  - name: Set up Ruby
42
42
  uses: ruby/setup-ruby@v1
43
43
  with:
@@ -41,11 +41,11 @@ jobs:
41
41
 
42
42
  steps:
43
43
  - name: Checkout repository
44
- uses: actions/checkout@v3
44
+ uses: actions/checkout@v4
45
45
 
46
46
  # Initializes the CodeQL tools for scanning.
47
47
  - name: Initialize CodeQL
48
- uses: github/codeql-action/init@v2
48
+ uses: github/codeql-action/init@v3
49
49
  with:
50
50
  languages: ${{ matrix.language }}
51
51
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
58
58
  # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59
59
  # If this step fails, then you should remove it and run the build manually (see below)
60
60
  - name: Autobuild
61
- uses: github/codeql-action/autobuild@v2
61
+ uses: github/codeql-action/autobuild@v3
62
62
 
63
63
  # ℹ️ Command-line programs to run using the OS shell.
64
64
  # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,6 +71,6 @@ jobs:
71
71
  # ./location_of_script_within_repo/buildscript.sh
72
72
 
73
73
  - name: Perform CodeQL Analysis
74
- uses: github/codeql-action/analyze@v2
74
+ uses: github/codeql-action/analyze@v3
75
75
  with:
76
76
  category: '/language:${{matrix.language}}'
@@ -15,6 +15,6 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
17
  - name: 'Checkout Repository'
18
- uses: actions/checkout@v3
18
+ uses: actions/checkout@v4
19
19
  - name: 'Dependency Review'
20
- uses: actions/dependency-review-action@v2
20
+ uses: actions/dependency-review-action@v4
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --require spec_helper
2
- --format doc
data/.tool-versions CHANGED
@@ -1,2 +1,2 @@
1
- ruby 2.7.7
2
- nodejs 20.6.1
1
+ ruby 2.7.8
2
+ nodejs 22.5.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0 (2024-07-29)
4
+
5
+ - **[Breaking]** Adjust Appsignal middleware to use `Appsignal.monitor`.
6
+ To use the middleware the `appsignal` gem in version `>= 3.11.0` is required.
7
+ The configuration of the middleware changed and now only requires one option `class_name` and an optional `namespace`.
8
+
3
9
  ## 0.13.0 (2023-11-07)
4
10
 
5
11
  - Allow adding multiple routing keys to the consumer configuration, configure method within consumer will only accept `routing_keys` array instead of `routing_key` string
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ears (0.13.0)
4
+ ears (0.14.0)
5
5
  bunny (~> 2.22.0)
6
6
  multi_json
7
7
 
@@ -10,74 +10,67 @@ GEM
10
10
  specs:
11
11
  amq-protocol (2.3.2)
12
12
  ast (2.4.2)
13
- base64 (0.1.1)
14
13
  bunny (2.22.0)
15
14
  amq-protocol (~> 2.3, >= 2.3.1)
16
15
  sorted_set (~> 1, >= 1.0.2)
17
- diff-lcs (1.5.0)
18
- docile (1.4.0)
19
- haml (6.1.2)
16
+ diff-lcs (1.5.1)
17
+ docile (1.4.1)
18
+ haml (6.3.0)
20
19
  temple (>= 0.8.2)
21
20
  thor
22
21
  tilt
23
- json (2.6.3)
22
+ json (2.7.2)
24
23
  language_server-protocol (3.17.0.3)
25
24
  multi_json (1.15.0)
26
- parallel (1.23.0)
27
- parser (3.2.2.3)
25
+ parallel (1.25.1)
26
+ parser (3.3.4.0)
28
27
  ast (~> 2.4.1)
29
28
  racc
30
- prettier (4.0.2)
29
+ prettier (4.0.4)
31
30
  syntax_tree (>= 4.0.1)
32
31
  syntax_tree-haml (>= 2.0.0)
33
32
  syntax_tree-rbs (>= 0.2.0)
34
33
  prettier_print (1.2.1)
35
- racc (1.7.1)
34
+ racc (1.8.0)
36
35
  rainbow (3.1.1)
37
- rake (13.0.6)
36
+ rake (13.2.1)
38
37
  rbs (3.1.3)
39
38
  rbtree (0.4.6)
40
- regexp_parser (2.8.1)
41
- rexml (3.2.6)
42
- rspec (3.12.0)
43
- rspec-core (~> 3.12.0)
44
- rspec-expectations (~> 3.12.0)
45
- rspec-mocks (~> 3.12.0)
46
- rspec-core (3.12.2)
47
- rspec-support (~> 3.12.0)
48
- rspec-expectations (3.12.3)
39
+ regexp_parser (2.9.2)
40
+ rexml (3.3.2)
41
+ strscan
42
+ rspec (3.13.0)
43
+ rspec-core (~> 3.13.0)
44
+ rspec-expectations (~> 3.13.0)
45
+ rspec-mocks (~> 3.13.0)
46
+ rspec-core (3.13.0)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-expectations (3.13.1)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.12.0)
51
- rspec-mocks (3.12.6)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-mocks (3.13.1)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.12.0)
54
- rspec-support (3.12.1)
55
- rubocop (1.56.3)
56
- base64 (~> 0.1.1)
53
+ rspec-support (~> 3.13.0)
54
+ rspec-support (3.13.1)
55
+ rubocop (1.65.0)
57
56
  json (~> 2.3)
58
57
  language_server-protocol (>= 3.17.0)
59
58
  parallel (~> 1.10)
60
- parser (>= 3.2.2.3)
59
+ parser (>= 3.3.0.2)
61
60
  rainbow (>= 2.2.2, < 4.0)
62
- regexp_parser (>= 1.8, < 3.0)
61
+ regexp_parser (>= 2.4, < 3.0)
63
62
  rexml (>= 3.2.5, < 4.0)
64
- rubocop-ast (>= 1.28.1, < 2.0)
63
+ rubocop-ast (>= 1.31.1, < 2.0)
65
64
  ruby-progressbar (~> 1.7)
66
65
  unicode-display_width (>= 2.4.0, < 3.0)
67
- rubocop-ast (1.29.0)
68
- parser (>= 3.2.1.0)
69
- rubocop-capybara (2.18.0)
70
- rubocop (~> 1.41)
71
- rubocop-factory_bot (2.24.0)
72
- rubocop (~> 1.33)
66
+ rubocop-ast (1.31.3)
67
+ parser (>= 3.3.1.0)
73
68
  rubocop-rake (0.6.0)
74
69
  rubocop (~> 1.0)
75
- rubocop-rspec (2.24.0)
76
- rubocop (~> 1.33)
77
- rubocop-capybara (~> 2.17)
78
- rubocop-factory_bot (~> 2.22)
70
+ rubocop-rspec (3.0.3)
71
+ rubocop (~> 1.61)
79
72
  ruby-progressbar (1.13.0)
80
- set (1.0.3)
73
+ set (1.0.4)
81
74
  simplecov (0.22.0)
82
75
  docile (~> 1.1)
83
76
  simplecov-html (~> 0.11)
@@ -87,7 +80,8 @@ GEM
87
80
  sorted_set (1.0.3)
88
81
  rbtree
89
82
  set (~> 1.0)
90
- syntax_tree (6.1.1)
83
+ strscan (3.1.0)
84
+ syntax_tree (6.2.0)
91
85
  prettier_print (>= 1.2.0)
92
86
  syntax_tree-haml (4.0.3)
93
87
  haml (>= 5.2)
@@ -97,11 +91,11 @@ GEM
97
91
  prettier_print
98
92
  rbs
99
93
  syntax_tree (>= 2.0.1)
100
- temple (0.10.2)
101
- thor (1.2.2)
102
- tilt (2.3.0)
103
- unicode-display_width (2.4.2)
104
- yard (0.9.34)
94
+ temple (0.10.3)
95
+ thor (1.3.1)
96
+ tilt (2.4.0)
97
+ unicode-display_width (2.5.0)
98
+ yard (0.9.36)
105
99
 
106
100
  PLATFORMS
107
101
  arm64-darwin-20
@@ -125,4 +119,4 @@ DEPENDENCIES
125
119
  yard
126
120
 
127
121
  BUNDLED WITH
128
- 2.4.7
122
+ 2.4.22
data/ears.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = 'A gem for building RabbitMQ consumers.'
11
11
  spec.homepage = 'https://github.com/ivx/ears'
12
12
  spec.license = 'MIT'
13
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
13
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7.7')
14
14
 
15
15
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
16
 
@@ -23,12 +23,6 @@ Gem::Specification.new do |spec|
23
23
  'changelog_uri'
24
24
  ] = 'https://github.com/ivx/ears/blob/main/CHANGELOG.md'
25
25
 
26
- spec.post_install_message =
27
- '
28
- Ears: the new version changed the exit behaviour in case of uncaught exceptions.
29
- You may want to have a look into the CHANGELOG!
30
- '
31
-
32
26
  spec.files =
33
27
  Dir.chdir(File.expand_path('..', __FILE__)) do
34
28
  `git ls-files -z`.split("\x0")
data/lib/ears/consumer.rb CHANGED
@@ -40,7 +40,6 @@ module Ears
40
40
  # @option opts [Boolean] :error_queue (false) Whether an error queue should be provided.
41
41
  # @option opts [Boolean] :durable_exchange (true) Whether the exchange should be durable.
42
42
  # @option opts [Symbol] :exchange_type (:topic) The type of exchange to use.
43
- # @option opts [Integer] :threads (1) The number of threads to use for this consumer.
44
43
  def self.configure(opts = {})
45
44
  self.queue = opts.fetch(:queue)
46
45
  self.exchange = opts.fetch(:exchange)
@@ -5,12 +5,12 @@ module Ears
5
5
  # A middleware that automatically wraps {Ears::Consumer#work} in an Appsignal transaction.
6
6
  class Appsignal < Middleware
7
7
  # @param [Hash] opts The options for the middleware.
8
- # @option opts [String] :transaction_name The name of the Appsignal transaction.
9
8
  # @option opts [String] :class_name The name of the class you want to monitor.
9
+ # @option opts [String] :namespace ('background') The namespace in which the action should appear.
10
10
  def initialize(opts)
11
11
  super()
12
- @transaction_name = opts.fetch(:transaction_name)
13
12
  @class_name = opts.fetch(:class_name)
13
+ @namespace = opts.fetch(:namespace, 'background')
14
14
  end
15
15
 
16
16
  def call(delivery_info, metadata, payload, app)
@@ -26,14 +26,12 @@ module Ears
26
26
 
27
27
  private
28
28
 
29
- attr_reader :transaction_name, :class_name
29
+ attr_reader :namespace, :class_name
30
30
 
31
31
  def start_transaction(&block)
32
- ::Appsignal.monitor_transaction(
33
- transaction_name,
34
- class: class_name,
35
- method: 'work',
36
- queue_start: Time.now.utc,
32
+ ::Appsignal.monitor(
33
+ namespace: namespace,
34
+ action: "#{class_name}#work",
37
35
  &block
38
36
  )
39
37
  end
data/lib/ears/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ears
2
- VERSION = '0.13.0'
2
+ VERSION = '0.14.0'
3
3
  end
data/package-lock.json CHANGED
@@ -6,34 +6,35 @@
6
6
  "": {
7
7
  "name": "ears",
8
8
  "devDependencies": {
9
- "@invisionag/prettier-config": "^2.1.2",
10
- "@prettier/plugin-ruby": "^4.0.2",
11
- "prettier": "^3.0.3"
9
+ "@invisionag/prettier-config": "^2.1.3",
10
+ "@prettier/plugin-ruby": "^4.0.4",
11
+ "prettier": "^3.3.3"
12
12
  }
13
13
  },
14
14
  "node_modules/@invisionag/prettier-config": {
15
- "version": "2.1.2",
16
- "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.2.tgz",
17
- "integrity": "sha512-/h9r5ZjI3bSvq6G5aJyXjfH5bxbxJku/TWMMV5jEFBPTwvL8s7//lrb/0gN44MJKU2toITw9dP08JvjKsFMqhQ==",
15
+ "version": "2.1.3",
16
+ "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
17
+ "integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
18
18
  "dev": true,
19
19
  "peerDependencies": {
20
20
  "prettier": ">=2.0.0"
21
21
  }
22
22
  },
23
23
  "node_modules/@prettier/plugin-ruby": {
24
- "version": "4.0.2",
25
- "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.2.tgz",
26
- "integrity": "sha512-TOGsMoOLF0BLwRozqtTB/w7HpDHotDSBPfLsMBpCjlMONLSoCWBF1NhZQjiioyLim7tCltzFrCqZp11WcrPOzA==",
24
+ "version": "4.0.4",
25
+ "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
26
+ "integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
27
27
  "dev": true,
28
28
  "peerDependencies": {
29
29
  "prettier": "^3.0.0"
30
30
  }
31
31
  },
32
32
  "node_modules/prettier": {
33
- "version": "3.0.3",
34
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
35
- "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
33
+ "version": "3.3.3",
34
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
35
+ "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
36
36
  "dev": true,
37
+ "license": "MIT",
37
38
  "bin": {
38
39
  "prettier": "bin/prettier.cjs"
39
40
  },
@@ -47,23 +48,23 @@
47
48
  },
48
49
  "dependencies": {
49
50
  "@invisionag/prettier-config": {
50
- "version": "2.1.2",
51
- "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.2.tgz",
52
- "integrity": "sha512-/h9r5ZjI3bSvq6G5aJyXjfH5bxbxJku/TWMMV5jEFBPTwvL8s7//lrb/0gN44MJKU2toITw9dP08JvjKsFMqhQ==",
51
+ "version": "2.1.3",
52
+ "resolved": "https://registry.npmjs.org/@invisionag/prettier-config/-/prettier-config-2.1.3.tgz",
53
+ "integrity": "sha512-/BRe7iCWtsn43hhYrD2ANla2Qf332EusDjcuuB9xOK/z3lEghp59pkuxNFIvlQ/Y9AFMaT1zOFhvxzYax+fj3g==",
53
54
  "dev": true,
54
55
  "requires": {}
55
56
  },
56
57
  "@prettier/plugin-ruby": {
57
- "version": "4.0.2",
58
- "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.2.tgz",
59
- "integrity": "sha512-TOGsMoOLF0BLwRozqtTB/w7HpDHotDSBPfLsMBpCjlMONLSoCWBF1NhZQjiioyLim7tCltzFrCqZp11WcrPOzA==",
58
+ "version": "4.0.4",
59
+ "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-4.0.4.tgz",
60
+ "integrity": "sha512-lCpvfS/dQU5WrwN3AQ5vR8qrvj2h5gE41X08NNzAAXvHdM4zwwGRcP2sHSxfu6n6No+ljWCVx95NvJPFTTjCTg==",
60
61
  "dev": true,
61
62
  "requires": {}
62
63
  },
63
64
  "prettier": {
64
- "version": "3.0.3",
65
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
66
- "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
65
+ "version": "3.3.3",
66
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
67
+ "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
67
68
  "dev": true
68
69
  }
69
70
  }
data/package.json CHANGED
@@ -7,9 +7,9 @@
7
7
  "format": "npm run prettify -- --write"
8
8
  },
9
9
  "devDependencies": {
10
- "@invisionag/prettier-config": "^2.1.2",
11
- "@prettier/plugin-ruby": "^4.0.2",
12
- "prettier": "^3.0.3"
10
+ "@invisionag/prettier-config": "^2.1.3",
11
+ "@prettier/plugin-ruby": "^4.0.4",
12
+ "prettier": "^3.3.3"
13
13
  },
14
14
  "prettier": "@invisionag/prettier-config/ruby"
15
15
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ears
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - InVision AG
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -45,6 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".github/dependabot.yml"
48
49
  - ".github/workflows/build.yml"
49
50
  - ".github/workflows/codeql.yml"
50
51
  - ".github/workflows/dependency-review.yml"
@@ -84,10 +85,7 @@ metadata:
84
85
  homepage_uri: https://github.com/ivx/ears
85
86
  source_code_uri: https://github.com/ivx/ears
86
87
  changelog_uri: https://github.com/ivx/ears/blob/main/CHANGELOG.md
87
- post_install_message: |2
88
-
89
- Ears: the new version changed the exit behaviour in case of uncaught exceptions.
90
- You may want to have a look into the CHANGELOG!
88
+ post_install_message:
91
89
  rdoc_options: []
92
90
  require_paths:
93
91
  - lib
@@ -95,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
93
  requirements:
96
94
  - - ">="
97
95
  - !ruby/object:Gem::Version
98
- version: 2.7.0
96
+ version: 2.7.7
99
97
  required_rubygems_version: !ruby/object:Gem::Requirement
100
98
  requirements:
101
99
  - - ">="