appmap 0.80.1 → 0.81.1
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 +4 -4
- data/.travis.yml +1 -2
- data/CHANGELOG.md +23 -0
- data/lib/appmap/class_map.rb +1 -1
- data/lib/appmap/handler/rails/template.rb +1 -1
- data/lib/appmap/hook/method.rb +22 -7
- data/lib/appmap/hook.rb +1 -1
- data/lib/appmap/open.rb +1 -1
- data/lib/appmap/rspec.rb +1 -1
- data/lib/appmap/swagger/markdown_descriptions.rb +2 -2
- data/lib/appmap/swagger/stable.rb +2 -2
- data/lib/appmap/util.rb +1 -1
- data/lib/appmap/version.rb +3 -3
- data/spec/depends/api_spec.rb +21 -17
- data/spec/handler/eval_spec.rb +1 -1
- data/spec/hook_spec.rb +10 -6
- data/spec/rails_spec_helper.rb +2 -2
- data/spec/remote_recording_spec.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94d8d2495de74768697429a640c553549c029992969acfeb65c540f2471fbef3
|
4
|
+
data.tar.gz: bfbdf261991d859d31ec1f98c95ca9954e08bb1de0fe98ac2973a06c42a3dd18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 993e2ce2c51973a6469fd5f10c66c48c13200c4456f3230748e9d5ffd2b107962cdae7d0b286d59e4ee95aee98957dfa6cd062d0ac4ba5ab1923e99da233edf1
|
7
|
+
data.tar.gz: 512cb13c413d394d5237840f8dfec94a0d1d0720cb6c4e164d46e11949078b808b7c25220c3c0fc32a9be74ed4326726ef844588ea346a84242bdca1f87f3056
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
## [0.81.1](https://github.com/applandinc/appmap-ruby/compare/v0.81.0...v0.81.1) (2022-04-27)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* AppMap format version is 1.7.0 ([53b3f04](https://github.com/applandinc/appmap-ruby/commit/53b3f04dc4f4a7867f28f5b196b2fadbe7cb6eeb))
|
7
|
+
* Avoid return within a block (Ruby 2.5) ([85094fd](https://github.com/applandinc/appmap-ruby/commit/85094fd760b3ea08d343960cf586f4cce210fb07))
|
8
|
+
|
9
|
+
# [0.81.0](https://github.com/applandinc/appmap-ruby/compare/v0.80.2...v0.81.0) (2022-04-26)
|
10
|
+
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* Add Ruby 2.5 to the version whitelist ([945f7da](https://github.com/applandinc/appmap-ruby/commit/945f7daaee9685a55f14e8714677661fa5cb4e82))
|
15
|
+
|
16
|
+
## [0.80.2](https://github.com/applandinc/appmap-ruby/compare/v0.80.1...v0.80.2) (2022-04-26)
|
17
|
+
|
18
|
+
|
19
|
+
### Bug Fixes
|
20
|
+
|
21
|
+
* Ensure that request env key is a string ([721baef](https://github.com/applandinc/appmap-ruby/commit/721baefbb3ba083bf6c5a1b46e6ddffa51feebec))
|
22
|
+
* Fix method_display_name ([b05c7fe](https://github.com/applandinc/appmap-ruby/commit/b05c7fe027a981214b224852dc54c5e467e1f116))
|
23
|
+
|
1
24
|
## [0.80.1](https://github.com/applandinc/appmap-ruby/compare/v0.80.0...v0.80.1) (2022-04-08)
|
2
25
|
|
3
26
|
|
data/lib/appmap/class_map.rb
CHANGED
@@ -78,7 +78,7 @@ module AppMap
|
|
78
78
|
end
|
79
79
|
|
80
80
|
collapse_package = lambda do |package|
|
81
|
-
|
81
|
+
next unless package.type == 'package'
|
82
82
|
|
83
83
|
while package.children.length == 1 && package.children.all? { |child| child.type == 'package' }
|
84
84
|
child = package.children[0]
|
data/lib/appmap/hook/method.rb
CHANGED
@@ -18,6 +18,8 @@ module AppMap
|
|
18
18
|
method
|
19
19
|
end
|
20
20
|
|
21
|
+
RUBY_MAJOR_VERSION, RUBY_MINOR_VERSION, _ = RUBY_VERSION.split('.').map(&:to_i)
|
22
|
+
|
21
23
|
# Single hooked method.
|
22
24
|
# Call #activate to override the original.
|
23
25
|
class Method
|
@@ -51,18 +53,31 @@ module AppMap
|
|
51
53
|
if hook_class == Kernel
|
52
54
|
hook_class.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
|
53
55
|
else
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
else
|
58
|
-
warn "#{hook_method.name} not found on #{hook_class}"
|
59
|
-
end
|
56
|
+
cls = defining_class(hook_class)
|
57
|
+
if cls
|
58
|
+
cls.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
|
60
59
|
end
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
64
63
|
protected
|
65
64
|
|
65
|
+
def defining_class(hook_class)
|
66
|
+
cls = \
|
67
|
+
if RUBY_MAJOR_VERSION == 2 && RUBY_MINOR_VERSION <= 5
|
68
|
+
hook_class
|
69
|
+
.ancestors
|
70
|
+
.select { |cls| cls.method_defined?(hook_method.name) }
|
71
|
+
.find { |cls| cls.instance_method(hook_method.name).owner == cls }
|
72
|
+
else
|
73
|
+
hook_class.ancestors.find { |cls| cls.method_defined?(hook_method.name, false) }
|
74
|
+
end
|
75
|
+
|
76
|
+
return cls if cls
|
77
|
+
|
78
|
+
warn "#{hook_method.name} not found on #{hook_class}"
|
79
|
+
end
|
80
|
+
|
66
81
|
def gettime
|
67
82
|
Process.clock_gettime Process::CLOCK_MONOTONIC
|
68
83
|
end
|
@@ -78,7 +93,7 @@ module AppMap
|
|
78
93
|
def method_display_name
|
79
94
|
return @method_display_name if @method_display_name
|
80
95
|
|
81
|
-
return @method_display_name = [defined_class,
|
96
|
+
return @method_display_name = [defined_class, '#', hook_method.name].join if defined_class
|
82
97
|
|
83
98
|
"#{hook_method.name} (class resolution deferred)"
|
84
99
|
end
|
data/lib/appmap/hook.rb
CHANGED
@@ -116,7 +116,7 @@ module AppMap
|
|
116
116
|
|
117
117
|
hook_method = lambda do |entry|
|
118
118
|
cls, method = entry
|
119
|
-
|
119
|
+
next if config.never_hook?(cls, method)
|
120
120
|
|
121
121
|
hook.package.handler_class.new(hook.package, cls, method).activate
|
122
122
|
end
|
data/lib/appmap/open.rb
CHANGED
data/lib/appmap/rspec.rb
CHANGED
@@ -78,7 +78,7 @@ module AppMap
|
|
78
78
|
super
|
79
79
|
|
80
80
|
webdriver_port = lambda do
|
81
|
-
|
81
|
+
next unless defined?(page) && page&.driver
|
82
82
|
|
83
83
|
# This is the ugliest thing ever but I don't want to lose it.
|
84
84
|
# All the WebDriver calls are getting app-mapped and it's really unclear
|
@@ -15,8 +15,8 @@ module AppMap
|
|
15
15
|
|
16
16
|
def perform
|
17
17
|
to_markdown = lambda do |obj|
|
18
|
-
|
19
|
-
|
18
|
+
next obj.each(&to_markdown) if obj.is_a?(Array)
|
19
|
+
next unless obj.is_a?(Hash)
|
20
20
|
|
21
21
|
description = obj['description']
|
22
22
|
obj['description'] = converter.(description) if description
|
@@ -10,8 +10,8 @@ module AppMap
|
|
10
10
|
def perform
|
11
11
|
clean_only = nil
|
12
12
|
clean = lambda do |obj, properties = %w[description example]|
|
13
|
-
|
14
|
-
|
13
|
+
next obj.each(&clean_only.(properties)) if obj.is_a?(Array)
|
14
|
+
next unless obj.is_a?(Hash)
|
15
15
|
|
16
16
|
properties.each { |property| obj.delete property }
|
17
17
|
|
data/lib/appmap/util.rb
CHANGED
@@ -122,7 +122,7 @@ module AppMap
|
|
122
122
|
# Apparently, it's following the CGI spec in doing so.
|
123
123
|
# https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.18
|
124
124
|
matching_headers = env
|
125
|
-
.select { |k,v| k.start_with? 'HTTP_' }
|
125
|
+
.select { |k,v| k.to_s.start_with? 'HTTP_' }
|
126
126
|
.merge(
|
127
127
|
'CONTENT_TYPE' => env['CONTENT_TYPE'],
|
128
128
|
'CONTENT_LENGTH' => env['CONTENT_LENGTH'],
|
data/lib/appmap/version.rb
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
module AppMap
|
4
4
|
URL = 'https://github.com/applandinc/appmap-ruby'
|
5
5
|
|
6
|
-
VERSION = '0.
|
6
|
+
VERSION = '0.81.1'
|
7
7
|
|
8
|
-
APPMAP_FORMAT_VERSION = '1.
|
8
|
+
APPMAP_FORMAT_VERSION = '1.7.0'
|
9
9
|
|
10
|
-
SUPPORTED_RUBY_VERSIONS = %w[2.6 2.7 3.0 3.1].freeze
|
10
|
+
SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1].freeze
|
11
11
|
|
12
12
|
DEFAULT_APPMAP_DIR = 'tmp/appmap'.freeze
|
13
13
|
DEFAULT_CONFIG_FILE_PATH = 'appmap.yml'.freeze
|
data/spec/depends/api_spec.rb
CHANGED
@@ -110,12 +110,14 @@ describe 'Depends API' do
|
|
110
110
|
|
111
111
|
describe 'smoke test' do
|
112
112
|
around do |test|
|
113
|
-
|
114
|
-
|
113
|
+
begin
|
114
|
+
@minitest_test_command_method = AppMap.configuration.depends_config.minitest_test_command_method
|
115
|
+
AppMap.configuration.depends_config.minitest_test_command_method = 'AppMap::Depends::APISpec.minitest_test_command'
|
115
116
|
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
test.call
|
118
|
+
ensure
|
119
|
+
AppMap.configuration.depends_config.minitest_test_command_method = @minitest_test_command
|
120
|
+
end
|
119
121
|
end
|
120
122
|
|
121
123
|
it 'passes a smoke test' do
|
@@ -125,20 +127,22 @@ describe 'Depends API' do
|
|
125
127
|
|
126
128
|
describe 'configuration settings' do
|
127
129
|
it 'can all be modified' do
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
%i[
|
132
|
-
|
133
|
-
|
134
|
-
|
130
|
+
begin
|
131
|
+
defaults = {}
|
132
|
+
|
133
|
+
%i[rspec minitest].each do |framework|
|
134
|
+
%i[environment_method select_tests_method test_command_method].each do |setting|
|
135
|
+
full_setting = [ framework, setting ].join('_').to_sym
|
136
|
+
defaults[full_setting] = AppMap.configuration.depends_config.send(full_setting)
|
137
|
+
AppMap.configuration.depends_config.send("#{full_setting}=", "AppMap::Depends::APISpec.#{full_setting}")
|
138
|
+
end
|
135
139
|
end
|
136
|
-
end
|
137
140
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
141
|
+
run_tests
|
142
|
+
ensure
|
143
|
+
defaults.keys.each do |setting|
|
144
|
+
AppMap.configuration.depends_config.send("#{setting}=", defaults[setting])
|
145
|
+
end
|
142
146
|
end
|
143
147
|
end
|
144
148
|
end
|
data/spec/handler/eval_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe 'AppMap::Handler::Eval' do
|
|
38
38
|
# a la Ruby 2.6.3 ruby-token.rb
|
39
39
|
# token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}")
|
40
40
|
it 'can define a new class' do
|
41
|
-
num = (Random.random_number * 10_000).to_i
|
41
|
+
num = (Random.new.random_number * 10_000).to_i
|
42
42
|
class_name = "Cls_#{num}"
|
43
43
|
m = ClassMaker
|
44
44
|
cls = nil
|
data/spec/hook_spec.rb
CHANGED
@@ -751,9 +751,11 @@ describe 'AppMap class Hooking' do
|
|
751
751
|
:lineno: 9
|
752
752
|
YAML
|
753
753
|
test_hook_behavior 'spec/fixtures/hook/exception_method.rb', events_yaml do
|
754
|
-
|
755
|
-
|
756
|
-
|
754
|
+
begin
|
755
|
+
ExceptionMethod.new.raise_exception
|
756
|
+
rescue
|
757
|
+
# don't let the exception fail the test
|
758
|
+
end
|
757
759
|
end
|
758
760
|
end
|
759
761
|
|
@@ -781,9 +783,11 @@ describe 'AppMap class Hooking' do
|
|
781
783
|
:lineno: 59
|
782
784
|
YAML
|
783
785
|
test_hook_behavior 'spec/fixtures/hook/exception_method.rb', events_yaml do
|
784
|
-
|
785
|
-
|
786
|
-
|
786
|
+
begin
|
787
|
+
ExceptionMethod.new.raise_illegal_utf8_message
|
788
|
+
rescue
|
789
|
+
# don't let the exception fail the test
|
790
|
+
end
|
787
791
|
end
|
788
792
|
end
|
789
793
|
|
data/spec/rails_spec_helper.rb
CHANGED
@@ -18,7 +18,7 @@ class TestRailsApp
|
|
18
18
|
attr_reader :fixture_dir
|
19
19
|
|
20
20
|
def run_cmd(cmd, env = {})
|
21
|
-
run_process method(:system), cmd, env
|
21
|
+
run_process method(:system), cmd, env
|
22
22
|
end
|
23
23
|
|
24
24
|
def spawn_cmd(cmd, env = {})
|
@@ -33,7 +33,7 @@ class TestRailsApp
|
|
33
33
|
|
34
34
|
def database_name
|
35
35
|
# This is used locally too, so make the name nice and unique.
|
36
|
-
@database_name ||= "appland-rails-test-#{Random.bytes(8).unpack1('h*')}"
|
36
|
+
@database_name ||= "appland-rails-test-#{Random.new.bytes(8).unpack1('h*')}"
|
37
37
|
end
|
38
38
|
|
39
39
|
def bundle
|
@@ -18,10 +18,12 @@ describe 'remote recording', :order => :defined do
|
|
18
18
|
uri = URI("http://localhost:#{@service_port}/health")
|
19
19
|
|
20
20
|
100.times do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
begin
|
22
|
+
Net::HTTP.get(uri)
|
23
|
+
break
|
24
|
+
rescue Errno::ECONNREFUSED
|
25
|
+
sleep 0.1
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
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.
|
4
|
+
version: 0.81.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|