appmap 0.95.2 → 0.97.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +19 -0
- data/lib/appmap/config.rb +1 -1
- data/lib/appmap/value_inspector.rb +33 -10
- data/lib/appmap/version.rb +2 -2
- 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: d8f61995f7dd2cfd9ac33245e4248b4e3fb54f3063eacee3070da171ef852847
|
4
|
+
data.tar.gz: ff3648db694330d2d8242601fc6380320fa49252f68065fa1a7e1f416e96fbe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da483d2262fa5f9691bb59293f5ec5d7a0a5b3910b68db99171e7d9b4b398e3203f8cbbe614407e91bc4d82e50c2bbf35a62562b1e31a2f59820ef893e0e7506
|
7
|
+
data.tar.gz: f7e30a0d17c134e5dd2f261707a8b4594c39ec795bbef8ef35af71e26c51b70ebd500cfe020b2f736be0b0bd1afb84baeff49d36624233234e07a936eb467ce4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# [0.97.0](https://github.com/getappmap/appmap-ruby/compare/v0.96.0...v0.97.0) (2023-02-10)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Implement `items` Parameter object format (AppMap v1.10.0) ([9a28773](https://github.com/getappmap/appmap-ruby/commit/9a2877396187393adfe6e4379f0d6a735d5678b4))
|
7
|
+
|
8
|
+
# [0.96.0](https://github.com/getappmap/appmap-ruby/compare/v0.95.2...v0.96.0) (2023-02-01)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Dir.exists? and File.exists? don't exist in Ruby 3.2 ([2879b06](https://github.com/getappmap/appmap-ruby/commit/2879b06a0bfe68e178afc0f2ba1d9320100b7b7a))
|
14
|
+
|
15
|
+
|
16
|
+
### Features
|
17
|
+
|
18
|
+
* Accept ruby 3.2 ([2326a88](https://github.com/getappmap/appmap-ruby/commit/2326a8876ad093b699eb909f43dc885ada98bab9))
|
19
|
+
|
1
20
|
## [0.95.2](https://github.com/getappmap/appmap-ruby/compare/v0.95.1...v0.95.2) (2023-01-27)
|
2
21
|
|
3
22
|
|
data/lib/appmap/config.rb
CHANGED
@@ -357,7 +357,7 @@ module AppMap
|
|
357
357
|
unless config_present
|
358
358
|
warn Util.color(YAML.dump(config_yaml), :magenta)
|
359
359
|
dirname = Pathname.new(config_file_name).dirname.expand_path
|
360
|
-
if Dir.
|
360
|
+
if Dir.exist?(dirname) && File.writable?(dirname)
|
361
361
|
warn Util.color(<<~CONFIG_FILE_MSG, :magenta)
|
362
362
|
This file will be saved to #{Pathname.new(config_file_name).expand_path},
|
363
363
|
where you can customize it.
|
@@ -3,6 +3,7 @@ module AppMap
|
|
3
3
|
extend self
|
4
4
|
|
5
5
|
MAX_DEPTH = 3
|
6
|
+
MAX_ARRAY_ELEMENTS = 5
|
6
7
|
|
7
8
|
def detect_size(value)
|
8
9
|
# Don't risk calling #size on things like data-access objects, which can and will issue queries for this information.
|
@@ -11,10 +12,17 @@ module AppMap
|
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
|
-
def detect_schema(
|
15
|
-
|
15
|
+
def detect_schema(
|
16
|
+
value,
|
17
|
+
max_depth: MAX_DEPTH,
|
18
|
+
max_array_elements: MAX_ARRAY_ELEMENTS,
|
19
|
+
type_info: { class: best_class_name(value) },
|
20
|
+
observed_values: Set.new,
|
21
|
+
depth: 0
|
22
|
+
)
|
23
|
+
return type_info if depth >= max_depth && !array_like?(value)
|
16
24
|
|
17
|
-
if
|
25
|
+
if hash_like?(value)
|
18
26
|
return if observed_values.include?(value.object_id)
|
19
27
|
|
20
28
|
observed_values << value.object_id
|
@@ -23,17 +31,22 @@ module AppMap
|
|
23
31
|
next_value = value[key]
|
24
32
|
|
25
33
|
value_schema = begin
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
{ name: key, class: best_class_name(next_value) }
|
35
|
+
rescue
|
36
|
+
warn "Error in add_schema(#{next_value.class})", $!
|
37
|
+
raise
|
38
|
+
end
|
31
39
|
|
32
40
|
detect_schema(next_value, **{ max_depth: max_depth, type_info: value_schema, observed_values: observed_values, depth: depth + 1 })
|
33
41
|
end.compact
|
34
42
|
type_info[:properties] = properties unless properties.empty?
|
35
|
-
elsif
|
36
|
-
|
43
|
+
elsif array_like?(value)
|
44
|
+
type_info[:items] = value.take(max_array_elements).map do |next_value|
|
45
|
+
value_schema = { class: best_class_name(next_value) }
|
46
|
+
detect_schema(next_value, **{ max_depth: max_depth, type_info: value_schema, observed_values: observed_values, depth: depth + 1 })
|
47
|
+
end
|
48
|
+
|
49
|
+
type_info[:items] = type_info[:items].compact.uniq(&:hash)
|
37
50
|
end
|
38
51
|
type_info
|
39
52
|
end
|
@@ -46,5 +59,15 @@ module AppMap
|
|
46
59
|
end
|
47
60
|
value_cls&.name || "unknown"
|
48
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def array_like?(value)
|
66
|
+
value.is_a?(Enumerable) && !hash_like?(value)
|
67
|
+
end
|
68
|
+
|
69
|
+
def hash_like?(value)
|
70
|
+
value.respond_to?(:keys)
|
71
|
+
end
|
49
72
|
end
|
50
73
|
end
|
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.97.0'
|
7
7
|
|
8
8
|
APPMAP_FORMAT_VERSION = '1.10.0'
|
9
9
|
|
10
|
-
SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1].freeze
|
10
|
+
SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1 3.2].freeze
|
11
11
|
|
12
12
|
DEFAULT_APPMAP_DIR = 'tmp/appmap'.freeze
|
13
13
|
DEFAULT_CONFIG_FILE_PATH = 'appmap.yml'.freeze
|
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.97.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: 2023-
|
11
|
+
date: 2023-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|