mnemosyne-ruby 1.9.0 → 1.10.0.beta1

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
  SHA256:
3
- metadata.gz: ca4d26fef1e8b97cf0a9ff7e057d6cb2895fa67cfb4c7f88bf91bd77852ac795
4
- data.tar.gz: 10b94fbd64aab07a75829ec2c024639ec2d6303896f2654dadab6a0791da1444
3
+ metadata.gz: 4798623296bcf6c481a8d044495303741ff2ee22c8f96a02b7bff1ca6a23c7e2
4
+ data.tar.gz: b1afbe18f601adb2a12eb123cad0ea2403c0722aaef9a339255223d16be4dfc2
5
5
  SHA512:
6
- metadata.gz: d6daedcfb508bd133d13786d2f55a98a4deb1029b0b1806c7dd59b292e4e5257691a38120fd6c4d5e21c05e41145ff31fa46b37dbddf82d75209b3ed8dc100a9
7
- data.tar.gz: 6fc96395f7dfa312f58cbb9b0fe0ca8d1bb26bf67fc297f4d823a3311975ee489cebcf0233df8875271cfeaa2417a3c896ab3c2dfec1332494033c61582b3210
6
+ metadata.gz: 69ae78dd28d7ce399d8e4bd7b24a4a0ce5230c3cac68dde5f8a524777cb6fcef1bdf10990d8857e19b2488f5ee8d54683fe77fd0c51f0c74a7b0bc867191620a
7
+ data.tar.gz: b2d1d3f0a3297cae4cd2d7f4758f7f3ae4e3def583fd3c24280af97271c2feb7efd9535985e90fd8fbb1720ed9a296aca0c26813ab4296b85127c1c3eab7568a
@@ -0,0 +1,109 @@
1
+ name: Build
2
+ on:
3
+ push:
4
+ branches-ignore: [debian]
5
+
6
+ jobs:
7
+ test:
8
+ name: Ruby ${{ matrix.ruby }} / ${{ matrix.suite }}
9
+ runs-on: ubuntu-18.04
10
+
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: ['2.7', '2.6', '2.5', '2.4']
15
+ suite:
16
+ - core
17
+ - faraday-0.9
18
+ - faraday-1.0
19
+ - msgr
20
+ - rack
21
+ - rails-4.2
22
+ - rails-5.0
23
+ - rails-5.1
24
+ - rails-5.2
25
+ - rails-6.0
26
+ - restify
27
+ - sidekiq-5
28
+ - sidekiq-6
29
+ include:
30
+ - suite: core
31
+ spec: --tag ~probe
32
+ - suite: faraday-0.9
33
+ spec: --tag probe:faraday
34
+ env: FARADAY_VERSION='~> 0.9'
35
+ - suite: faraday-1.0
36
+ spec: --tag probe:faraday
37
+ env: FARADAY_VERSION='~> 1.0'
38
+ - suite: msgr
39
+ spec: --tag probe:msgr
40
+ - suite: rack
41
+ spec: --tag probe:rack
42
+ - suite: rails-4.2
43
+ spec: --tag probe:rails --tag ~probe
44
+ env: BUNDLE_GEMFILE=gemfiles/rails_42.gemfile
45
+ bundle_args: _1_
46
+ - suite: rails-5.0
47
+ spec: --tag probe:rails --tag ~probe
48
+ env: BUNDLE_GEMFILE=gemfiles/rails_50.gemfile
49
+ - suite: rails-5.1
50
+ spec: --tag probe:rails --tag ~probe
51
+ env: BUNDLE_GEMFILE=gemfiles/rails_51.gemfile
52
+ - suite: rails-5.2
53
+ spec: --tag probe:rails --tag ~probe
54
+ env: BUNDLE_GEMFILE=gemfiles/rails_52.gemfile
55
+ - suite: rails-6.0
56
+ spec: --tag probe:rails --tag ~probe
57
+ env: BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
58
+ - suite: restify
59
+ spec: --tag probe:restify
60
+ - suite: sidekiq-5
61
+ spec: --tag probe:sidekiq
62
+ env: SIDEKIQ_VERSION='~> 5.0'
63
+ - suite: sidekiq-6
64
+ spec: --tag probe:sidekiq
65
+ env: SIDEKIQ_VERSION='~> 6.0'
66
+ exclude:
67
+ - ruby: 2.4
68
+ suite: rails-6.0
69
+ - ruby: 2.4
70
+ suite: sidekiq-6
71
+ - ruby: 2.3
72
+ suite: rails-6.0
73
+ - ruby: 2.3
74
+ suite: sidekiq-6
75
+
76
+
77
+ services:
78
+ rabbitmq:
79
+ image: rabbitmq:latest
80
+ ports: [5672/tcp]
81
+ options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
82
+
83
+ steps:
84
+ - uses: actions/checkout@master
85
+ - uses: actions/setup-ruby@v1
86
+ with:
87
+ ruby-version: ${{ matrix.ruby }}
88
+ architecture: 'x64'
89
+ - uses: actions/cache@v1
90
+ with:
91
+ path: vendor
92
+ key: v1-ruby-${{ matrix.ruby }}-suite-${{ matrix.suite }}
93
+
94
+ - name: Install debian dependencies
95
+ run: sudo apt-get install --yes --quiet libsqlite3-dev
96
+
97
+ - name: Install Ruby dependencies
98
+ run: |
99
+ set -x
100
+ gem install bundler --version '~> 1.0'
101
+ bundle config path "$(pwd)/vendor/bundle"
102
+ bundle config without development
103
+ ${{ matrix.env }} bundle ${{ matrix.bundle_args }} update --jobs=$(nproc) --retry=3
104
+
105
+ - name: Run rspec
106
+ env:
107
+ AMQP_SERVER: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
108
+ run: |
109
+ ${{ matrix.env }} bundle exec rspec --color ${{ matrix.spec }}
@@ -0,0 +1,25 @@
1
+ name: Lint
2
+ on: [push]
3
+ jobs:
4
+ rubocop:
5
+ name: rubocop
6
+ runs-on: ubuntu-18.04
7
+
8
+ steps:
9
+ - uses: actions/checkout@master
10
+ - uses: actions/setup-ruby@v1
11
+ with:
12
+ ruby-version: 2.6
13
+ - uses: actions/cache@v1
14
+ with:
15
+ path: vendor
16
+ key: v1-ruby-2.6
17
+
18
+ - name: Run bundle install
19
+ run: |
20
+ bundle config path "$(pwd)/vendor/bundle"
21
+ bundle config without development,test
22
+ bundle install --jobs=4 --retry=3
23
+
24
+ - name: Run rubocop
25
+ run: bundle exec rubocop --parallel --color
data/.rubocop.yml CHANGED
@@ -1,14 +1,11 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.2
2
+ TargetRubyVersion: 2.3
3
3
  Exclude:
