appmap 0.64.0 → 0.65.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: 0df13ca1b5fd3d0dbba13b97bdb28e5fd3e37a62763282769d370fd1c7f3d9bc
4
- data.tar.gz: d2cf8db5e9fdbd0c9802a514d9a35f19caa305fad9eeb7ecef42fb6d195a8735
3
+ metadata.gz: 9ff92977defe997917c8b7c2d9d5974d5e743c02b637bcfffa5548e087d4644f
4
+ data.tar.gz: 4889a8d717b0167737719acc75c12f5709404b6445b6dd633523cd76e4992a96
5
5
  SHA512:
6
- metadata.gz: 327795a4c2903e30f487ec12c3e989a79d42f9c3b9d4dcd1ef3d5e863cbdefecc189f157a61cd3652c985f92a39d94f915eeee52db5d41ed6ac1f9fa8befc0cf
7
- data.tar.gz: cc3a9a103df311b1060050207557bd76f898314295562d6913279924ad13983fcb720bacefd553857b551e07f4ec0b308334ae944adafd72ba624487d61b5031
6
+ metadata.gz: 4a78ced9dc2d5c0e80fe0f68d01508cff0af59bfc65f9a747ec5f981d7bd5a7523a59230427ddf465b39db1768f2443c856a93c852ddb444bc80eec4a539f460
7
+ data.tar.gz: 21a54adacd2b5b27a5f2a6143db0c0684716a9d1db6add75d4e05fdd73054bb9576fc2bac3ce68067230d1fb04caf177c8e4366e05a061301bd1a9dd84214bf5
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
 
3
3
  rbenv:
4
- - 2.5
5
4
  - 2.6
6
5
  - 2.7
6
+ - 3.0
7
7
 
8
8
  addons:
