appmap 0.90.0 → 0.91.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: 463d826fad7ff1f1f143f350e329e0d9f58c649c6a517b519c42e852d620318a
4
- data.tar.gz: f1429c965be9a9913c2163245e3cee99b6b014d73c85d77c19b1d1198b5e92ec
3
+ metadata.gz: 4d721301c87647a2778b1019519a7ada3fc225761b32149070ee38d8e47c5643
4
+ data.tar.gz: b4a130739d8974a3adbe44a9020618e9f88530174de19e8aaa0713dad23336c4
5
5
  SHA512:
6
- metadata.gz: 8fb3886bd1f864f4619f5dc0bd158381b4c959a385990d786d45228c0a2f01169511ef0a3ebafec6e01874af566bb286edfb38367f34b83facb7959ded3bd4ae
7
- data.tar.gz: 96adc82206bf8fb319675a6107281c1ebfb19c8254daac59ae9e88ebceeec8adc446b459a68fa3483108426cb5a65bfbecb42205b4b797ae3301777b6e473233
6
+ metadata.gz: 9f0778dc18e12f668bc072b94f21f61f1310c6d0163531e7e8407fd5e45d64d9a2e1b2a9d4c0cf98c1ba3f31697ca38ee50461f55b293893442a7b19f515ac3a
7
+ data.tar.gz: 9469680e79ccf0e8a43967c1c6d0104c48d35399fd39b205bfc9d3c41f32f2469d527989f38e965f80e00f320cfce9026c124ed775f27ba773bf58d449083d6c
data/.rubocop.yml CHANGED
@@ -18,7 +18,7 @@ Layout/LineLength:
18
18
  Max: 120
19
19
 
20
20
  Metrics/BlockLength:
21
- ExcludedMethods:
21
+ AllowedMethods:
22
22
  - describe
23
23
  - it
24
24
  - context
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [0.91.0](https://github.com/applandinc/appmap-ruby/compare/v0.90.1...v0.91.0) (2022-09-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * Emit metadata.recorder.type ([6358669](https://github.com/applandinc/appmap-ruby/commit/6358669d5dc5123a613b18301519dac709614406))
7
+
8
+ ## [0.90.1](https://github.com/applandinc/appmap-ruby/compare/v0.90.0...v0.90.1) (2022-09-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Faster comment extraction ([f6199a6](https://github.com/applandinc/appmap-ruby/commit/f6199a607fadd58500d9cdc9394b39413e6b2930))
14
+
15
+
16
+ ### Performance Improvements
17
+
18
+ * Don't save comment and source in classmap. ([c3c8e75](https://github.com/applandinc/appmap-ruby/commit/c3c8e755677d169610bfa7e55c12f0d418120eb7))
19
+
1
20
  # [0.90.0](https://github.com/applandinc/appmap-ruby/compare/v0.89.0...v0.90.0) (2022-09-15)
2
21
 
3
22
 
@@ -50,7 +50,7 @@ module AppMap
50
50
  end
51
51
  end
52
52
  Function = Struct.new(:name) do
53
- attr_accessor :static, :location, :labels, :comment, :source
53
+ attr_accessor :static, :location, :labels
54
54
 
55
55
  def type
56
56
  'function'
@@ -63,8 +63,6 @@ module AppMap
63
63
  location: location,
64
64
  static: static,
65
65
  labels: labels,
66
- comment: comment,
67
- source: source
68
66
  }.delete_if { |_, v| v.nil? || v == [] }
69
67
  end
70
68
  end
@@ -126,7 +124,6 @@ module AppMap
126
124
  end
127
125
 
128
126
  comment = method.comment
129
- function_info[:comment] = comment unless Util.blank?(comment)
130
127
 
131
128
  function_info[:labels] = parse_labels(comment) + (method.labels || [])
132
129
  object_infos << function_info
@@ -92,7 +92,8 @@ module AppMap
92
92
  'version' => Gem.loaded_specs['cucumber']&.version&.to_s
93
93
  }
94
94
  m['recorder'] = {
95
- 'name' => 'cucumber'
95
+ 'name' => 'cucumber',
96
+ 'type' => 'tests'
96
97
  }
97
98
  end
98
99
  end
@@ -63,7 +63,8 @@ module AppMap
63
63
 
64
64
  metadata = AppMap.detect_metadata
65
65
  metadata[:recorder] = {
66
- name: 'remote_recording'
66
+ name: 'remote_recording',
67
+ type: 'remote'
67
68
  }
68
69
 
69
70
  response = JSON.generate \
@@ -103,7 +104,8 @@ module AppMap
103
104
  metadata[:name] = appmap_name
104
105
  metadata[:timestamp] = start_time.to_f
105
106
  metadata[:recorder] = {
106
- name: 'record_requests'
107
+ name: 'rack',
108
+ type: 'requests'
107
109
  }
108
110
 
109
111
  appmap = {
@@ -101,7 +101,8 @@ module AppMap
101
101
  version: Gem.loaded_specs['minitest']&.version&.to_s
102
102
  }
103
103
  m[:recorder] = {
104
- name: 'minitest'
104
+ name: 'minitest',
105
+ type: 'tests'
105
106
  }
106
107
  m[:test_status] = test_status
107
108
  if exception
data/lib/appmap/record.rb CHANGED
@@ -14,7 +14,8 @@ at_exit do
14
14
 
15
15
  metadata = AppMap.detect_metadata
16
16
  metadata[:recorder] = {
17
- name: 'record_process'
17
+ name: 'record_process',
18
+ type: 'process'
18
19
  }
19
20
 
20
21
  appmap = {
data/lib/appmap/rspec.rb CHANGED
@@ -192,7 +192,8 @@ module AppMap
192
192
  version: Gem.loaded_specs['rspec-core']&.version&.to_s
193
193
  }
194
194
  m[:recorder] = {
195
- name: 'rspec'
195
+ name: 'rspec',
196
+ type: 'tests'
196
197
  }
197
198
  m[:test_status] = test_status
198
199
  if exception
data/lib/appmap/trace.rb CHANGED
@@ -21,8 +21,11 @@ module AppMap
21
21
  end
22
22
 
23
23
  def comment
24
- @method.comment
25
- rescue MethodSource::SourceNotFoundError, Errno::EINVAL
24
+ return nil if source_location.nil? || source_location.first.start_with?('<')
25
+
26
+ # Do not use method_source's comment method because it's slow
27
+ @comment ||= RubyMethod.last_comment *source_location
28
+ rescue Errno::EINVAL, Errno::ENOENT
26
29
  nil
27
30
  end
28
31
 
@@ -37,6 +40,21 @@ module AppMap
37
40
  def labels
38
41
  @package.labels
39
42
  end
43
+
44
+ private
45
+
46
+ # Read file and get last comment before line.
47
+ def self.last_comment(file, line_number)
48
+ File.open(file) do |f|
49
+ buffer = []
50
+ f.each_line.lazy.take(line_number - 1).reverse_each do |line|
51
+ break unless (line =~ /^\s*#/) || (line =~ /^\s*$/)
52
+
53
+ buffer << line.lstrip
54
+ end
55
+ buffer.reverse.join
56
+ end
57
+ end
40
58
  end
41
59
 
42
60
  class Tracing
@@ -3,9 +3,9 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.90.0'
6
+ VERSION = '0.91.0'
7
7
 
8
- APPMAP_FORMAT_VERSION = '1.7.0'
8
+ APPMAP_FORMAT_VERSION = '1.9.0'
9
9
 
10
10
  SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1].freeze
11
11
 
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.90.0
4
+ version: 0.91.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: 2022-09-15 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source