4
4
  - 'vendor/**/*'
5
5
  - 'gemfiles/**/*'
6
6
 
7
- Rails:
8
- Enabled: false
9
-
10
7
 
11
- Layout/AlignParameters:
8
+ Layout/ArgumentAlignment:
12
9
  EnforcedStyle: with_fixed_indentation
13
10
 
14
11
  Layout/CaseIndentation:
@@ -18,6 +15,11 @@ Layout/CaseIndentation:
18
15
  - end
19
16
  IndentOneStep: true
20
17
 
18
+ Layout/LineLength:
19
+ Exclude:
20
+ - '*.gemspec'
21
+ - 'spec/**/*'
22
+
21
23
  Layout/MultilineMethodCallIndentation:
22
24
  EnforcedStyle: indented
23
25
 
@@ -30,8 +32,36 @@ Layout/SpaceInsideHashLiteralBraces:
30
32
  EnforcedStyle: no_space
31
33
 
32
34
 
33
- Style/BracesAroundHashParameters:
34
- EnforcedStyle: context_dependent
35
+ Metrics/AbcSize:
36
+ Enabled: false
37
+
38
+ Metrics/BlockLength:
39
+ Exclude:
40
+ - 'spec/**/*'
41
+
42
+ Metrics/ParameterLists:
43
+ Enabled: false
44
+
45
+ Metrics/MethodLength:
46
+ Enabled: false
47
+
48
+
49
+ Naming/FileName:
50
+ Exclude:
51
+ - lib/mnemosyne-ruby.rb
52
+
53
+
54
+ Style/Documentation:
55
+ Enabled: false
56
+
57
+ Style/HashEachMethods:
58
+ Enabled: false
59
+
60
+ Style/HashTransformKeys:
61
+ Enabled: false
62
+
63
+ Style/HashTransformValues:
64
+ Enabled: false
35
65
 