9
9
  apt:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [0.65.0](https://github.com/applandinc/appmap-ruby/compare/v0.64.0...v0.65.0) (2021-09-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Require fileutils as needed ([790c3a8](https://github.com/applandinc/appmap-ruby/commit/790c3a88b0e69581e0e4f73b7a92f46448b3cdd8))
7
+
8
+
9
+ ### Features
10
+
11
+ * Add support for Ruby 3.0, and drop Ruby 2.5 ([eba14e1](https://github.com/applandinc/appmap-ruby/commit/eba14e1669bdf50dc51ce8623c5d586edfdb1a2f))
12
+
1
13
  # [0.64.0](https://github.com/applandinc/appmap-ruby/compare/v0.63.0...v0.64.0) (2021-08-24)
2
14
 
3
15
 
data/README.md CHANGED
@@ -117,11 +117,11 @@ root@6fab5f89125f:/src/app# bundle
117
117
  ```
118
118
 
119
119
  At this point, the bundle is built with the `appmap` gem located in `/src/appmap`, which is volume-mounted from the host.
120
- So you can edit the fixture code and the appmap code and run test commands such as `rspec` and `cucumber` in the container.
120
+ So you can edit the fixture code and the appmap code and run test commands such as `rspec` in the container.
121
121
  For example:
122
122
 
123
123
  ```sh-session
124
- root@6fab5f89125f:/src/app# bundle exec rspec
124
+ root@6fab5f89125f:/src/app# APPMAP=true bundle exec rspec
125
125
  Configuring AppMap from path appmap.yml
126
126
  ....
127
127
 
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ namespace 'gem' do
28
28
  end
29
29
  end
30
30
 
31
- RUBY_VERSIONS=%w[2.5 2.6 2.7].select do |version|
31
+ RUBY_VERSIONS=%w[2.6 2.7 3.0].select do |version|
32
32
  travis_ruby_version = ENV['TRAVIS_RUBY_VERSION']
33
33
  next true unless travis_ruby_version
34
34
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
+ require 'yaml'
4
5
  require 'appmap/service/guesser'
5
6
 
6
7
  module AppMap
data/lib/appmap/config.rb CHANGED
@@ -254,7 +254,7 @@ module AppMap
254
254
  functions.each do |func|
255
255
  package_options = {}
256
256
  package_options[:labels] = func.labels if func.labels
257
- @hooked_methods[func.cls] << TargetMethods.new(func.function_names, Package.build_from_path(func.package, package_options))
257
+ @hooked_methods[func.cls] << TargetMethods.new(func.function_names, Package.build_from_path(func.package, **package_options))
258
258
  end
259
259
 
260
260
  @hooked_methods.each_value do |hooks|
@@ -367,7 +367,7 @@ module AppMap
367
367
  config_params[:depends_config] = depends_config
368
368
  end
369
369
 
370
- Config.new name, config_params
370
+ Config.new name, **config_params
371
371
  end
372
372
  end
373
373
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'appmap/util'
4
+ require 'fileutils'
4
5
 
5
6
  module AppMap
6
7
  module Cucumber
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module AppMap
2
4
  module Depends
3
5
  module Util
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'appmap/util'
4
+ require 'fileutils'
4
5
  require 'active_support'
5
6
  require 'active_support/core_ext'
6
7
 
data/lib/appmap/rspec.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'appmap/util'
4
4
  require 'set'
5
+ require 'fileutils'
5
6
 
6
7
  module AppMap
7
8
  # Integration of AppMap with RSpec. When enabled with APPMAP=true, the AppMap tracer will
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'appmap/service/validator/violation'
4
+ require 'yaml'
4
5
 
5
6
  module AppMap
6
7
  module Service
@@ -76,7 +77,10 @@ module AppMap
76
77
  end
77
78
 
78
79
  def validate_ruby_version
79
- unless RUBY_VERSION =~ AppMap::SUPPORTED_RUBY_VERSIONS_REGEX
80
+ major, minor, _ = RUBY_VERSION.split('.')
81
+ version = [ major, minor ].join('.')
82
+
83
+ unless AppMap::SUPPORTED_RUBY_VERSIONS.member?(version)
80
84
  @violations << Violation.error(
81
85
  message: "AppMap does not support Ruby #{RUBY_VERSION}. " \
82
86
  "Supported versions are: #{AppMap::SUPPORTED_RUBY_VERSIONS.join(', ')}."
@@ -1,5 +1,6 @@
1
1
  require 'rake'
2
2
  require 'yaml'
3
+ require 'fileutils'
3
4
  require 'appmap/node_cli'
4
5
  require 'appmap/swagger/markdown_descriptions'
5
6
  require 'appmap/swagger/stable'
data/lib/appmap/util.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler'
4
+ require 'fileutils'
4
5
 
5
6
  module AppMap
6
7
  module Util
@@ -130,7 +131,6 @@ module AppMap
130
131
 
131
132
  # Atomically writes AppMap data to +filename+.
132
133
  def write_appmap(filename, appmap)
133
- require 'fileutils'
134
134
  require 'tmpdir'
135
135
 
136
136
  # This is what Ruby Tempfile does; but we don't want the file to be unlinked.
@@ -3,12 +3,11 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.64.0'
6
+ VERSION = '0.65.0'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.5.1'
9
9
 
10
- SUPPORTED_RUBY_VERSIONS_REGEX = /^2\.[567]\./.freeze
11
- SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7].freeze
10
+ SUPPORTED_RUBY_VERSIONS = %w[2.6 2.7 3.0].freeze
12
11
 
13
12
  DEFAULT_APPMAP_DIR = 'tmp/appmap'.freeze
14
13
  DEFAULT_CONFIG_FILE_PATH = 'appmap.yml'.freeze
@@ -55,7 +55,7 @@ describe 'Depends API' do
55
55
  describe '.inspect_test_files' do
56
56
  it 'reports metadata, added, removed, changed, failed' do
57
57
  test_report = api.inspect_test_files(appmap_dir: DEPENDS_TEST_DIR, test_file_patterns: %w[spec/fixtures/depends/spec/*_spec.rb])
58
- expect(test_report.metadata_files).to eq(%w[spec/fixtures/depends/user_page_scenario/metadata.json spec/fixtures/depends/revoke_api_key/metadata.json])
58
+ expect(test_report.metadata_files.sort).to eq(%w[spec/fixtures/depends/revoke_api_key/metadata.json spec/fixtures/depends/user_page_scenario/metadata.json])
59
59
  expect(test_report.added).to be_empty
60
60
  expect(test_report.removed).to be_empty
61
61
  expect(test_report.changed).to be_empty
@@ -7,7 +7,7 @@ gem 'haml-rails'
7
7
 
8
8
  gem 'activerecord', require: false
9
9
  gem 'pg'
10
- gem 'sequel', '= 5.20.0', require: false
10
+ gem 'sequel', '>= 5.43.0', require: false
11
11
  gem 'sequel-rails', require: false
12
12
  gem 'sequel_secure_password', require: false
13
13
 
@@ -15,7 +15,7 @@ services:
15
15
  dockerfile: Dockerfile
16
16
  image: rails6-app:${RUBY_VERSION}
17
17
  command:
18
- [ "./bin/rails", "server", "-b", "0.0.0.0", "webrick" ]
18
+ [ "./bin/rails", "server", "-b", "0.0.0.0", "-u", "webrick" ]
19
19
  environment:
20
20
  RAILS_ENV:
21
21
  ORM_MODULE:
data/spec/hook_spec.rb CHANGED
@@ -987,10 +987,12 @@ describe 'AppMap class Hooking', docker: false do
987
987
  end
988
988
 
989
989
  describe 'kwargs handling' do
990
- # https://github.com/applandinc/appmap-ruby/issues/153
991
- it 'empty hash for **kwrest can be proxied as a regular function argument', github_issue: 153 do
992
- invoke_test_file 'spec/fixtures/hook/kwargs.rb' do
993
- expect(Kwargs.has_kwrest_calls_no_kwargs(nil, {})).to eq({})
990
+ if ruby_2?
991
+ # https://github.com/applandinc/appmap-ruby/issues/153
992
+ it 'empty hash for **kwrest can be proxied as a regular function argument', github_issue: 153 do
993
+ invoke_test_file 'spec/fixtures/hook/kwargs.rb' do
994
+ expect(Kwargs.has_kwrest_calls_no_kwargs(nil, {})).to eq({})
995
+ end
994
996
  end
995
997
  end
996
998
  end
@@ -1,7 +1,10 @@
1
1
  require 'rails_spec_helper'
2
2
 
3
+ # Rails5 doesn't work with Ruby 3.x
4
+ RailsVersions = ruby_2? ? [ 5, 6 ] : [ 6 ]
5
+
3
6
  describe 'Rails' do
4
- %w[5 6].each do |rails_major_version| # rubocop:disable Metrics/BlockLength
7
+ RailsVersions.each do |rails_major_version| # rubocop:disable Metrics/BlockLength
5
8
  context "#{rails_major_version}" do
6
9
  include_context 'Rails app pg database', "spec/fixtures/rails#{rails_major_version}_users_app" unless use_existing_data?
7
10
  include_context 'rails integration test setup'
@@ -239,7 +242,7 @@ describe 'Rails' do
239
242
  end
240
243
 
241
244
  describe 'with default appmap.yml' do
242
- include_context 'Rails app pg database', "spec/fixtures/rails5_users_app" unless use_existing_data?
245
+ include_context 'Rails app pg database', "spec/fixtures/rails6_users_app" unless use_existing_data?
243
246
  include_context 'rails integration test setup'
244
247
 
245
248
  def run_spec(spec_name)
data/spec/railtie_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rails_spec_helper'
2
2
 
3
3
  describe 'AppMap tracer via Railtie' do
4
- include_context 'Rails app pg database', 'spec/fixtures/rails5_users_app' do
4
+ include_context 'Rails app pg database', 'spec/fixtures/rails6_users_app' do
5
5
  let(:env) { {} }
6
6
 
7
7
  let(:cmd) { %(docker-compose run --rm -e RAILS_ENV=development -e APPMAP app ./bin/rails r "puts AppMap.instance_variable_get('@configuration').nil?") }
@@ -10,13 +10,13 @@ describe 'AppMap tracer via Railtie' do
10
10
  Open3.capture3(env, cmd, chdir: fixture_dir).tap do |result|
11
11
  unless result[2] == 0
12
12
  warn <<~STDERR
13
- Failed to run rails5_users_app container
13
+ Failed to run rails6_users_app container
14
14
  <<< Output:
15
15
  #{result[0]}
16
16
  #{result[1]}
17
17
  >>> End of output
18
18
  STDERR
19
- raise 'Failed to run rails5_users_app container'
19
+ raise 'Failed to run rails6_users_app container'
20
20
  end
21
21
  end
22
22
  end
@@ -1,7 +1,7 @@
1
1
  require 'rails_spec_helper'
2
2
 
3
3
  describe 'SQL events' do
4
- include_context 'Rails app pg database', 'spec/fixtures/rails5_users_app' do
4
+ include_context 'Rails app pg database', 'spec/fixtures/rails6_users_app' do
5
5
  around(:each) do |example|
6
6
  FileUtils.rm_rf tmpdir
7
7
  FileUtils.mkdir_p tmpdir
@@ -3,9 +3,9 @@ require 'net/http'
3
3
  require 'socket'
4
4
 
5
5
  describe 'remote recording', :order => :defined do
6
- include_context 'Rails app pg database', 'spec/fixtures/rails5_users_app' do
6
+ include_context 'Rails app pg database', 'spec/fixtures/rails6_users_app' do
7
7
  before(:all) do
8
- fixture_dir = 'spec/fixtures/rails5_users_app'
8
+ fixture_dir = 'spec/fixtures/rails6_users_app'
9
9
  start_cmd = 'docker-compose up -d app'
10
10
  run_cmd({ 'ORM_MODULE' => 'sequel', 'APPMAP' => 'true' }, start_cmd, chdir: fixture_dir)
11
11
  Dir.chdir fixture_dir do
@@ -44,7 +44,7 @@ describe 'remote recording', :order => :defined do
44
44
  end
45
45
 
46
46
  after(:all) do
47
- fixture_dir = 'spec/fixtures/rails5_users_app'
47
+ fixture_dir = 'spec/fixtures/rails6_users_app'
48
48
  run_cmd 'docker-compose rm -fs app', chdir: fixture_dir
49
49
  end
50
50
 
data/spec/spec_helper.rb CHANGED
@@ -21,6 +21,10 @@ def use_existing_data?
21
21
  ENV['USE_EXISTING_DATA'] == 'true'
22
22
  end
23
23
 
24
+ def ruby_2?
25
+ RUBY_VERSION.split('.')[0].to_i == 2
26
+ end
27
+
24
28
  shared_context 'collect events' do
25
29
  def collect_events(tracer)
26
30
  [].tap do |events|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.0
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-24 00:00:00.000000000 Z
11
+ date: 2021-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport