appmap 0.89.0 → 0.90.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d046b1cedf455ae967a663b200c05751c4c0659defa5e7dce0a7f760ba865b6
4
- data.tar.gz: 790f5a9705b0d32b60467ecb8e51dc75e8fdbb2ac3af2022ee1c8a1a7c8cc8ca
3
+ metadata.gz: e8c53e191f43fe539ca2fd9381bf690597ec89b96ab1848680344b3d52a1b8f6
4
+ data.tar.gz: 1ee5593abdd95aefcc4b10a9ac717ea281e27885a4fd6a89fa0dc10ea5c2f66a
5
5
  SHA512:
6
- metadata.gz: 7c999d39cb9385f3758746cf93d50f291a4a6f9ae1c8b33266897975bdd9aabf4c8a3f666a3b3650ee70a24978d574a5db0bfefe2539240b582f1a430eabe399
7
- data.tar.gz: 731810f9c4afe0c0c9130ab81d71e0c20f85860bf57fef5d5736845aba4c4d240dff101bc5a46aef4c6ca9e08f5adfe90ac749bb059fc7ecacd08aec77926f4e
6
+ metadata.gz: c718347cfdb809cdfbdd46bee5399a98e6100d5afc3120e060f297d6f950227f1e263fab6baf5b705c4ec3573ef2f9aa1d1e96aff2053e120de1a2cc7dc4a55e
7
+ data.tar.gz: 89e90d35c06c1ae3db76bb58481dce70420081c92e386dc1b75922fbe53fcdac2609f157967fdacf476e3ed9c5f5c79bcfe83a88e56f84ab14aebaaab36fccfe
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/.travis.yml CHANGED
@@ -5,7 +5,6 @@ cache:
5
5
  - yarn
6
6
 
7
7
  rbenv:
8
- - 2.5
9
8
  - 2.6
10
9
  - 2.7
11
10
  - 3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [0.90.1](https://github.com/applandinc/appmap-ruby/compare/v0.90.0...v0.90.1) (2022-09-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Faster comment extraction ([f6199a6](https://github.com/applandinc/appmap-ruby/commit/f6199a607fadd58500d9cdc9394b39413e6b2930))
7
+
8
+
9
+ ### Performance Improvements
10
+
11
+ * Don't save comment and source in classmap. ([c3c8e75](https://github.com/applandinc/appmap-ruby/commit/c3c8e755677d169610bfa7e55c12f0d418120eb7))
12
+
13
+ # [0.90.0](https://github.com/applandinc/appmap-ruby/compare/v0.89.0...v0.90.0) (2022-09-15)
14
+
15
+
16
+ ### Features
17
+
18
+ * Include required_ruby_version in the gemspec ([a5d7c6b](https://github.com/applandinc/appmap-ruby/commit/a5d7c6b7b255f817f3ceec5924cd799d2565daa4))
19
+ * Save default appmap.yml ([77a08d5](https://github.com/applandinc/appmap-ruby/commit/77a08d5ebbe2f49f19237242a62d05aadcc84228))
20
+
1
21
  # [0.89.0](https://github.com/applandinc/appmap-ruby/compare/v0.88.0...v0.89.0) (2022-09-07)
2
22
 
3
23
 
data/appmap.gemspec CHANGED
@@ -12,6 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.authors = ['Kevin Gilpin']
13
13
  spec.email = ['kgilpin@gmail.com']
14
14
 
15
+ spec.required_ruby_version = '>= 2.6.0'
16
+
15
17
  spec.summary = %q{Record the operation of a Ruby program, using the AppLand 'AppMap' format.}
16
18
  spec.homepage = AppMap::URL
17
19
  spec.license = 'MIT'
@@ -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
data/lib/appmap/config.rb CHANGED
@@ -338,28 +338,34 @@ module AppMap
338
338
  AppMap uses this file to customize its behavior. For example, you can use
339
339
  the 'packages' setting to indicate which local file paths and dependency
340
340
  gems you want to include in the AppMap. Since you haven't provided specific
341
- settings, the appmap gem will try and guess some reasonable defaults.
342
- To suppress this message, create the file:
343
-
344
- #{Pathname.new(config_file_name).expand_path}
345
-
346
- Here are the default settings that will be used in the meantime. You can
347
- copy and paste this example to start your appmap.yml.
341
+ settings, the appmap gem will use these default options:
348
342
  MISSING_FILE_MSG
349
343
  {}
350
344
  end
351
345
 
352
346
  load(config_data).tap do |config|
353
- config_yaml = {
347
+ {
354
348
  'name' => config.name,
355
349
  'packages' => config.packages.select{|p| p.path}.map do |pkg|
356
350
  { 'path' => pkg.path }
357
351
  end,
358
352
  'exclude' => []
359
- }.compact
360
- unless config_present
361
- warn Util.color(YAML.dump(config_yaml), :magenta)
362
- warn logo.()
353
+ }.compact.tap do |config_yaml|
354
+ unless config_present
355
+ warn Util.color(YAML.dump(config_yaml), :magenta)
356
+ dirname = Pathname.new(config_file_name).dirname.expand_path
357
+ if Dir.exists?(dirname) && File.writable?(dirname)
358
+ warn Util.color(<<~CONFIG_FILE_MSG, :magenta)
359
+ This file will be saved to #{Pathname.new(config_file_name).expand_path},
360
+ where you can customize it.
361
+ CONFIG_FILE_MSG
362
+ File.write(config_file_name, YAML.dump(config_yaml))
363
+ end
364
+ warn Util.color(<<~CONFIG_FILE_MSG, :magenta)
365
+ For more information, see https://appmap.io/docs/reference/appmap-ruby.html#configuration
366
+ CONFIG_FILE_MSG
367
+ warn logo.()
368
+ end
363
369
  end
364
370
  end
365
371
  end
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,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.89.0'
6
+ VERSION = '0.90.1'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.7.0'
9
9
 
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.89.0
4
+ version: 0.90.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-09-07 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
@@ -446,7 +446,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
446
  requirements:
447
447
  - - ">="
448
448
  - !ruby/object:Gem::Version
449
- version: '0'
449
+ version: 2.6.0
450
450
  required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  requirements:
452
452
  - - ">="