36
66
  Style/RaiseArgs:
37
67
  EnforcedStyle: compact
@@ -46,22 +76,3 @@ Style/Semicolon:
46
76
  Style/RescueModifier:
47
77
  Exclude:
48
78
  - '**/*_spec.rb'
49
-
50
-
51
- Metrics/LineLength:
52
- Exclude:
53
- - '*.gemspec'
54
- - 'spec/**/*'
55
-
56
- Metrics/BlockLength:
57
- Exclude:
58
- - 'spec/**/*'
59
-
60
- Metrics/ParameterLists:
61
- Enabled: false
62
-
63
- Metrics/MethodLength:
64
- Enabled: false
65
-
66
- Style/Documentation:
67
- Enabled: false
data/.travis.yml CHANGED
@@ -8,27 +8,34 @@ addons:
8
8
  packages:
9
9
  - rabbitmq-server
10
10
  rvm:
11
+ - 2.7.0
11
12
  - 2.6.5
12
13
  - 2.5.7
13
14
  - 2.4.9
14
- - 2.3.8
15
- gemfile:
16
- - gemfiles/rails_60.gemfile
17
- - gemfiles/rails_52.gemfile
18
- - gemfiles/rails_51.gemfile
19
- - gemfiles/rails_50.gemfile
20
- - gemfiles/rails_42.gemfile
15
+ env:
16
+ - SPEC='--tag ~probe'
17
+ - SPEC='--tag probe:faraday' FARADAY_VERSION='~> 0.9'
18
+ - SPEC='--tag probe:faraday' FARADAY_VERSION='~> 1.0'
19
+ - SPEC='--tag probe:msgr'
20
+ - SPEC='--tag probe:rack'
21
+ - SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_42.gemfile
22
+ - SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_50.gemfile
23
+ - SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_51.gemfile
24
+ - SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_52.gemfile
25
+ - SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
26
+ - SPEC='--tag probe:restify'
27
+ - SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 5.0'
28
+ - SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 6.0'
21
29
 
22
30
  before_install:
23
31
  - echo yes | rvm gemset delete global
24
- - gem install bundler -v'~>1.0'
32
+ - gem install bundler --version '~> 1.0'
25
33
  script:
26
- - bundle exec rake rubocop
27
- - bundle exec rake spec
34
+ - bundle exec rspec ${SPEC}
28
35
 
29
36
  matrix:
30
37
  exclude:
31
- - rvm: 2.4.9
32
- gemfile: gemfiles/rails_60.gemfile
33
- - rvm: 2.3.8
34
- gemfile: gemfiles/rails_60.gemfile
38
+ - rvm: 2.4.9
39
+ env: SPEC='--tag probe:rails --tag ~probe' BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
40
+ - rvm: 2.4.9
41
+ env: SPEC='--tag probe:sidekiq' SIDEKIQ_VERSION='~> 6.0'
data/Appraisals CHANGED
@@ -1,24 +1,36 @@
1
+ # frozen_string_literal: true
2
+
1
3
  appraise 'rails-60' do
2
- gem 'rails', '~> 6.0.0', require: false
3
- gem 'sqlite3', '~> 1.4', require: false
4
+ group :test do
5
+ gem 'rails', '~> 6.0.0', require: false
6
+ gem 'sqlite3', '~> 1.4', require: false
7
+ end
4
8
  end
5
9
 
6
10
  appraise 'rails-52' do
7
- gem 'rails', '~> 5.2.0', require: false
8
- gem 'sqlite3', '~> 1.4', require: false
11
+ group :test do
12
+ gem 'rails', '~> 5.2.0', require: false
13
+ gem 'sqlite3', '~> 1.4', require: false
14
+ end
9
15
  end
10
16
 
11
17
  appraise 'rails-51' do
12
- gem 'rails', '~> 5.1.0', require: false
13
- gem 'sqlite3', '~> 1.4', require: false
18
+ group :test do
19
+ gem 'rails', '~> 5.1.0', require: false
20
+ gem 'sqlite3', '~> 1.4', require: false
21
+ end
14
22
  end
15
23
 
16
24
  appraise 'rails-50' do
17
- gem 'rails', '~> 5.0.0', require: false
18
- gem 'sqlite3', '~> 1.3.6', require: false
25
+ group :test do
26
+ gem 'rails', '~> 5.0.0', require: false
27
+ gem 'sqlite3', '~> 1.3.6', require: false
28
+ end
19
29
  end
20
30
 
21
31
  appraise 'rails-42' do
22
- gem 'rails', '~> 4.2.0', require: false
23
- gem 'sqlite3', '~> 1.3.6', require: false
32
+ group :test do
33
+ gem 'rails', '~> 4.2.0', require: false
34
+ gem 'sqlite3', '~> 1.3.6', require: false
35
+ end
24
36
  end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
6
  ## [Unreleased]
7
+ ### Added
8
+ - Support for Faraday 1.0
7
9
 
8
10
  ## [1.9.0] - 2019-12-17
9
11
  ### Fixed
data/Gemfile CHANGED
@@ -5,19 +5,25 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in mnemosyne.gemspec
6
6
  gemspec
7
7
 
8
- gem 'appraisal'
9
8
  gem 'rake', '~> 12.0'
10
9
  gem 'rspec', '~> 3.6'
11
- gem 'rubocop', '~> 0.67.1'
10
+ gem 'rubocop', '~> 0.80.1'
12
11
  gem 'timecop', '~> 0.9.1'
13
12
 
14
- gem 'pry', require: false
15
- gem 'pry-byebug', require: false
13
+ group :test do
14
+ gem 'faraday', ENV['FARADAY_VERSION'], require: false
15
+ gem 'msgr', ENV['MSGR_VERSION'], require: false
16
+ gem 'restify', ENV['RESTIFY_VERSION'], require: false
17
+ gem 'sidekiq', ENV['SIDEKIQ_VERSION'], require: false
16
18
 
17
- gem 'faraday', require: false
18
- gem 'msgr', require: false
19
- gem 'rails', require: false
20
- gem 'restify', require: false
21
- gem 'sidekiq', require: false
22
- gem 'sqlite3', require: false
23
- gem 'webmock', require: false
19
+ gem 'rails', require: false
20
+ gem 'sqlite3', require: false
21
+ gem 'webmock', require: false
22
+ end
23
+
24
+ group :development do
25
+ gem 'appraisal'
26
+
27
+ gem 'pry', require: false
28
+ gem 'pry-byebug', require: false
29
+ end
@@ -2,19 +2,25 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "appraisal"
6
5
  gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.6"
8
7
  gem "rubocop", "~> 0.67.1"
9
8
  gem "timecop", "~> 0.9.1"
10
- gem "pry", require: false
11
- gem "pry-byebug", require: false
12
- gem "faraday", require: false
13
- gem "msgr", require: false
14
- gem "rails", "~> 4.2.0", require: false
15
- gem "restify", require: false
16
- gem "sidekiq", require: false
17
- gem "sqlite3", "~> 1.3.6", require: false
18
- gem "webmock", require: false
9
+
10
+ group :test do
11
+ gem "faraday", nil, require: false
12
+ gem "msgr", nil, require: false
13
+ gem "restify", nil, require: false
14
+ gem "sidekiq", nil, require: false
15
+ gem "rails", "~> 4.2.0", require: false
16
+ gem "sqlite3", "~> 1.3.6", require: false
17
+ gem "webmock", require: false
18
+ end
19
+
20
+ group :development do
21
+ gem "appraisal"
22
+ gem "pry", require: false
23
+ gem "pry-byebug", require: false
24
+ end
19
25
 
20
26
  gemspec path: "../"
@@ -2,19 +2,25 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "appraisal"
6
5
  gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.6"
8
7
  gem "rubocop", "~> 0.67.1"
9
8
  gem "timecop", "~> 0.9.1"
10
- gem "pry", require: false
11
- gem "pry-byebug", require: false
12
- gem "faraday", require: false
13
- gem "msgr", require: false
14
- gem "rails", "~> 5.0.0", require: false
15
- gem "restify", require: false
16
- gem "sidekiq", require: false
17
- gem "sqlite3", "~> 1.3.6", require: false
18
- gem "webmock", require: false
9
+
10
+ group :test do
11
+ gem "faraday", nil, require: false
12
+ gem "msgr", nil, require: false
13
+ gem "restify", nil, require: false
14
+ gem "sidekiq", nil, require: false
15
+ gem "rails", "~> 5.0.0", require: false
16
+ gem "sqlite3", "~> 1.3.6", require: false
17
+ gem "webmock", require: false
18
+ end
19
+
20
+ group :development do
21
+ gem "appraisal"
22
+ gem "pry", require: false
23
+ gem "pry-byebug", require: false
24
+ end
19
25
 
20
26
  gemspec path: "../"
@@ -2,19 +2,25 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "appraisal"
6
5
  gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.6"
8
7
  gem "rubocop", "~> 0.67.1"
9
8
  gem "timecop", "~> 0.9.1"
10
- gem "pry", require: false
11
- gem "pry-byebug", require: false
12
- gem "faraday", require: false
13
- gem "msgr", require: false
14
- gem "rails", "~> 5.1.0", require: false
15
- gem "restify", require: false
16
- gem "sidekiq", require: false
17
- gem "sqlite3", "~> 1.4", require: false
18
- gem "webmock", require: false
9
+
10
+ group :test do
11
+ gem "faraday", nil, require: false
12
+ gem "msgr", nil, require: false
13
+ gem "restify", nil, require: false
14
+ gem "sidekiq", nil, require: false
15
+ gem "rails", "~> 5.1.0", require: false
16
+ gem "sqlite3", "~> 1.4", require: false
17
+ gem "webmock", require: false
18
+ end
19
+
20
+ group :development do
21
+ gem "appraisal"
22
+ gem "pry", require: false
23
+ gem "pry-byebug", require: false
24
+ end
19
25
 
20
26
  gemspec path: "../"
@@ -2,19 +2,25 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "appraisal"
6
5
  gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.6"
8
7
  gem "rubocop", "~> 0.67.1"
9
8
  gem "timecop", "~> 0.9.1"
10
- gem "pry", require: false
11
- gem "pry-byebug", require: false
12
- gem "faraday", require: false
13
- gem "msgr", require: false
14
- gem "rails", "~> 5.2.0", require: false
15
- gem "restify", require: false
16
- gem "sidekiq", require: false
17
- gem "sqlite3", "~> 1.4", require: false
18
- gem "webmock", require: false
9
+
10
+ group :test do
11
+ gem "faraday", nil, require: false
12
+ gem "msgr", nil, require: false
13
+ gem "restify", nil, require: false
14
+ gem "sidekiq", nil, require: false
15
+ gem "rails", "~> 5.2.0", require: false
16
+ gem "sqlite3", "~> 1.4", require: false
17
+ gem "webmock", require: false
18
+ end
19
+
20
+ group :development do
21
+ gem "appraisal"
22
+ gem "pry", require: false
23
+ gem "pry-byebug", require: false
24
+ end
19
25
 
20
26
  gemspec path: "../"
@@ -2,19 +2,25 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "appraisal"
6
5
  gem "rake", "~> 12.0"
7
6
  gem "rspec", "~> 3.6"
8
7
  gem "rubocop", "~> 0.67.1"
9
8
  gem "timecop", "~> 0.9.1"
10
- gem "pry", require: false
11
- gem "pry-byebug", require: false
12
- gem "faraday", require: false
13
- gem "msgr", require: false
14
- gem "rails", "~> 6.0.0", require: false
15
- gem "restify", require: false
16
- gem "sidekiq", require: false
17
- gem "sqlite3", "~> 1.4", require: false
18
- gem "webmock", require: false
9
+
10
+ group :test do
11
+ gem "faraday", nil, require: false
12
+ gem "msgr", nil, require: false
13
+ gem "restify", nil, require: false
14
+ gem "sidekiq", nil, require: false
15
+ gem "rails", "~> 6.0.0", require: false
16
+ gem "sqlite3", "~> 1.4", require: false
17
+ gem "webmock", require: false
18
+ end
19
+
20
+ group :development do
21
+ gem "appraisal"
22
+ gem "pry", require: false
23
+ gem "pry-byebug", require: false
24
+ end
19
25
 
20
26
  gemspec path: "../"
