appmap 0.80.1 → 0.80.2

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: de1e5a636c3d6e807f11c54a29563e338804f3d101dc4779229596455cd60682
4
- data.tar.gz: cf2aba805fdb427da2a642826f490b0002eb1892dd57a07693b119582a8cd7e1
3
+ metadata.gz: 52ebea9f89c7f412123ff2473f0ed62f46f2be4e69e98574d59c3eb91f8ef29b
4
+ data.tar.gz: 823073540b9979ede52b30c0e70398894b284bf51d10fcce786f082258d363c8
5
5
  SHA512:
6
- metadata.gz: 6056dda497e69c32a6e7550c76b4b4e40a5cd5405d7244748af4f5f34ed7d6790eafa206470ac8c9a98019fec802944b4cec0cc274451028cf2c5d6f405bd626
7
- data.tar.gz: '039ef96a6ae64cf641e58fb364a2777a65dc507ded48027752ca766c65204659b844cb6408d17a077947968d1fbf006f7c9b29e2fdfe03fc392d90c4495361ff'
6
+ metadata.gz: f837ad0b0ac7520c36c4ba2aa1c2d897235d316068461019a77a826dac5e8bf1401f44815d9cfb4fb47194c7b9090c70f3936073e1e99f0c7124fa9fe1d6baac
7
+ data.tar.gz: abb39a31ffd07bdccb0f5835cdd69bf5bacd5eb0844ea8836995017fe41716560243d1629bed2ed9fce046636586d35a17dc6abaaa5286d8532e41a3ad94f5ec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.80.2](https://github.com/applandinc/appmap-ruby/compare/v0.80.1...v0.80.2) (2022-04-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Ensure that request env key is a string ([721baef](https://github.com/applandinc/appmap-ruby/commit/721baefbb3ba083bf6c5a1b46e6ddffa51feebec))
7
+ * Fix method_display_name ([b05c7fe](https://github.com/applandinc/appmap-ruby/commit/b05c7fe027a981214b224852dc54c5e467e1f116))
8
+
1
9
  ## [0.80.1](https://github.com/applandinc/appmap-ruby/compare/v0.80.0...v0.80.1) (2022-04-08)
2
10
 
3
11
 
@@ -78,7 +78,7 @@ module AppMap
78
78
  end
79
79
 
80
80
  collapse_package = lambda do |package|
81
- return unless package.type == 'package'
81
+ next unless package.type == 'package'
82
82
 
83
83
  while package.children.length == 1 && package.children.all? { |child| child.type == 'package' }
84
84
  child = package.children[0]
@@ -147,7 +147,7 @@ module AppMap
147
147
  else
148
148
  path_obj.inspect
149
149
  end
150
- path = path[Dir.pwd.length + 1..] if path.index(Dir.pwd) == 0
150
+ path = path[Dir.pwd.length + 1..-1] if path.index(Dir.pwd) == 0
151
151
  path
152
152
  end
153
153
  end
@@ -18,6 +18,8 @@ module AppMap
18
18
  method
19
19
  end
20
20
 
21
+ RUBY_MAJOR_VERSION, RUBY_MINOR_VERSION, _ = RUBY_VERSION.split('.').map(&:to_i)
22
+
21
23
  # Single hooked method.
22
24
  # Call #activate to override the original.
23
25
  class Method
@@ -51,18 +53,31 @@ module AppMap
51
53
  if hook_class == Kernel
52
54
  hook_class.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
53
55
  else
54
- hook_class.ancestors.find { |cls| cls.method_defined?(hook_method.name, false) }.tap do |cls|
55
- if cls
56
- cls.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
57
- else
58
- warn "#{hook_method.name} not found on #{hook_class}"
59
- end
56
+ cls = defining_class(hook_class)
57
+ if cls
58
+ cls.define_method_with_arity(hook_method.name, hook_method.arity, hook_method_def)
60
59
  end
61
60
  end
62
61
  end
63
62
 
64
63
  protected
65
64
 
65
+ def defining_class(hook_class)
66
+ cls = \
67
+ if RUBY_MAJOR_VERSION == 2 && RUBY_MINOR_VERSION <= 5
68
+ hook_class
69
+ .ancestors
70
+ .select { |cls| cls.method_defined?(hook_method.name) }
71
+ .find { |cls| cls.instance_method(hook_method.name).owner == cls }
72
+ else
73
+ hook_class.ancestors.find { |cls| cls.method_defined?(hook_method.name, false) }
74
+ end
75
+
76
+ return cls if cls
77
+
78
+ warn "#{hook_method.name} not found on #{hook_class}"
79
+ end
80
+
66
81
  def gettime
67
82
  Process.clock_gettime Process::CLOCK_MONOTONIC
68
83
  end
@@ -78,7 +93,7 @@ module AppMap
78
93
  def method_display_name
79
94
  return @method_display_name if @method_display_name
80
95
 
81
- return @method_display_name = [defined_class, method_symbol, hook_method.name].join if defined_class
96
+ return @method_display_name = [defined_class, '#', hook_method.name].join if defined_class
82
97
 
83
98
  "#{hook_method.name} (class resolution deferred)"
84
99
  end
data/lib/appmap/rspec.rb CHANGED
@@ -78,7 +78,7 @@ module AppMap
78
78
  super
79
79
 
80
80
  webdriver_port = lambda do
81
- return unless defined?(page) && page&.driver
81
+ next unless defined?(page) && page&.driver
82
82
 
83
83
  # This is the ugliest thing ever but I don't want to lose it.
84
84
  # All the WebDriver calls are getting app-mapped and it's really unclear
@@ -15,8 +15,8 @@ module AppMap
15
15
 
16
16
  def perform
17
17
  to_markdown = lambda do |obj|
18
- return obj.each(&to_markdown) if obj.is_a?(Array)
19
- return unless obj.is_a?(Hash)
18
+ next obj.each(&to_markdown) if obj.is_a?(Array)
19
+ next unless obj.is_a?(Hash)
20
20
 
21
21
  description = obj['description']
22
22
  obj['description'] = converter.(description) if description
@@ -10,8 +10,8 @@ module AppMap
10
10
  def perform
11
11
  clean_only = nil
12
12
  clean = lambda do |obj, properties = %w[description example]|
13
- return obj.each(&clean_only.(properties)) if obj.is_a?(Array)
14
- return unless obj.is_a?(Hash)
13
+ next obj.each(&clean_only.(properties)) if obj.is_a?(Array)
14
+ next unless obj.is_a?(Hash)
15
15
 
16
16
  properties.each { |property| obj.delete property }
17
17
 
data/lib/appmap/util.rb CHANGED
@@ -122,7 +122,7 @@ module AppMap
122
122
  # Apparently, it's following the CGI spec in doing so.
123
123
  # https://datatracker.ietf.org/doc/html/rfc3875#section-4.1.18
124
124
  matching_headers = env
125
- .select { |k,v| k.start_with? 'HTTP_' }
125
+ .select { |k,v| k.to_s.start_with? 'HTTP_' }
126
126
  .merge(
127
127
  'CONTENT_TYPE' => env['CONTENT_TYPE'],
128
128
  'CONTENT_LENGTH' => env['CONTENT_LENGTH'],
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.80.1'
6
+ VERSION = '0.80.2'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.5.1'
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.80.1
4
+ version: 0.80.2
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-04-08 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport