appmap 0.95.2 → 0.97.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 177a2a689dc20a9be5f4d893ed1810d6aba418aae54509dcb15a755b355f969b
4
- data.tar.gz: c1ade759825520b4a538e03f4ec3b4a7c83d4e63770477863d8c9a09d5d50217
3
+ metadata.gz: d8f61995f7dd2cfd9ac33245e4248b4e3fb54f3063eacee3070da171ef852847
4
+ data.tar.gz: ff3648db694330d2d8242601fc6380320fa49252f68065fa1a7e1f416e96fbe2
5
5
  SHA512:
6
- metadata.gz: 780bc1e5ad75545f395f6f0e5d323daec048eed9c359d4e30535515a96e66715268ee9943d1e19274c80dc9fc468186ec223da85923a71d41a6e31124acc0891
7
- data.tar.gz: bb0da3d36faafbb5ac8be2f968b78c2765752ed6d3f2dda2fddf18cb4d941ae1e1ddaa8e0327858e649a91c3b44d719e20210de7f812ab341da34e6224193307
6
+ metadata.gz: da483d2262fa5f9691bb59293f5ec5d7a0a5b3910b68db99171e7d9b4b398e3203f8cbbe614407e91bc4d82e50c2bbf35a62562b1e31a2f59820ef893e0e7506
7
+ data.tar.gz: f7e30a0d17c134e5dd2f261707a8b4594c39ec795bbef8ef35af71e26c51b70ebd500cfe020b2f736be0b0bd1afb84baeff49d36624233234e07a936eb467ce4
data/.travis.yml CHANGED
@@ -13,6 +13,7 @@ rvm:
13
13
  - 2.7.6
14
14
  - 3.0.1 # doesn't show in pre-installed list
15
15
  - 3.1.2
16
+ - 3.2.0
16
17
 
17
18
  addons:
18
19
  postgresql: "13"
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.exists?(dirname) && File.writable?(dirname)
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(value, max_depth: MAX_DEPTH, type_info: {}, observed_values: Set.new(), depth: 0)
15
- return type_info if depth == max_depth
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 value.respond_to?(:keys)
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
- { name: key, class: best_class_name(next_value) }
27
- rescue
28
- warn "Error in add_schema(#{next_value.class})", $!
29
- raise
30
- end
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 value.respond_to?(:first)
36
- detect_schema(value.first, **{ max_depth: max_depth, type_info: type_info, observed_values: observed_values, depth: depth + 1 })
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
@@ -3,11 +3,11 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.95.2'
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.95.2
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-01-27 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source