@@ -13,7 +13,7 @@ module Mnemosyne
13
13
  attr_reader :exchange
14
14
  attr_reader :server
15
15
 
16
- def initialize(config) # rubocop:disable AbcSize
16
+ def initialize(config)
17
17
  @platform = config.fetch('platform', 'default').to_s.strip.freeze
18
18
  @application = config.fetch('application', nil).to_s.strip.freeze
19
19
  @enabled = config.fetch('enabled', true)
@@ -5,7 +5,6 @@ module Mnemosyne
5
5
  def trace(name, meta: {})
6
6
  ::ActiveSupport::Notifications.instrument 'trace.mnemosyne',
7
7
  name: name, meta: meta do
8
-
9
8
  yield
10
9
  end
11
10
  end
@@ -68,9 +68,9 @@ module Mnemosyne
68
68
 
69
69
  @instance = new(config: config, client: client)
70
70
  end
71
- rescue StandardError => err
71
+ rescue StandardError => e
72
72
  ::Mnemosyne::Logging.logger.warn(Mnemosyne) do
73
- "Unable to start instrumenter: #{err}"
73
+ "Unable to start instrumenter: #{e}"
74
74
  end
75
75
 
76
76
  raise
@@ -24,7 +24,7 @@ module Mnemosyne
24
24
  'X-Mnemosyne-Origin' => span.uuid
25
25
  }.reject {|_, v| v.nil? })
26
26
 
27
- @app.call(env).on_complete do |env|
27
+ @app.call(env).on_complete do |env| # rubocop:disable Lint/ShadowingOuterLocalVariable
28
28
  span.meta[:status] = env[:status]
29
29
 
30
30
  trace << span.finish!
@@ -53,7 +53,7 @@ module Mnemosyne
53
53
 
54
54
  def _submit_trace
55
55
  @trace.submit
56
- rescue Exception => e
56
+ rescue Exception => e # rubocop:disable Lint/RescueException
57
57
  ::Mnemosyne::Logging.logger.error \
58
58
  "Error while submitting trace: #{e}\n #{e.backtrace.join("\n ")}"
59
59
  end
@@ -63,7 +63,7 @@ module Mnemosyne
63
63
  @app = app
64
64
  end
65
65
 
66
- def call(env) # rubocop:disable AbcSize
66
+ def call(env)
67
67
  origin = env.fetch('HTTP_X_MNEMOSYNE_ORIGIN', false)
68
68
  transaction = env.fetch('HTTP_X_MNEMOSYNE_TRANSACTION') do
69
69
  ::SecureRandom.uuid
@@ -95,7 +95,7 @@ module Mnemosyne
95
95
 
96
96
  raise
97
97
  ensure
98
- trace.release if trace
98
+ trace&.release
99
99
  end
100
100
 
101
101
  private
@@ -121,7 +121,7 @@ module Mnemosyne
121
121
 
122
122
  trace.meta.merge!({
123
123
  content_type: headers['Content-Type'],
124
- location: headers['Location'],
124
+ location: headers['Location']
125
125
  }.compact)
126
126
  end
127
127
  end
@@ -19,11 +19,11 @@ module Mnemosyne
19
19
  origin: origin,
20
20
  meta: meta
21
21
 
22
- trace.start! if trace
22
+ trace&.start!
23
23
 
24
24
  yield
25
- rescue StandardError, LoadError, SyntaxError => err
26
- trace.attach_error(err)
25
+ rescue StandardError, LoadError, SyntaxError => e
26
+ trace.attach_error(e)
27
27
  raise
28
28
  ensure
29
29
  if trace
@@ -4,7 +4,7 @@ module Mnemosyne
4
4
  module Probes
5
5
  module ActionController
6
6
  module Renderers
7
- CATEGORY = 'render_to_body.renderers.action_controller'.freeze
7
+ CATEGORY = 'render_to_body.renderers.action_controller'
8
8
 
9
9
  class Probe < ::Mnemosyne::Probe
10
10
  subscribe CATEGORY
@@ -6,7 +6,7 @@ module Mnemosyne
6
6
  module ShowExceptions
7
7
  class Probe < ::Mnemosyne::Probe
8
8
  def setup
9
- ::ActionDispatch::ShowExceptions.send :prepend, Instrumentation
9
+ ::ActionDispatch::ShowExceptions.prepend Instrumentation
10
10
  end
11
11
 
12
12
  module Instrumentation
@@ -18,8 +18,10 @@ module Mnemosyne
18
18
  module Extension
19
19
  def lock!
20
20
  unless @handlers.include?('Mnemosyne::Middleware::Faraday')
21
- if respond_to?(:is_adapter?, true) &&
22
- (idx = @handlers.find_index {|h| is_adapter?(h) })
21
+ if ::Faraday::VERSION < '1.0' &&
22
+ respond_to?(:is_adapter?, true) &&
23
+ idx = @handlers.find_index {|m| is_adapter?(m) }
24
+
23
25
  insert(idx, ::Mnemosyne::Middleware::Faraday)
24
26
  else
25
27
  use(::Mnemosyne::Middleware::Faraday)
@@ -32,7 +32,7 @@ module Mnemosyne
32
32
  end
33
33
 
34
34
  def extract_format(env)
35
- env['api.format'.freeze]
35
+ env['api.format']
36
36
  end
37
37
  end
38
38
  end
@@ -4,11 +4,11 @@ module Mnemosyne
4
4
  module Probes
5
5
  module Msgr
6
6
  module Client
7
- NAME = 'external.publish.msgr'.freeze
7
+ NAME = 'external.publish.msgr'
8
8
 
9
9
  class Probe < ::Mnemosyne::Probe
10
10
  def setup
11
- ::Msgr::Client.send :prepend, Instrumentation
11
+ ::Msgr::Client.prepend Instrumentation
12
12
  end
13
13
  end
14
14
 
@@ -4,16 +4,16 @@ module Mnemosyne
4
4
  module Probes
5
5
  module Msgr
6
6
  module Consumer
7
- NAME = 'app.messaging.receive.msgr'.freeze
7
+ NAME = 'app.messaging.receive.msgr'
8
8
 
9
9
  class Probe < ::Mnemosyne::Probe
10
10
  def setup
11
- ::Msgr::Consumer.send :prepend, Instrumentation
11
+ ::Msgr::Consumer.prepend Instrumentation
12
12
  end
13
13
  end
14
14
 
15
15
  module Instrumentation
16
- def dispatch(message) # rubocop:disable AbcSize
16
+ def dispatch(message)
17
17
  route = message.route
18
18
  metadata = message.metadata
19
19
  headers = metadata.headers || {}
@@ -57,7 +57,7 @@ module Mnemosyne
57
57
 
58
58
  super
59
59
  rescue StandardError, LoadError, SyntaxError => e
60
- trace.attach_error(e) if trace
60
+ trace&.attach_error(e)
61
61
  raise
62
62
  ensure
63
63
  if trace
@@ -27,7 +27,6 @@ module Mnemosyne
27
27
  def respond
28
28
  ::ActiveSupport::Notifications.instrument \
29
29
  'respond.responders.mnemosyne' do
30
-
31
30
  super
32
31
  end
33
32
  end
@@ -32,7 +32,7 @@ module Kernel
32
32
 
33
33
  begin
34
34
  ::Mnemosyne::Probes.required(name)
35
- rescue Exception # rubocop:disable RescueException, HandleExceptions
35
+ rescue Exception # rubocop:disable Lint/RescueException,Lint/SuppressedException
36
36
  end
37
37
 
38
38
  ret
@@ -3,9 +3,9 @@
3
3
  module Mnemosyne
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 9
6
+ MINOR = 10
7
7
  PATCH = 0
8
- STAGE = nil
8
+ STAGE = :beta1
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mnemosyne-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -60,6 +60,8 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".editorconfig"
63
+ - ".github/workflows/build.yml"
64
+ - ".github/workflows/lint.yml"
63
65
  - ".gitignore"
64
66
  - ".rspec"
65
67
  - ".rubocop.yml"
@@ -132,9 +134,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
134
  version: '0'
133
135
  required_rubygems_version: !ruby/object:Gem::Requirement
134
136
  requirements:
135
- - - ">="
137
+ - - ">"
136
138
  - !ruby/object:Gem::Version
137
- version: '0'
139
+ version: 1.3.1
138
140
  requirements: []
139
141
  rubygems_version: 3.0.6
140
142
  signing_key: