mnemosyne-ruby 1.7.1 → 1.11.0

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: ac987a42c8acad894e9ba6f4a7a8f82978a070a814f1934740e972d872319483
4
- data.tar.gz: fc1fce9f2aa11e6f01dc826a70d5130791191d4d6750a8f65239a70bd3c33c6a
3
+ metadata.gz: d21523f741fef0a9443c7c93e81f220183ffd1cf19f7cdd985d69c76dee0ec51
4
+ data.tar.gz: ab0c1a21e65bf42ad5bb9eb92539421246643ec195257ca95a5024aa6217589b
5
5
  SHA512:
6
- metadata.gz: 3089578f4a14216d8f50d0aac9f2af6ef177051181629ee8f5956b5874f9396dca9723670bc5eb776b7a8cb0f24567c3a48714be5bf3b972166d9bda5371f41f
7
- data.tar.gz: bc4c72f330ba74aec138fb31dcaa4acb9c53f426cda98c34abae7780fd30c076d0d39ce6f804497b7d40a5bc5dac659df798c57ecb7f692084c56ae087d2aca3
6
+ metadata.gz: af9d3e285a017330119b9ced137fb3cf4c0059789359620170df6e4a26897036dda5ff787ee5d77d6e6960a77fc6b86443215d46f14def921ba7cbd737edc410
7
+ data.tar.gz: 9a36770c25abbdeb8c3ddb38a0fb4424228065fd3c58c364aa52538d0ddf5ca5ead683da36a18604ee71ff08880a9a65c461b536cddeb914d370c03655a34b73
@@ -0,0 +1,8 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
@@ -0,0 +1,93 @@
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']
15
+ suite:
16
+ - core
17
+ - faraday-0.9
18
+ - faraday-1.0
19
+ - msgr
20
+ - rack
21
+ - rails-5.0
22
+ - rails-5.1
23
+ - rails-5.2
24
+ - rails-6.0
25
+ - restify
26
+ - sidekiq-5
27
+ - sidekiq-6
28
+ include:
29
+ - suite: core
30
+ spec: --tag ~probe
31
+ - suite: faraday-0.9
32
+ spec: --tag probe:faraday
33
+ env: FARADAY_VERSION='~> 0.9'
34
+ - suite: faraday-1.0
35
+ spec: --tag probe:faraday
36
+ env: FARADAY_VERSION='~> 1.0'
37
+ - suite: msgr
38
+ spec: --tag probe:msgr
39
+ - suite: rack
40
+ spec: --tag probe:rack
41
+ - suite: rails-5.0
42
+ spec: --tag probe:rails --tag ~probe
43
+ env: BUNDLE_GEMFILE=gemfiles/rails_50.gemfile
44
+ - suite: rails-5.1
45
+ spec: --tag probe:rails --tag ~probe
46
+ env: BUNDLE_GEMFILE=gemfiles/rails_51.gemfile
47
+ - suite: rails-5.2
48
+ spec: --tag probe:rails --tag ~probe
49
+ env: BUNDLE_GEMFILE=gemfiles/rails_52.gemfile
50
+ - suite: rails-6.0
51
+ spec: --tag probe:rails --tag ~probe
52
+ env: BUNDLE_GEMFILE=gemfiles/rails_60.gemfile
53
+ - suite: restify
54
+ spec: --tag probe:restify
55
+ - suite: sidekiq-5
56
+ spec: --tag probe:sidekiq
57
+ env: SIDEKIQ_VERSION='~> 5.0'
58
+ - suite: sidekiq-6
59
+ spec: --tag probe:sidekiq
60
+ env: SIDEKIQ_VERSION='~> 6.0'
61
+
62
+
63
+ services:
64
+ rabbitmq:
65
+ image: rabbitmq:latest
66
+ ports: [5672/tcp]
67
+ options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
68
+
69
+ steps:
70
+ - uses: actions/checkout@master
71
+
72
+ - uses: actions/setup-ruby@v1
73
+ with:
74
+ ruby-version: ${{ matrix.ruby }}
75
+
76
+ - uses: actions/cache@v1
77
+ with:
78
+ path: vendor
79
+ key: v1-ruby-${{ matrix.ruby }}-suite-${{ matrix.suite }}
80
+
81
+ - name: Install Ruby dependencies
82
+ run: |
83
+ set -x
84
+ gem install bundler --version '1.17.3'
85
+ bundle config path "$(pwd)/vendor/bundle"
86
+ bundle config without development
87
+ ${{ matrix.env }} bundle update --jobs=$(nproc) --retry=3
88
+
89
+ - name: Run rspec
90
+ env:
91
+ AMQP_SERVER: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
92
+ run: |
93
+ ${{ 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
@@ -1,14 +1,11 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.2
2
+ TargetRubyVersion: 2.5
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
@@ -8,32 +8,34 @@ addons:
8
8
  packages:
9
9
  - rabbitmq-server
10
10
  rvm:
11
- - 2.6.3
12
- - 2.5.5
13
- - 2.4.6
14
- - 2.3.8
15
- gemfile:
16
- - gemfiles/rails_52.gemfile
17
- - gemfiles/rails_51.gemfile
18
- - gemfiles/rails_50.gemfile
19
- - gemfiles/rails_42.gemfile
11
+ - 2.7.0
12
+ - 2.6.5
13
+ - 2.5.7
14
+ - 2.4.9
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'
29
+
20
30
  before_install:
21
31
  - echo yes | rvm gemset delete global
22
- - gem install bundler -v'~>1.0'
32
+ - gem install bundler --version '~> 1.0'
23
33
  script:
24
- - bundle exec rake rubocop
25
- - bundle exec rake spec
26
- jobs:
27
- include:
28
- - stage: Release
29
- rvm: 2.6.3
30
- install: skip
31
- script: skip
32
- deploy:
33
- provider: rubygems
34
- api_key:
35
- secure: s7hUPxL4RULQ398GXk6Ko/y3QtUy7bZMTzcC4sL9Opsw76IRhOY0n+c6r+S8wHH3n+cRxiLpUyXRAsLMhjd67Rn+qaBoVbEfyzZKt1EAYyskFdPf40Jlq3FjOjRjAJW+hLDYloLXqqgLIrx/ybOv0YOfKyGKmk6eBNCx9S5GPJzt15WAM4Lz+TxNuR82YhsDybcGtTtLJ1WCF5FeQ297l2OESgvikRoADhIIM3HVk6Msyqw7RwFlpoIFGPRhXZD7UmML981rxK4Gxkh5xKGJiInjzL8lYOgT3KIfSLwtp9JoDbtpKbzdIQfA8Z35aRzpLjofPFxxYsKjwmCfdKxvJf5E5hTlenrILqSIovuknHb9oNOp0aCdp52N4+B8BZl7n1muQzr1AKy/ogtkTAgmlPs5tW+qx2h6E5MU0wfy6sS0AqKtVcGaZ1u85llifY2TvYriHReBIf8vddOe6LLbDcPnaTrTnAdsk/Bx9n+Zd8A2l3vzam9RbwTjlr7ZezIY67RRknfScEO+qCt9cfdAKf57ZdpiAecDFEr9V/CdAPEBevxaoiTwzFrjO+N9BY57eGHJsPda8NwNsrBraGBgcgKOXWeg9MowfU+wWpUSbeAJDZ2zZabGRKJkXpbRNNnf3webPSaXfb9qeWrCHXXbuI8JO+PQmx6OX8IHGjqyE1E=
36
- gem: mnemosyne-ruby
37
- on:
38
- tags: true
39
- repo: mnemosyne-mon/mnemosyne-ruby
34
+ - bundle exec rspec ${SPEC}
35
+
36
+ matrix:
37
+ exclude:
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,20 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'rails-60' do
4
+ group :test do
5
+ gem 'rails', '~> 6.0.0', require: false
6
+ gem 'sqlite3', '~> 1.4', require: false
7
+ end
8
+ end
1
9
 
2
10
  appraise 'rails-52' do
3
- gem 'rails', '~> 5.2.0', require: false
4
- 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
5
15
  end
6
16
 
7
17
  appraise 'rails-51' do
8
- gem 'rails', '~> 5.1.0', require: false
9
- 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
10
22
  end
11
23
 
12
24
  appraise 'rails-50' do
13
- gem 'rails', '~> 5.0.0', require: false
14
- gem 'sqlite3', '~> 1.3.6', require: false
15
- end
16
-
17
- appraise 'rails-42' do
18
- gem 'rails', '~> 4.2.0', require: false
19
- 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
20
29
  end
@@ -4,6 +4,26 @@ 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
+ ### Removed
8
+ - Support for Ruby 2.4 and Rails 4.2
9
+
10
+ ### Fixed
11
+ - Deprecation warnings due to block capture and keyword arguments
12
+
13
+ ## [1.10.0] - 2020-03-05
14
+ ### Added
15
+ - Support for Faraday 1.0
16
+
17
+ ## [1.9.0] - 2019-12-17
18
+ ### Fixed
19
+ - [Rack] Fix exceptions raised on trace submit corrupting the response
20
+
21
+ ### Added
22
+ - Rack: Collect redirect locations (#14)
23
+
24
+ ## [1.8.0] - 2019-10-25
25
+ ### Added
26
+ - Improve compatibility with Rails 6.0
7
27
 
8
28
  ## [1.7.1] - 2019-06-15
9
29
  ### Fixed
@@ -82,7 +102,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
82
102
  ### Added
83
103
  - Add platform identifier
84
104
 
85
- [unreleased]: https://github.com/:mnemosyne-mon/mnemosyne-ruby/compare/v1.7.1...HEAD
105
+ [Unreleased]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.10.0...HEAD
106
+ [1.10.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.9.0...v1.10.0
107
+ [1.9.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.8.0...v1.9.0
108
+ [1.8.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.7.1...v1.8.0
86
109
  [1.7.1]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.7.0...v1.7.1
87
110
  [1.7.0]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.6.2...v1.7.0
88
111
  [1.6.2]: https://github.com/mnemosyne-mon/mnemosyne-ruby/compare/v1.6.1...v1.6.2
data/Gemfile CHANGED
@@ -5,19 +5,26 @@ 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
+ gem 'rake-release', '~> 1.2.1'
27
+
28
+ gem 'pry', require: false
29
+ gem 'pry-byebug', require: false
30
+ end
data/README.md CHANGED
@@ -31,6 +31,8 @@ Or install it yourself as:
31
31
 
32
32
  $ gem install mnemosyne
33
33
 
34
+ Note: Removing support for ancient Ruby or Rails versions will not result in a new major. Please be extra careful when using ancient Ruby or Rails versions and updating gems.
35
+
34
36
  ## Usage
35
37
 
36
38
  TODO
data/Rakefile CHANGED
@@ -1,13 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
3
+ require 'rake/release/task'
4
4
  require 'rspec/core/rake_task'
5
5
  require 'rubocop/rake_task'
6
6
 
7
- RSpec::Core::RakeTask.new(:spec)
7
+ task default: %i[rubocop spec]
8
8
 
9
9
  RuboCop::RakeTask.new(:rubocop) do |task|
10
10
  task.fail_on_error = false
11
11
  end
12
12
 
13
- task default: %i[rubocop spec]
13
+ RSpec::Core::RakeTask.new(:spec)
14
+
15
+ Rake::Release::Task.new do |spec|
16
+ spec.sign_tag = true
17
+ end
@@ -2,19 +2,26 @@
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
- gem "rubocop", "~> 0.67.1"
9
- gem "timecop", "~> 0.8.0"
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
7
+ gem "rubocop", "~> 0.80.1"
8
+ gem "timecop", "~> 0.9.1"
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 "rake-release", "~> 1.2.1"
23
+ gem "pry", require: false
24
+ gem "pry-byebug", require: false
25
+ end
19
26
 
20
27
  gemspec path: "../"
@@ -2,19 +2,26 @@
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
- gem "rubocop", "~> 0.67.1"
9
- gem "timecop", "~> 0.8.0"
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
7
+ gem "rubocop", "~> 0.80.1"
8
+ gem "timecop", "~> 0.9.1"
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 "rake-release", "~> 1.2.1"
23
+ gem "pry", require: false
24
+ gem "pry-byebug", require: false
25
+ end
19
26
 
20
27
  gemspec path: "../"
@@ -2,19 +2,26 @@
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
- gem "rubocop", "~> 0.67.1"
9
- gem "timecop", "~> 0.8.0"
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
7
+ gem "rubocop", "~> 0.80.1"
8
+ gem "timecop", "~> 0.9.1"
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 "rake-release", "~> 1.2.1"
23
+ gem "pry", require: false
24
+ gem "pry-byebug", require: false
25
+ end
19
26
 
20
27
  gemspec path: "../"
@@ -0,0 +1,27 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rspec", "~> 3.6"
7
+ gem "rubocop", "~> 0.80.1"
8
+ gem "timecop", "~> 0.9.1"
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 "rake-release", "~> 1.2.1"
23
+ gem "pry", require: false
24
+ gem "pry-byebug", require: false
25
+ end
26
+
27
+ 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)
@@ -57,7 +57,7 @@ module Mnemosyne
57
57
  'amqps' => 5671
58
58
  }.freeze
59
59
 
60
- def make_amqp_uri(amqp) # rubocop:disable AbcSize
60
+ def make_amqp_uri(amqp)
61
61
  uri = URI('')
62
62
 
63
63
  uri.scheme = amqp[:scheme]
@@ -5,13 +5,13 @@ 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
12
11
 
13
12
  def attach_error(err)
14
13
  return unless (trace = ::Mnemosyne::Instrumenter.current_trace)
14
+
15
15
  trace.attach_error(err)
16
16
  end
17
17
  end
@@ -27,10 +27,11 @@ module Mnemosyne
27
27
  def trace(name, **kwargs)
28
28
  if (trace = current_trace)
29
29
  return yield trace if block_given?
30
+
30
31
  return trace
31
32
  end
32
33
 
33
- trace = self.current_trace = Trace.new(self, name, kwargs)
34
+ trace = self.current_trace = Trace.new(self, name, **kwargs)
34
35
 
35
36
  return trace unless block_given?
36
37
 
@@ -67,9 +68,9 @@ module Mnemosyne
67
68
 
68
69
  @instance = new(config: config, client: client)
69
70
  end
70
- rescue StandardError => err
71
+ rescue StandardError => e
71
72
  ::Mnemosyne::Logging.logger.warn(Mnemosyne) do
72
- "Unable to start instrumenter: #{err}"
73
+ "Unable to start instrumenter: #{e}"
73
74
  end
74
75
 
75
76
  raise
@@ -84,13 +85,15 @@ module Mnemosyne
84
85
  @instance = old
85
86
  end
86
87
 
87
- def trace(*args)
88
+ def trace(*args, **kwargs)
88
89
  return unless (instrumenter = instance)
89
- instrumenter.trace(*args)
90
+
91
+ instrumenter.trace(*args, **kwargs)
90
92
  end
91
93
 
92
94
  def current_trace
93
95
  return unless (instrumenter = instance)
96
+
94
97
  instrumenter.current_trace
95
98
  end
96
99
  end
@@ -21,10 +21,10 @@ module Mnemosyne
21
21
 
22
22
  env[:request_headers].merge!({
23
23
  'X-Mnemosyne-Transaction' => trace.transaction,
24
- 'X-Mnemosyne-Origin' => span.uuid,
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!
@@ -16,24 +16,20 @@ module Mnemosyne
16
16
  @body.respond_to?(*args)
17
17
  end
18
18
 
19
- def method_missing(*args)
19
+ def method_missing(*args, &block)
20
20
  super if args.first && args.first.to_s == 'to_ary'
21
-
22
- if block_given?
23
- @body.__send__(*args, &Proc.new)
24
- else
25
- @body.__send__(*args)
26
- end
21
+ @body.__send__(*args, &block)
27
22
  end
28
23
 
29
24
  def close
30
25
  return if @closed
26
+
31
27
  @closed = true
32
28
 
33
29
  begin
34
30
  @body.close if @body.respond_to? :close
35
31
  ensure
36
- @trace.submit
32
+ _submit_trace
37
33
  end
38
34
  end
39
35
 
@@ -41,19 +37,28 @@ module Mnemosyne
41
37
  @closed
42
38
  end
43
39
 
44
- def each(*args)
45
- @body.each(*args, &Proc.new)
40
+ def each(*args, &block)
41
+ @body.each(*args, &block)
46
42
  rescue StandardError, LoadError, SyntaxError => e
47
43
  @trace.attach_error(e)
48
44
  raise
49
45
  end
46
+
47
+ private
48
+
49
+ def _submit_trace
50
+ @trace.submit
51
+ rescue Exception => e # rubocop:disable Lint/RescueException
52
+ ::Mnemosyne::Logging.logger.error \
53
+ "Error while submitting trace: #{e}\n #{e.backtrace.join("\n ")}"
54
+ end
50
55
  end
51
56
 
52
57
  def initialize(app)
53
58
  @app = app
54
59
  end
55
60
 
56
- def call(env) # rubocop:disable AbcSize
61
+ def call(env)
57
62
  origin = env.fetch('HTTP_X_MNEMOSYNE_ORIGIN', false)
58
63
  transaction = env.fetch('HTTP_X_MNEMOSYNE_TRANSACTION') do
59
64
  ::SecureRandom.uuid
@@ -85,7 +90,7 @@ module Mnemosyne
85
90
 
86
91
  raise
87
92
  ensure
88
- trace.release if trace
93
+ trace&.release
89
94
  end
90
95
 
91
96
  private
@@ -109,7 +114,10 @@ module Mnemosyne
109
114
 
110
115
  return unless headers
111
116
 
112
- trace.meta[:content_type] = headers['Content-Type']
117
+ trace.meta.merge!({
118
+ content_type: headers['Content-Type'],
119
+ location: headers['Location']
120
+ }.compact)
113
121
  end
114
122
  end
115
123
  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
@@ -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
@@ -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
@@ -17,9 +17,11 @@ module Mnemosyne
17
17
 
18
18
  module Extension
19
19
  def lock!
20
- if !@handlers.include?('Mnemosyne::Middleware::Faraday')
21
- if respond_to?(:is_adapter?, true) &&
22
- (idx = @handlers.find_index {|h| is_adapter?(h) })
20
+ unless @handlers.include?('Mnemosyne::Middleware::Faraday')
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
@@ -5,7 +5,7 @@ require 'rails'
5
5
  module Mnemosyne
6
6
  class Railtie < ::Rails::Railtie
7
7
  initializer 'mnemosyne.initialize' do |app|
8
- config = app.config_for('mnemosyne')
8
+ config = app.config_for('mnemosyne').stringify_keys
9
9
 
10
10
  ::Mnemosyne::Logging.logger = Rails.logger
11
11
 
@@ -51,6 +51,7 @@ module Mnemosyne
51
51
  def required(path)
52
52
  return unless activated?
53
53
  return unless (set = monitor.delete(path))
54
+
54
55
  set.each(&method(:activate))
55
56
  end
56
57
 
@@ -57,12 +57,13 @@ module Mnemosyne
57
57
  end
58
58
 
59
59
  Error = Struct.new(:error) do
60
- BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$/
60
+ BT_REGEXP = /^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$/.freeze
61
61
 
62
62
  def serialize
63
63
  {
64
64
  type: error.class.name,
65
65
  text: error.message.to_s,
66
+ cause: serialize_cause,
66
67
  stacktrace: serialize_backtrace
67
68
  }.compact
68
69
  end
@@ -78,6 +79,10 @@ module Mnemosyne
78
79
  {file: md[1], line: md[2], call: md[3], raw: md[0]}
79
80
  end
80
81
  end
82
+
83
+ def serialize_cause
84
+ self.class.new(error.cause).serialize if error.cause
85
+ end
81
86
  end
82
87
  end
83
88
  end
@@ -3,8 +3,8 @@
3
3
  module Mnemosyne
4
4
  module VERSION
5
5
  MAJOR = 1
6
- MINOR = 7
7
- PATCH = 1
6
+ MINOR = 11
7
+ PATCH = 0
8
8
  STAGE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
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.7.1
4
+ version: 1.11.0
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-06-15 00:00:00.000000000 Z
11
+ date: 2020-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -59,6 +59,9 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".editorconfig"
63
+ - ".github/workflows/build.yml"
64
+ - ".github/workflows/lint.yml"
62
65
  - ".gitignore"
63
66
  - ".rspec"
64
67
  - ".rubocop.yml"
@@ -69,10 +72,10 @@ files:
69
72
  - LICENSE
70
73
  - README.md
71
74
  - Rakefile
72
- - gemfiles/rails_42.gemfile
73
75
  - gemfiles/rails_50.gemfile
74
76
  - gemfiles/rails_51.gemfile
75
77
  - gemfiles/rails_52.gemfile
78
+ - gemfiles/rails_60.gemfile
76
79
  - lib/mnemosyne-ruby.rb
77
80
  - lib/mnemosyne.rb
78
81
  - lib/mnemosyne/client.rb
@@ -134,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
137
  - !ruby/object:Gem::Version
135
138
  version: '0'
136
139
  requirements: []
137
- rubygems_version: 3.0.3
140
+ rubygems_version: 3.2.1
138
141
  signing_key:
139
142
  specification_version: 4
140
143
  summary: Ruby/Rails client for Mnemosyne APM
@@ -1,20 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.6"
8
- gem "rubocop", "~> 0.67.1"
9
- gem "timecop", "~> 0.8.0"
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
19
-
20
- gemspec path: "../"