appmap 0.96.0 → 0.98.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/appmap/value_inspector.rb +34 -11
- data/lib/appmap/version.rb +1 -1
- 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: 409ba80fae04609fbed2635342499d743638bf1be48c9a2872931fb21898ffee
|
4
|
+
data.tar.gz: 26dab002cc9e0d616cb803d0d67095c5d5eaf307ae8f8b86f6e4a3446127af99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9db98d6ca5f3a620b03ea1b8ecaa2fff7769745ec1b8dda2cee635cca7024f73b90fd6cd6b4c1eacebed5645630e30113d1c771ee07d1af6107d2de228ee58bf
|
7
|
+
data.tar.gz: a777268c6a9edd86113c9f139c010f0987ed60f91ed050bfe9d42bf5dce4e8d4e8acd2bcf9eaef0cade32159ea02ba590998b41cd5520c7d3c24a4652e0d6dad
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [0.98.0](https://github.com/getappmap/appmap-ruby/compare/v0.97.0...v0.98.0) (2023-02-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Allow environment configuration of property value inspection ([20579d3](https://github.com/getappmap/appmap-ruby/commit/20579d3b481e08b6949c9c593c3cb44d1fec37e3))
|
7
|
+
|
8
|
+
# [0.97.0](https://github.com/getappmap/appmap-ruby/compare/v0.96.0...v0.97.0) (2023-02-10)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* Implement `items` Parameter object format (AppMap v1.10.0) ([9a28773](https://github.com/getappmap/appmap-ruby/commit/9a2877396187393adfe6e4379f0d6a735d5678b4))
|
14
|
+
|
1
15
|
# [0.96.0](https://github.com/getappmap/appmap-ruby/compare/v0.95.2...v0.96.0) (2023-02-01)
|
2
16
|
|
3
17
|
|
@@ -2,7 +2,8 @@ module AppMap
|
|
2
2
|
module ValueInspector
|
3
3
|
extend self
|
4
4
|
|
5
|
-
MAX_DEPTH = 3
|
5
|
+
MAX_DEPTH = ENV.fetch('APPMAP_PROPERTY_MAX_DEPTH', 3).to_i
|
6
|
+
MAX_ARRAY_ELEMENTS = ENV.fetch('APPMAP_PROPERTY_MAX_ARRAY_ELEMENTS', 5).to_i
|
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
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.98.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-02-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|